diff --git a/jstest/builder/modules/iotjs.build.config b/jstest/builder/modules/iotjs.build.config index b4a1071..8a930dd 100644 --- a/jstest/builder/modules/iotjs.build.config +++ b/jstest/builder/modules/iotjs.build.config @@ -273,6 +273,10 @@ "src": "%{testsuite}", "dst": "%{build-dir}/tests" }, + { + "src": "%{tizen-iotjs-dir}/build/%{target}/%{build-type}/lib", + "dst": "%{build-dir}/tests/lib" + }, { "src": "%{tizen-rpm-package}", "dst": "%{build-dir}/iotjs-1.0.0-0.armv7l.rpm" diff --git a/jstest/builder/utils.py b/jstest/builder/utils.py index 59ceefb..d200950 100644 --- a/jstest/builder/utils.py +++ b/jstest/builder/utils.py @@ -13,6 +13,7 @@ # limitations under the License. import os +import re from jstest.builder import lumpy from jstest.common import utils @@ -49,14 +50,47 @@ def create_build_info(env): build_info = { 'build-date': utils.current_date('%Y-%m-%dT%H.%M.%SZ'), 'last-commit-date': submodules[env.options.app]['date'], - 'bin': calculate_section_sizes(env.paths.builddir), + 'bin': calculate_section_sizes(env.options.device, env.paths.builddir), 'submodules': submodules } utils.write_json_file(utils.join(env.paths.builddir, 'build.json'), build_info) -def calculate_section_sizes(builddir): +def calculate_section_sizes(target, builddir): + ''' + Return the sizes of the main sections. + ''' + if target == 'rpi3': + return calculate_section_sizes_dynamic_linking(builddir) + + return calculate_section_sizes_static_linking(builddir) + + +def calculate_section_sizes_dynamic_linking(builddir): + ''' + Return the sizes of the main sections. + ''' + section_sizes = { + 'bss': 0, + 'text': 0, + 'data': 0, + 'rodata': 0 + } + + output, exitcode = utils.execute(builddir, 'size', ['-A', '%s/lib/libiotjs.so' % builddir], quiet=True) + + if exitcode == 0: + for section_name in section_sizes: + match = re.search(r'\.%s[\ ]+([0-9]+)' % section_name, output) + + if match: + section_sizes[section_name] = int(match.group(1)) + + return section_sizes + + +def calculate_section_sizes_static_linking(builddir): ''' Return the sizes of the main sections. ''' @@ -68,7 +102,7 @@ def calculate_section_sizes(builddir): } mapfile = utils.join(builddir, 'linker.map') - libdir = utils.join(builddir, 'libs') + libdir = utils.join(builddir, 'lib') if not (utils.exists(mapfile) and utils.exists(libdir)): return section_sizes diff --git a/jstest/resources/resources.json b/jstest/resources/resources.json index 6d0d261..a5e92a1 100644 --- a/jstest/resources/resources.json +++ b/jstest/resources/resources.json @@ -9,7 +9,7 @@ "build": "%{build-path}/%{appname}/%{device}/%{build-type}", "tizen-build-root": "%{build}/tizen-build-root", "tizen-iotjs-dir": "%{build}/tizen-build-root/local/BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/BUILD/iotjs-1.0.0", - "tizen-rpm-package": "%{build}/tizen-build-root/local/repos/tizen50m2/armv7l/RPMS/iotjs-1.0.0-0.armv7l.rpm", + "tizen-rpm-package": "%{build}/tizen-build-root/local/BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/RPMS/armv7l/iotjs-1.0.0-0.armv7l.rpm", "result": "%{result-path}/%{appname}/%{device}" }, "modules": {