From 843aed67089abf146d3bdb6e39ea19611e72957e Mon Sep 17 00:00:00 2001 From: quiet-thought Date: Wed, 11 Jun 2025 17:23:45 +0800 Subject: [PATCH] Add multi-context option for test Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/ICCX81 Signed-off-by: quiet-thought Change-Id: I798eb807941f20bb95fa8a6c90cbe68f0299a03f --- test262/run_sunspider.py | 11 ++++++++++- test262/run_test262.py | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/test262/run_sunspider.py b/test262/run_sunspider.py index 60c7e6f7a1..1e6310d80c 100755 --- a/test262/run_sunspider.py +++ b/test262/run_sunspider.py @@ -114,6 +114,8 @@ def parse_args(): help="Use abc2prog to generate abc, aot or pgo is not supported yet under this option") parser.add_argument('--disable-force-gc', action='store_true', help="Run test262 with close force-gc") + parser.add_argument('--multi-context', action='store_true', + help="Run test262 with multi context") parser.add_argument('--enable-arkguard', action='store_true', required=False, help="enable arkguard for 262 tests") @@ -141,6 +143,7 @@ class ArkProgram(): self.run_pgo = False self.enable_litecg = False self.disable_force_gc = False + self.multi_context = False self.run_jit = False self.run_baseline_jit = False self.ark_aot_tool = ARK_AOT_TOOL @@ -181,6 +184,9 @@ class ArkProgram(): if self.args.disable_force_gc: self.disable_force_gc = self.args.disable_force_gc + if self.args.multi_context: + self.multi_context = self.args.multi_context + if self.args.run_jit: self.run_jit = self.args.run_jit @@ -694,7 +700,10 @@ class ArkProgram(): asm_arg1 = "--enable-force-gc=true" if unforce_gc or self.disable_force_gc: asm_arg1 = "--enable-force-gc=false" - cmd_args = [self.ark_tool, icu_path, asm_arg1, + asm_arg2 = "--multi-context=false" + if self.multi_context: + asm_arg2 = "--multi-context=true" + cmd_args = [self.ark_tool, icu_path, asm_arg1, asm_arg2, f'{file_name_pre}.abc'] record_name = os.path.splitext(os.path.split(self.js_file)[1])[0] diff --git a/test262/run_test262.py b/test262/run_test262.py index 3a5e196373..484f63aa8c 100755 --- a/test262/run_test262.py +++ b/test262/run_test262.py @@ -157,6 +157,8 @@ def parse_args(): help="stub file") parser.add_argument('--disable-force-gc', action='store_true', help="Run test262 with close force-gc") + parser.add_argument('--multi-context', action='store_true', + help="Run test262 with multi context") parser.add_argument('--enable-arkguard', action='store_true', help="enable arkguard for 262 tests") @@ -758,6 +760,10 @@ def get_disable_force_gc(host_args, args): return host_args +def get_multi_context(args, host_args): + host_args += f"--multi-context " + + return host_args def get_host_args_of_stub_file(args, host_args): host_args += f"--stub-file={args.stub_file} " @@ -830,6 +836,9 @@ def get_host_args(args, host_type): if args.disable_force_gc: host_args = get_disable_force_gc(host_args, args) + if args.multi_context: + host_args = get_multi_context(args, host_args) + return host_args -- Gitee