Lines Matching refs:args

45 def init_log_file(args):
46 logging.basicConfig(filename=args.out_log, format=RegressTestConfig.DEFAULT_LOG_FORMAT, level=logging.INFO)
100 def check_ark_frontend_binary(args) -> bool:
101 if args.ark_frontend_binary is None:
107 def check_frontend_library(args) -> bool:
109 current_frontend_binary = os.path.join(current_dir, str(args.ark_frontend_binary))
110 test_tool_frontend_binary = os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ark_frontend_binary)
114 args.ark_frontend_binary = current_frontend_binary if os.path.exists(
116 args.ark_frontend_binary = os.path.abspath(args.ark_frontend_binary)
120 def check_ark_tool(args) -> bool:
122 if args.ark_tool is None:
126 current_ark_tool = os.path.join(current_dir, str(args.ark_tool))
127 test_tool_ark_tool = os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ark_tool)
132 args.ark_tool = current_ark_tool if os.path.exists(current_ark_tool) else test_tool_ark_tool
133 args.ark_tool = os.path.abspath(args.ark_tool)
137 def check_ark_aot(args) -> bool:
138 if args.ark_aot:
140 current_ark_aot_tool = os.path.join(current_dir, str(args.ark_aot_tool))
141 test_tool_ark_aot_tool = os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ark_aot_tool)
143 output(f'entered ark_aot_tool "{args.ark_aot_tool}" does not exist. Please check')
145 args.ark_aot_tool = current_ark_aot_tool if os.path.exists(current_ark_aot_tool) else test_tool_ark_aot_tool
146 args.ark_aot_tool = os.path.abspath(args.ark_aot_tool)
148 if args.run_pgo and not args.ark_aot:
154 def check_stub_path(args) -> bool:
155 if args.stub_path:
157 stub_path = os.path.join(current_dir, str(args.stub_path))
159 output(f'entered stub-file "{args.stub_path}" does not exist. Please check')
161 args.stub_path = os.path.abspath(args.stub_path)
172 def check_ignore_list(args) -> bool:
173 if args.ignore_list:
174 if os.path.isabs(args.ignore_list):
175 return is_ignore_file_present(args.ignore_list)
176 args.ignore_list = str(os.path.join(RegressTestConfig.TEST_TOOL_FILE_DIR, args.ignore_list))
177 return is_ignore_file_present(args.ignore_list)
181 def check_args(args):
182 result = check_ark_frontend_binary(args)
183 result = result and check_frontend_library(args)
184 result = result and check_ark_tool(args)
185 result = result and check_ark_aot(args)
186 result = result and check_stub_path(args)
187 result = result and check_ignore_list(args)
192 if args.ld_library_path is not None:
193 libs = args.ld_library_path.split(":")
196 args.ld_library_path = ":".join(libs)
198 args.ld_library_path = RegressTestConfig.DEFAULT_LIBS_DIR
199 if args.icu_path is None:
200 args.icu_path = RegressTestConfig.ICU_PATH
201 if args.out_dir is None:
202 args.out_dir = RegressTestConfig.PROJECT_BASE_OUT_DIR
204 args.out_dir = os.path.abspath(os.path.join(RegressTestConfig.CURRENT_PATH, args.out_dir))
205 if not args.out_dir.endswith("/"):
206 args.out_dir = f"{args.out_dir}/"
207 args.regress_out_dir = os.path.join(args.out_dir, "regresstest")
208 args.out_result = os.path.join(args.regress_out_dir, 'result.txt')
209 args.junit_report = os.path.join(args.regress_out_dir, 'report.xml')
210 args.out_log = os.path.join(args.regress_out_dir, 'test.log')
211 args.test_case_out_dir = os.path.join(args.regress_out_dir, RegressTestConfig.REGRESS_GIT_REPO)
288 def __init__(self, args, name):
290 self.args = args
297 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]:
315 def __init__(self, args):
316 RegressTestStep.__init__(self, args, "Repo preparation")
317 self.test_list: List[str] = self.read_test_list(args.test_list)
331 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]:
332 repo = RegressTestRepoPrepare(args)
406 if self.args.force_clone:
407 remove_dir(self.args.regress_out_dir)
409 os.makedirs(self.args.regress_out_dir, exist_ok=True)
411 init_log_file(self.args)
415 if self.args.test_file is not None and len(self.args.test_file) > 0:
416 test_file_list = os.path.join(RegressTestConfig.REGRESS_TEST_CASE_DIR, self.args.test_file)
419 elif self.args.test_dir is not None and len(self.args.test_dir) > 0:
420 test_file_list = os.path.join(RegressTestConfig.REGRESS_TEST_CASE_DIR, self.args.test_dir)
433 def __init__(self, args, test_reports: List[TestReport]):
434 RegressTestStep.__init__(self, args, "Regress test compilation")
435 self.out_dir = args.out_dir
441 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]:
445 test_prepare = RegressTestCompile(args, test_reports)
474 with multiprocessing.Pool(processes=self.args.processes) as pool:
492 self.args.ark_frontend_binary,
499 Utils.exec_command(command, test_report.test_id, step_result, self.args.timeout,
510 def __init__(self, args):
511 RegressTestStep.__init__(self, args, "Regress Test PGO ")
514 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]:
515 pgo = RegressTestPgo(args)
528 os.environ["LD_LIBRARY_PATH"] = self.args.ld_library_path
530 if self.args.ark_arch == RegressTestConfig.ARK_ARCH_LIST[1]:
535 self.args.ark_arch_root
537 gen_ap_cmd.append(self.args.ark_tool)
539 gen_ap_cmd.append(f"--icu-data-path={self.args.icu_path}")
554 Utils.exec_command(command, test_report.test_id, step, self.args.timeout,
561 with multiprocessing.Pool(processes=self.args.processes) as pool:
661 def __init__(self, args):
662 RegressTestStep.__init__(self, args, "Regress Test AOT mode")
665 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]:
666 aot = RegressTestAot(args)
679 os.environ["LD_LIBRARY_PATH"] = self.args.ld_library_path
680 if self.args.ark_arch == RegressTestConfig.ARK_ARCH_LIST[1]:
684 self.args.ark_arch_root,
685 self.args.ark_aot_tool,
691 self.args.ark_aot_tool,
711 if self.args.run_pgo:
713 if self.args.enable_litecg:
723 Utils.exec_command(command, test_report.test_id, step, self.args.timeout,
730 with multiprocessing.Pool(processes=self.args.processes) as pool:
771 def __init__(self, args):
772 RegressTestStep.__init__(self, args, "Regress Test Run ")
776 def run(args, test_reports: Optional[List[TestReport]] = None) -> List[TestReport]:
777 runner = RegressTestRun(args)
803 with multiprocessing.Pool(processes=self.args.processes, initializer=init_worker,
804 initargs=(self.args,)) as pool:
813 self.args = worker_wrapper_args
814 if self.args is None or test_report is None or not test_report.passed:
826 os.environ["LD_LIBRARY_PATH"] = self.args.ld_library_path
832 if self.args.ark_arch == RegressTestConfig.ARK_ARCH_LIST[1]:
835 qemu_arg2 = self.args.ark_arch_root
837 command.append(self.args.ark_tool)
838 command.append(f"--icu-data-path={self.args.icu_path}")
840 if self.args.ark_aot:
841 command.append(f"--stub-file={self.args.stub_path}")
843 if self.args.disable_force_gc:
864 Utils.exec_command(command, test_report.test_id, step, self.args.timeout,
868 Utils.exec_command(command, test_report.test_id, step, self.args.timeout,
873 def __init__(self, args, test_reports: List[TestReport]):
874 self.args = args
881 if self.args.ignore_list is None:
883 with os.fdopen(os.open(self.args.ignore_list, os.O_RDWR, stat.S_IRUSR), "r+") as file_object:
903 result_file = open_write_file(self.args.out_result, False)
925 tree.write(self.args.junit_report, xml_declaration=True, encoding="UTF-8")
928 def print_result(self, args, steps):
929 result_file = open_write_file(args.out_result, True)
987 args = os.O_RDWR | os.O_CREAT | os.O_APPEND
989 args = os.O_RDWR | os.O_CREAT
990 file_descriptor = os.open(file_path, args, stat.S_IRUSR | stat.S_IWUSR)
1030 def init_worker(args):
1032 worker_wrapper_args = args
1039 def main(args):
1040 if not check_args(args):
1047 if args.ark_aot:
1048 if args.run_pgo:
1055 test_reports = step.run(args, test_reports)
1057 stats = Stats(args, test_reports)
1059 stats.print_result(args, steps)