diff --git a/BUILD.gn b/BUILD.gn index 6dce3edb72ace93760105185ce83a1b8fd8b8de6..6e6df7b92a67071ab573b892dbb76e35c35232ac 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -272,3 +272,10 @@ group("ark_js_host_unittest") { "//arkcompiler/toolchain:ark_toolchain_host_unittest", ] } + +group("runtime_core_host_ut") { + testonly = true + if (ark_standalone_build) { + deps = [ "$ark_root:runtime_core_host_unittest" ] + } +} diff --git a/build/compile_script/ark.py b/build/compile_script/ark.py index 1f9fff0995936dce80d5ca9ffbf15cc4ebb1b10a..c3fba73276e37a7aafa0ef242488f934205e5ecd 100755 --- a/build/compile_script/ark.py +++ b/build/compile_script/ark.py @@ -92,6 +92,7 @@ class ArkPy: DELIMITER_FOR_SECOND_OUT_DIR_NAME = "." GN_TARGET_LOG_FILE_NAME = "build.log" UNITTEST_LOG_FILE_NAME = "unittest.log" + RUNTIME_CORE_UNITTEST_LOG_FILE_NAME = "runtime_core_unittest.log" TEST262_LOG_FILE_NAME = "test262.log" REGRESS_TEST_LOG_FILE_NAME = "regresstest.log" PREBUILTS_DOWNLOAD_CONFIG_FILE_PATH = \ @@ -210,6 +211,13 @@ class ArkPy: \"disable_force_gc=true\" to command when running unittest of non-host type with qemu.", "gn_targets_depend_on": ["unittest_packages"], }, + "runtime_core_unittest": { + "flags": ["runtime_core_unittest"], + "description": + "Compile and run runtime_core_unittest of arkcompiler target. " + "Add --keep-going=N to keep running runtime_core_unittest when errors occured less than N. ", + "gn_targets_depend_on": ["runtime_core_unittest_packages"], + }, "workload": { "flags": ["workload", "work-load", "work_load"], "description": "Compile arkcompiler target and run workload with arkcompiler target.", @@ -531,6 +539,8 @@ class ArkPy: args_to_test262_cmd.append("--sendable sendable") elif ".js" in arg: args_to_test262_cmd.append("--file test262/data/test_es2021/{}".format(arg)) + elif "--abc2program" in arg: + args_to_test262_cmd.append("--abc2program --es2021 all") else: args_to_test262_cmd.append("--dir test262/data/test_es2021/{}".format(arg)) else: @@ -558,7 +568,12 @@ class ArkPy: test_list_value, arg_list = ArkPy.parse_option(arg_list, option_name=test_list_name, default_value=None) if test_list_value is not None: args_to_regress_cmd.extend([test_list_name, test_list_value]) - + compiler_opt_track_field_name = "--compiler-opt-track-field" + compiler_opt_track_field_value, arg_list = ArkPy.parse_bool_option( + arg_list, option_name=compiler_opt_track_field_name, default_value=False + ) + if compiler_opt_track_field_value: + args_to_regress_cmd.append(f"{compiler_opt_track_field_name}={compiler_opt_track_field_value}") if len(arg_list) == 1: arg = arg_list[0] if ".js" in arg: @@ -743,6 +758,7 @@ class ArkPy: " python3 ark.py \033[92m[os_cpu].[mode] [test262] [none or --baseline-jit] [none or --enable-rm] " \ "[none or --threads=X and/or --test-list TEST_LIST_NAME]\033[0m\n" " python3 ark.py \033[92m[os_cpu].[mode] [unittest] [option]\033[0m\n" + " python3 ark.py \033[92m[os_cpu].[mode] [runtime_core_unittest] [option]\033[0m\n" " python3 ark.py \033[92m[os_cpu].[mode] [regresstest] [none, file or dir] " \ "[none or --processes X and/or --test-list TEST_LIST_NAME]\033[0m\n") # Command examples @@ -760,6 +776,7 @@ class ArkPy: " python3 ark.py \033[92mx64.release test262 built-ins/Array\033[0m\n" " python3 ark.py \033[92mx64.release test262 built-ins/Array/name.js\033[0m\n" " python3 ark.py \033[92mx64.release unittest\033[0m\n" + " python3 ark.py \033[92mx64.release runtime_core_unittest\033[0m\n" " python3 ark.py \033[92mx64.release regresstest\033[0m\n" " python3 ark.py \033[92mx64.release regresstest --processes=4\033[0m\n" " python3 ark.py \033[92mx64.release workload\033[0m\n" @@ -874,9 +891,11 @@ class ArkPy: def build_for_suite(self, *, test_suite, test_script_name, test_script_path, out_path, gn_args: list, log_file_name, args_to_cmd: str, timeout, run_jit: bool = False, run_baseline_jit: bool = False, aot_mode: bool = False, - run_pgo: bool = False, enable_litecg: bool = False, ignore_list: Optional[str] = None): + run_pgo: bool = False, enable_litecg: bool = False, ignore_list: Optional[str] = None, + skip_compiler: bool = False): x64_out_path = self.__get_x64_out_path(out_path) - self.call_build_gn_target(gn_args, out_path, x64_out_path, test_suite, log_file_name) + if not skip_compiler: + self.call_build_gn_target(gn_args, out_path, x64_out_path, test_suite, log_file_name) cmd = self.get_build_cmd( test_suite=test_suite, test_script_name=test_script_name, @@ -909,6 +928,7 @@ class ArkPy: is_litecg, arg_list = self.__purge_arg_list("--litecg", arg_list) is_jit, arg_list = self.__purge_arg_list("--jit", arg_list) is_baseline_jit, arg_list = self.__purge_arg_list("--baseline-jit", arg_list) + is_skip_compiler, arg_list = self.__purge_arg_list("--skip-compiler", arg_list) print(f"Test262: arg_list = {arg_list}") args_to_test262_cmd = self.build_args_to_test262_cmd(arg_list) @@ -925,7 +945,8 @@ class ArkPy: run_pgo=is_pgo, run_baseline_jit=is_baseline_jit, aot_mode=is_aot_mode, - enable_litecg=is_litecg + enable_litecg=is_litecg, + skip_compiler=is_skip_compiler ) def build_for_unittest(self, out_path: str, gn_args: list, log_file_name: str): @@ -934,6 +955,11 @@ class ArkPy: log_file_name) return + def build_for_runtime_core_unittest(self, out_path: str, gn_args: list, log_file_name: str): + runtime_core_ut_depend = self.ARG_DICT.get("target").get("runtime_core_unittest").get("gn_targets_depend_on") + self.build_for_gn_target(out_path, gn_args, runtime_core_ut_depend, log_file_name) + return + def build_for_regress_test(self, out_path, gn_args: list, arg_list: list): timeout, arg_list = self.parse_option(arg_list, option_name="--timeout", default_value=200) ignore_list, arg_list = self.parse_option(arg_list, option_name="--ignore-list", default_value=None) @@ -945,6 +971,7 @@ class ArkPy: is_litecg, arg_list = self.__purge_arg_list("--litecg", arg_list) is_jit, arg_list = self.__purge_arg_list("--jit", arg_list) is_baseline_jit, arg_list = self.__purge_arg_list("--baseline-jit", arg_list) + is_skip_compiler, arg_list = self.__purge_arg_list("--skip-compiler", arg_list) print(f"Regress: arg_list = {arg_list}") args_to_regress_test_cmd = self.build_args_to_regress_cmd(arg_list) @@ -962,7 +989,8 @@ class ArkPy: run_baseline_jit=is_baseline_jit, aot_mode=is_aot, enable_litecg=is_litecg, - ignore_list=ignore_list + ignore_list=ignore_list, + skip_compiler=is_skip_compiler ) def build(self, out_path: str, gn_args: list, arg_list: list): @@ -980,6 +1008,11 @@ class ArkPy: print("\033[92m\"unittest\" not support additional arguments.\033[0m\n".format()) sys.exit(0) self.build_for_unittest(out_path, gn_args, self.UNITTEST_LOG_FILE_NAME) + elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("runtime_core_unittest"), arg_list[0]): + if len(arg_list) > 1: + print("\033[92m\"runtime_core_unittest\" not support additional arguments.\033[0m\n".format()) + sys.exit(0) + self.build_for_runtime_core_unittest(out_path, gn_args, self.RUNTIME_CORE_UNITTEST_LOG_FILE_NAME) elif self.is_dict_flags_match_arg(self.ARG_DICT.get("target").get("regresstest"), arg_list[0]): self.build_for_regress_test(out_path, gn_args, arg_list) else: diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index 5483815961175acc7ce9e56ae09b356390283331..6cc44ead8a04b0b721ff030310bef79b54cad927 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -40,6 +40,11 @@ group("unittest_packages") { deps = [ "$toolchain_root:ark_js_host_unittest" ] } +group("runtime_core_unittest_packages") { + testonly = true + deps = [ "$toolchain_root:runtime_core_host_ut" ] +} + group("ets_runtime") { deps = [ "$js_root:libark_jsruntime", diff --git a/test/ut/ignored-ut-debug-qemu-toolchain.txt b/test/ut/ignored-ut-debug-qemu-toolchain.txt new file mode 100644 index 0000000000000000000000000000000000000000..4947d2c90788a538a35bf49b26c5209f7c0ce56d --- /dev/null +++ b/test/ut/ignored-ut-debug-qemu-toolchain.txt @@ -0,0 +1 @@ +# Known failure list for ut - debug - qemu - toolchain diff --git a/test/ut/ignored-ut-debug-x64-toolchain.txt b/test/ut/ignored-ut-debug-x64-toolchain.txt new file mode 100644 index 0000000000000000000000000000000000000000..7b419d43412134b123b9df1dd85bb39c41c7d743 --- /dev/null +++ b/test/ut/ignored-ut-debug-x64-toolchain.txt @@ -0,0 +1 @@ +# Known failure list for ut - debug - x64 - toolchain diff --git a/test/ut/ignored-ut-release-qemu-toolchain.txt b/test/ut/ignored-ut-release-qemu-toolchain.txt new file mode 100644 index 0000000000000000000000000000000000000000..9853cd901c8b871b7de76a775d9ac1e132b4e0d1 --- /dev/null +++ b/test/ut/ignored-ut-release-qemu-toolchain.txt @@ -0,0 +1 @@ +# Known failure list for ut - release - qemu - toolchain diff --git a/test/ut/ignored-ut-release-x64-toolchain.txt b/test/ut/ignored-ut-release-x64-toolchain.txt new file mode 100644 index 0000000000000000000000000000000000000000..b05fec36c4a2de54c7307756e0d13fa8eb96886e --- /dev/null +++ b/test/ut/ignored-ut-release-x64-toolchain.txt @@ -0,0 +1 @@ +# Known failure list for ut - release - x64 - toolchain