Skip to content

Commit cccf90e

Browse files
committed
remove code comments and debug code
Signed-off-by: Ni, Wenhui <[email protected]>
1 parent 7211a3e commit cccf90e

File tree

3 files changed

+0
-60
lines changed

3 files changed

+0
-60
lines changed

run_test.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,6 @@ def run_migrated_binary_test(test_driver_module, specific_module, single_case_te
204204

205205
# Execute the test driver to do the validation.
206206
def run_test_driver(module, single_case_text):
207-
# with open(test_config.command_file, "a+") as f:
208-
# f.write("================= " + single_case_text.name + " ==================\n")
209207
single_case_text.command_text += "================= " + single_case_text.name + " ==================\n"
210208

211209
case_workspace = single_case_text.case_workspace
@@ -300,13 +298,11 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa
300298
module = import_test_driver(suite_root_path)
301299
if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list):
302300
single_case_text.result_text += current_test + " Skip " + "\n"
303-
# append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n")
304301
single_case_text.run_flag = True
305302
return single_case_text
306303

307304
if single_case_config.option_rule_list and not is_option_supported(single_case_config.option_rule_list):
308305
single_case_text.result_text += current_test + " Skip " + "\n"
309-
# append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n")
310306
single_case_text.run_flag = True
311307
return single_case_text
312308

@@ -346,22 +342,15 @@ def get_gpu_split_test_suite(suite_cfg):
346342
return new_test_config_map
347343

348344
def record_msg_case(single_case_text):
349-
# print(single_case_text.result_file)
350-
# print(single_case_text.result_text)
351345
append_msg_to_file(single_case_text.result_file, single_case_text.result_text)
352346
if single_case_text.test_status == "BADTEST" or single_case_text.test_status == "SKIPPED":
353347
return
354-
# print(single_case_text.command_file)
355-
# print(single_case_text.command_text)
356348
append_msg_to_file(single_case_text.command_file, single_case_text.command_text)
357-
# print(single_case_text.log_file)
358-
# print(single_case_text.log_text)
359349
append_msg_to_file(single_case_text.log_file, single_case_text.log_text)
360350
return
361351

362352
def test_suite(suite_root_path, suite_name, opt):
363353
test_ws_root = os.path.join(os.path.dirname(suite_root_path), "test_workspace")
364-
# module means the test driver for a test suite.
365354
test_config.suite_cfg = parse_suite_cfg(suite_name, suite_root_path)
366355
test_workspace = prepare_test_workspace(test_ws_root, suite_name, opt)
367356
suite_result = True
@@ -373,14 +362,6 @@ def test_suite(suite_root_path, suite_name, opt):
373362
results = []
374363

375364
for current_test, single_case_config in test_config.suite_cfg.test_config_map.items():
376-
# print(os.path.join(test_workspace, "command.tst"))
377-
# print(os.path.join(test_workspace, "result.md"))
378-
# single_case_text = case_text(current_test, os.path.join(test_workspace, "command.tst"),"",
379-
# os.path.join(test_workspace, current_test, current_test + ".lf"), "",
380-
# os.path.join(test_workspace, "result.md"), "", "")
381-
# print(single_case_text.command_file)
382-
# print(single_case_text.result_file)
383-
# sys.exit(0)
384365
result = pool.apply_async(test_single_case, (current_test, single_case_config, test_workspace,
385366
suite_root_path,))
386367
# store all msg
@@ -412,18 +393,7 @@ def test_single_case_in_suite(suite_root_path, suite_name, case, option):
412393
if case not in suite_cfg.test_config_map.keys():
413394
exit("The test case " + case + " is not in the " + suite_name + " test suite! Please double check.")
414395
single_case_config = suite_cfg.test_config_map[case]
415-
# create single_case_text to store result msg
416396
single_case_text = test_single_case(case, single_case_config, test_workspace, suite_root_path)
417-
# print(single_case_text.name)
418-
# print(single_case_text.command_file)
419-
# print(single_case_text.print_text)
420-
# print(single_case_text.log_file)
421-
# print(single_case_text.log_text)
422-
# print(single_case_text.result_file)
423-
# print(single_case_text.result_text)
424-
# print(single_case_text.print_text)
425-
# print(single_case_text.test_status)
426-
# print(single_case_text.out_root)
427397
record_msg_case(single_case_text)
428398
return single_case_text.run_flag
429399

@@ -459,16 +429,6 @@ def import_test_driver(suite_folder):
459429
test_config.test_driver = str(test_driver.get("driverID"))
460430
return importlib.import_module(test_config.test_driver)
461431

462-
# def clean_global_setting():
463-
# single_case_text.name = ""
464-
# test_config.command_file = "" # Used to store the executed command.
465-
# test_config.log_file = "" # Used to store the executed log for each case.
466-
# test_config.result_text = "" # Used to store the executed status for each case.
467-
# single_case_text.out_root = ""
468-
# test_config.subprocess_stdout_log = ""
469-
# test_config.test_status = "" # Default: "SKIPPED"
470-
# test_config.test_driver = ""
471-
472432
# Parse the test suite configuration file and get the supported suite list.
473433
def get_suite_list():
474434
xml_file = test_config.suite_list_file
@@ -506,7 +466,6 @@ def test_suite_with_opts(suite_root_path, suite_name, opts):
506466
def test_full_suite_list(suite_list):
507467
ret = True
508468
for suite_name in suite_list:
509-
# clean_global_setting()
510469
os.chdir(test_config.root_path)
511470
suite_root_path = suite_list[suite_name][0]
512471
if os.path.exists(suite_root_path):

test_config.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,11 @@
1313
CT_TOOL = "dpct" # The migration tool binary name
1414
PYTHON_COM = "python3 "
1515
suite_list_file = "test_suite_list.xml" # The configuration file lists all the suite to run and corresponding options.
16-
1716
VERBOSE_LEVEL = 0 # Debug verbose level: 0: silent all the debug information. None 0: turn on all the debug information.
18-
19-
# current_test = "" # The name of current test. The test driver will automatically set a name for current test, if the current test is empty.
20-
# command_file = "" # Used to store the execution command.
21-
# log_file = "" # Default: <workspace>/[test name].lf
22-
# result_text = "" # Default: <workspace>/result.md
2317
include_path = "" # Specify the CUDA header file path.
24-
25-
# out_root = ""
26-
# command_output = ""
2718
cuda_ver = 0 # CUDA header file version.
28-
# test_status = "" # the test case execution status: MIGFAIL, COMPFAIL, RUNFAIL, SKIPPED or PASS.
2919
test_option = "" # Ref the option_mapping.json file table.
30-
# failed_message = ""
31-
# test_driver = ""
32-
# suite_cfg = "" # Parsed from <suite>.xml.
3320
migrate_option = ""
34-
# workspace = ""
3521
option_map = "" # Option mapping table. Ref: option_mapping.json
3622
root_path = "" # The root path of test repo.
3723
timeout = 1200 # The time limit for each test case.

test_utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
# Call subprocess to run migration, build and test binary. Store the command and execution result to
2727
# command.tst and result.md.
2828
def call_subprocess(cmd, single_case_text):
29-
# with open(test_config.command_file, 'a+') as f:
30-
# f.write(cmd + "\n")
3129
single_case_text.command_text += cmd + "\n"
3230
with open(single_case_text.log_file, 'a+') as f:
3331
try:
@@ -48,9 +46,6 @@ def call_subprocess(cmd, single_case_text):
4846

4947
def change_dir(dir, single_case_text):
5048
cmd = "cd " + dir
51-
52-
# with open(test_config.command_file, 'a+') as f:
53-
# f.write(cmd + "\n")
5449
single_case_text.command_text += cmd + "\n"
5550
if os.path.exists(dir):
5651
os.chdir(dir)

0 commit comments

Comments
 (0)