Lines Matching full:args
45 def init_log_file(args): argument
46 …logging.basicConfig(filename=args.out_log, format=RegressTestConfig.DEFAULT_LOG_FORMAT, level=logg…
90 def check_ark_frontend_binary(args) -> bool: argument
91 if args.ark_frontend_binary is None:
97 def check_frontend_library(args) -> bool: argument
99 current_frontend_binary = os.path.join(current_dir, str(args.ark_frontend_binary))
100 …test_tool_frontend_binary = os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ark_frontend_b…
104 args.ark_frontend_binary = current_frontend_binary if os.path.exists(
106 args.ark_frontend_binary = os.path.abspath(args.ark_frontend_binary)
110 def check_ark_tool(args) -> bool: argument
112 if args.ark_tool is None:
116 current_ark_tool = os.path.join(current_dir, str(args.ark_tool))
117 test_tool_ark_tool = os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ark_tool)
122 args.ark_tool = current_ark_tool if os.path.exists(current_ark_tool) else test_tool_ark_tool
123 args.ark_tool = os.path.abspath(args.ark_tool)
127 def check_ark_aot(args) -> bool: argument
128 if args.ark_aot:
130 current_ark_aot_tool = os.path.join(current_dir, str(args.ark_aot_tool))
131 … test_tool_ark_aot_tool = os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ark_aot_tool)
133 print(f'entered ark_aot_tool "{args.ark_aot_tool}" does not exist. Please check')
135 …args.ark_aot_tool = current_ark_aot_tool if os.path.exists(current_ark_aot_tool) else test_tool_ar…
136 args.ark_aot_tool = os.path.abspath(args.ark_aot_tool)
138 if args.run_pgo and not args.ark_aot:
144 def check_stub_path(args) -> bool: argument
145 if args.stub_path:
147 stub_path = os.path.join(current_dir, str(args.stub_path))
149 print(f'entered stub-file "{args.stub_path}" does not exist. Please check')
151 args.stub_path = os.path.abspath(args.stub_path)
162 def check_ignore_list(args) -> bool: argument
163 if args.ignore_list:
164 if os.path.isabs(args.ignore_list):
165 return is_ignore_file_present(args.ignore_list)
166 args.ignore_list = str(os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ignore_list))
167 return is_ignore_file_present(args.ignore_list)
171 def check_args(args): argument
172 result = check_ark_frontend_binary(args)
173 result = result and check_frontend_library(args)
174 result = result and check_ark_tool(args)
175 result = result and check_ark_aot(args)
176 result = result and check_stub_path(args)
177 result = result and check_ignore_list(args)
182 if args.ld_library_path is not None:
183 libs = args.ld_library_path.split(":")
186 args.ld_library_path = ":".join(libs)
188 args.ld_library_path = RegressTestConfig.DEFAULT_LIBS_DIR
189 if args.icu_path is None:
190 args.icu_path = RegressTestConfig.ICU_PATH
191 if args.out_dir is None:
192 args.out_dir = RegressTestConfig.PROJECT_BASE_OUT_DIR
194 args.out_dir = os.path.abspath(os.path.join(RegressTestConfig.CURRENT_PATH, args.out_dir))
195 if not args.out_dir.endswith("/"):
196 args.out_dir = f"{args.out_dir}/"
197 args.regress_out_dir = os.path.join(args.out_dir, "regresstest")
198 args.out_result = os.path.join(args.regress_out_dir, 'result.txt')
199 args.junit_report = os.path.join(args.regress_out_dir, 'report.xml')
200 args.out_log = os.path.join(args.regress_out_dir, 'test.log')
201 args.test_case_out_dir = os.path.join(args.regress_out_dir, RegressTestConfig.REGRESS_GIT_REPO)
275 def __init__(self, args, name): argument
277 self.args = args
284 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]: argument
302 def __init__(self, args): argument
303 RegressTestStep.__init__(self, args, "Repo preparation")
304 self.test_list: List[str] = self.read_test_list(args.test_list)
318 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]: argument
319 repo = RegressTestRepoPrepare(args)
393 if self.args.force_clone:
394 remove_dir(self.args.regress_out_dir)
396 os.makedirs(self.args.regress_out_dir, exist_ok=True)
398 init_log_file(self.args)
402 if self.args.test_file is not None and len(self.args.test_file) > 0:
403 … test_file_list = os.path.join(RegressTestConfig.REGRESS_TEST_CASE_DIR, self.args.test_file)
406 elif self.args.test_dir is not None and len(self.args.test_dir) > 0:
407 … test_file_list = os.path.join(RegressTestConfig.REGRESS_TEST_CASE_DIR, self.args.test_dir)
420 def __init__(self, args, test_reports: List[TestReport]): argument
421 RegressTestStep.__init__(self, args, "Regress test compilation")
422 self.out_dir = args.out_dir
428 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]: argument
432 test_prepare = RegressTestCompile(args, test_reports)
461 with multiprocessing.Pool(processes=self.args.processes) as pool:
479 self.args.ark_frontend_binary,
486 Utils.exec_command(command, test_report.test_id, step_result, self.args.timeout)
497 def __init__(self, args): argument
498 RegressTestStep.__init__(self, args, "Regress Test PGO ")
501 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]: argument
502 pgo = RegressTestPgo(args)
515 os.environ["LD_LIBRARY_PATH"] = self.args.ld_library_path
517 self.args.ark_tool,
519 f"--icu-data-path={self.args.icu_path}",
534 Utils.exec_command(command, test_report.test_id, step, self.args.timeout)
541 with multiprocessing.Pool(processes=self.args.processes) as pool:
631 def __init__(self, args): argument
632 RegressTestStep.__init__(self, args, "Regress Test AOT mode")
635 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]: argument
636 aot = RegressTestAot(args)
649 os.environ["LD_LIBRARY_PATH"] = self.args.ld_library_path
663 self.args.ark_aot_tool,
670 if self.args.run_pgo:
672 if self.args.enable_litecg:
682 Utils.exec_command(command, test_report.test_id, step, self.args.timeout)
689 with multiprocessing.Pool(processes=self.args.processes) as pool:
725 def __init__(self, args): argument
726 RegressTestStep.__init__(self, args, "Regress Test Run ")
730 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]: argument
731 runner = RegressTestRun(args)
739 with multiprocessing.Pool(processes=self.args.processes, initializer=init_worker,
740 initargs=(self.args,)) as pool:
749 self.args = worker_wrapper_args
750 if self.args is None or test_report is None or not test_report.passed:
762 os.environ["LD_LIBRARY_PATH"] = self.args.ld_library_path
768 command.append(self.args.ark_tool)
769 command.append(f"--icu-data-path={self.args.icu_path}")
771 if self.args.ark_aot:
772 command.append(f"--stub-file={self.args.stub_path}")
789 Utils.exec_command(command, test_report.test_id, step, self.args.timeout)
812 Utils.exec_command(command, test_report.test_id, step, self.args.timeout)
831 def __init__(self, args, test_reports: List[TestReport]): argument
832 self.args = args
839 if self.args.ignore_list is None:
841 … with os.fdopen(os.open(self.args.ignore_list, os.O_RDWR, stat.S_IRUSR), "r+") as file_object:
861 result_file = open_write_file(self.args.out_result, False)
883 tree.write(self.args.junit_report, xml_declaration=True, encoding="UTF-8")
886 def print_result(self, args, steps): argument
887 result_file = open_write_file(args.out_result, True)
945 args = os.O_RDWR | os.O_CREAT | os.O_APPEND
947 args = os.O_RDWR | os.O_CREAT
948 file_descriptor = os.open(file_path, args, stat.S_IRUSR | stat.S_IWUSR)
988 def init_worker(args): argument
990 worker_wrapper_args = args
997 def main(args): argument
998 if not check_args(args):
1005 if args.ark_aot:
1006 if args.run_pgo:
1013 test_reports = step.run(args, test_reports)
1015 stats = Stats(args, test_reports)
1017 stats.print_result(args, steps)