mirror of
https://gitee.com/openharmony/xts_tools
synced 2025-02-25 11:41:03 +00:00
!14 fix xts build module info issue 4
Merge pull request !14 from jiyong/myfeature
This commit is contained in:
commit
62d1dba204
2
build.sh
2
build.sh
@ -166,7 +166,7 @@ build_wifiiot()
|
||||
|
||||
cp -rf ${DIST_DIR}/${current_xts} ${suite_root_dir}
|
||||
rm -f ${suite_out_dir}/.bin
|
||||
cp -rf ${DIST_DIR}/module_info.json ${suite_out_dir}
|
||||
cp -rf ${DIST_DIR}/json/module_info.json ${suite_out_dir}
|
||||
cd $suite_root_dir
|
||||
rm -f ${suite_out_zip}
|
||||
zip -rv ${suite_out_zip} ${current_xts}
|
||||
|
@ -125,9 +125,8 @@ class SuiteModuleBuilder:
|
||||
'build_target_name or subsystem_name of testmodule "%s" '
|
||||
'is invalid!' % module_name)
|
||||
return
|
||||
module_info_dir = os.path.dirname(suite_out_dir)
|
||||
module_info_list_file = os.path.join(module_info_dir,
|
||||
'module_info.json')
|
||||
module_info_list_file = os.path.join(
|
||||
suite_out_dir, '{}_module_info.json'.format(module_name))
|
||||
module_info_data = {}
|
||||
if os.path.exists(module_info_list_file):
|
||||
try:
|
||||
|
@ -240,13 +240,18 @@ template("test_suite") {
|
||||
if (defined(invoker.version)) {
|
||||
_version = invoker.version
|
||||
_out_dir = rebase_path("${_suite_path}/testcases")
|
||||
_args1 = [
|
||||
_args2 = [
|
||||
"--method_name",
|
||||
"record_test_component_info",
|
||||
"--arguments",
|
||||
"out_dir=${_out_dir}#version=${_version}",
|
||||
]
|
||||
exec_script(rebase_path("$BUILD_DIR_PREFIX/utils.py"), _args1)
|
||||
action("generate_module_data") {
|
||||
script = rebase_path("$BUILD_DIR_PREFIX/utils.py")
|
||||
deps = _deps
|
||||
args = _args2
|
||||
outputs = [ "${SUITE_OUTPUT_PREFIX}${target_name}/${SUITE_TESTCASES_NAME}/module_info.json" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -272,9 +272,7 @@ def record_testmodule_info(build_target_name, module_name,
|
||||
'build_target_name or subsystem_name of testmodule "%s" '
|
||||
'is invalid!' % module_name)
|
||||
return
|
||||
module_info_dir = os.path.dirname(suite_out_dir)
|
||||
module_info_list_file = os.path.join(module_info_dir,
|
||||
'module_info.json')
|
||||
module_info_list_file = os.path.join(suite_out_dir, 'module_info.json')
|
||||
module_info_data = {}
|
||||
if os.path.exists(module_info_list_file):
|
||||
try:
|
||||
@ -292,8 +290,20 @@ def record_testmodule_info(build_target_name, module_name,
|
||||
def record_test_component_info(out_dir, version):
|
||||
if not os.path.exists(out_dir):
|
||||
os.makedirs(out_dir)
|
||||
all_module_file = os.path.join(out_dir, 'module_info.json')
|
||||
all_module_data = {}
|
||||
for root, dirs, files in os.walk(out_dir):
|
||||
for file in files:
|
||||
if file.endswith("module_info.json"):
|
||||
with open(os.path.join(root, file), 'r') as json_data:
|
||||
module_data = json.load(json_data)
|
||||
all_module_data.update(module_data)
|
||||
os.remove(os.path.join(root, file))
|
||||
with open(all_module_file, 'w') as out_file:
|
||||
json.dump(all_module_data, out_file)
|
||||
|
||||
test_component_file = os.path.join(out_dir, 'test_component.json')
|
||||
test_component_data = {'version': version}
|
||||
test_component_data = {'version': version, }
|
||||
with open(test_component_file, 'w') as out_file:
|
||||
json.dump(test_component_data, out_file)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user