From ef265a133e30be4ba9ce7f86f9ee0ac8e34c23a7 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Sun, 2 Jul 2023 23:51:45 +0800 Subject: [PATCH 01/10] Use multiprocess to parallel run test case Signed-off-by: Ni, Wenhui --- README.md | 8 +- api_coverage/test_api_coverage.py | 22 +-- behavior_tests/src/array_size_fold/do_test.py | 10 +- behavior_tests/src/bad_input_1/do_test.py | 12 +- .../src/bt-analysis-scope-path1/do_test.py | 10 +- .../src/bt-analysis-scope-path2/do_test.py | 14 +- .../src/bt-analysis-scope-path3/do_test.py | 10 +- .../src/bt-analysis-scope-path4/do_test.py | 10 +- behavior_tests/src/bt-autocomplete/do_test.py | 54 +++--- .../src/bt-cdb-default-out-folder/do_test.py | 10 +- behavior_tests/src/bt-check-c2s/do_test.py | 10 +- .../bt-check-conflict-insertion/do_test.py | 10 +- .../src/bt-check-install-files/do_test.py | 10 +- .../bt-check-unexpected-message/do_test.py | 12 +- .../src/bt-check-warning1083/do_test.py | 14 +- behavior_tests/src/bt-comments/do_test.py | 10 +- .../src/bt-ct-default-out-folder/do_test.py | 12 +- .../do_test.py | 12 +- .../bt-extra-arg-comma-separate/do_test.py | 10 +- behavior_tests/src/bt-extra-arg/do_test.py | 16 +- behavior_tests/src/bt-format-range/do_test.py | 10 +- behavior_tests/src/bt-format-style/do_test.py | 10 +- .../src/bt-gen-helper-function/do_test.py | 10 +- behavior_tests/src/bt-help/do_test.py | 12 +- .../bt-in-root-empty-process-all/do_test.py | 12 +- .../src/bt-invalid-cuda-version/do_test.py | 12 +- .../bt-kernel-function-limitation/do_test.py | 14 +- .../src/bt-language-warning/do_test.py | 12 +- .../src/bt-modified-yaml/do_test.py | 10 +- .../src/bt-multi-cuda-inc-path/do_test.py | 12 +- behavior_tests/src/bt-output/do_test.py | 10 +- behavior_tests/src/bt-report-only/do_test.py | 10 +- .../src/bt-stop-on-parse-err/do_test.py | 10 +- .../src/bt-suppress-warnings-all/do_test.py | 12 +- .../src/bt-suppress-warnings/do_test.py | 12 +- behavior_tests/src/bt-tilde-path/do_test.py | 10 +- .../bt-unsupported-type-function/do_test.py | 10 +- .../src/bt-use-explicit-namespace1/do_test.py | 14 +- .../src/bt-use-explicit-namespace2/do_test.py | 14 +- .../src/bt-use-explicit-namespace3/do_test.py | 14 +- .../src/bt-use-explicit-namespace4/do_test.py | 10 +- .../src/bt-use-explicit-namespace5/do_test.py | 14 +- .../src/bt-use-explicit-namespace6/do_test.py | 14 +- behavior_tests/src/bt-version/do_test.py | 14 +- .../do_test.py | 12 +- .../do_test.py | 16 +- .../do_test.py | 12 +- .../do_test.py | 10 +- .../src/bt-yaml-without-ct-version/do_test.py | 14 +- .../src/cannot-acc-dir-in-db/do_test.py | 14 +- .../src/change-filename-extension/do_test.py | 20 +- .../check-device-unsupport-aspect/do_test.py | 18 +- .../src/check-windows-version/do_test.py | 12 +- .../src/cl_compile_test_1/do_test.py | 14 +- .../src/cmp_intercept_build/do_test.py | 10 +- .../src/cmps_cl_compile_test_1/do_test.py | 10 +- .../src/cmps_cl_compile_test_2/do_test.py | 10 +- .../src/cmps_cuda_compile_test_1/do_test.py | 10 +- .../src/cmps_cuda_compile_test_2/do_test.py | 10 +- behavior_tests/src/copy_all_files/do_test.py | 12 +- .../src/execute_from_bundle_root/do_test.py | 12 +- .../src/execute_from_cuda_path/do_test.py | 14 +- .../src/integer-overflow/do_test.py | 16 +- behavior_tests/src/ngt-UDR-idx1/do_test.py | 12 +- behavior_tests/src/ngt-UDR-idx2/do_test.py | 12 +- behavior_tests/src/ngt-UDR-idx3/do_test.py | 12 +- behavior_tests/src/ngt-UDR-keyword/do_test.py | 12 +- behavior_tests/src/ngt-UDR-path/do_test.py | 12 +- .../src/ngt-analysis-scope-path1/do_test.py | 12 +- .../src/ngt-assume-nd-range-dim/do_test.py | 12 +- .../ngt-cannot-access-dir-in-db/do_test.py | 14 +- .../src/ngt-cannot-find-db/do_test.py | 14 +- .../src/ngt-check-cannot-parse/do_test.py | 12 +- .../src/ngt-database-notfound/do_test.py | 12 +- .../src/ngt-file-parsing-err/do_test.py | 18 +- .../src/ngt-format-range/do_test.py | 12 +- .../src/ngt-format-style/do_test.py | 12 +- behavior_tests/src/ngt-in-root-len/do_test.py | 12 +- .../src/ngt-in-root-path/do_test.py | 12 +- .../src/ngt-include-path-len/do_test.py | 12 +- .../ngt-inroot-contain-cuda-path/do_test.py | 12 +- .../ngt-invalid-cuda-include-path/do_test.py | 12 +- .../do_test.py | 12 +- .../do_test.py | 12 +- .../do_test.py | 12 +- .../do_test.py | 12 +- .../src/ngt-invalid-inroot/do_test.py | 12 +- .../src/ngt-invalid-inroot2/do_test.py | 12 +- .../src/ngt-invalid-inroot3/do_test.py | 12 +- .../src/ngt-invalid-json1/do_test.py | 12 +- .../src/ngt-invalid-json10/do_test.py | 12 +- .../src/ngt-invalid-json2/do_test.py | 12 +- .../src/ngt-invalid-json3/do_test.py | 12 +- .../src/ngt-invalid-json4/do_test.py | 12 +- .../src/ngt-invalid-json5/do_test.py | 12 +- .../src/ngt-invalid-json6/do_test.py | 12 +- .../src/ngt-invalid-json7/do_test.py | 12 +- .../src/ngt-invalid-json8/do_test.py | 12 +- .../src/ngt-invalid-json9/do_test.py | 12 +- .../ngt-invalid-yaml-for-format1/do_test.py | 12 +- .../ngt-invalid-yaml-for-format2/do_test.py | 12 +- .../ngt-invalid-yaml-for-format3/do_test.py | 12 +- .../ngt-invalid-yaml-for-format4/do_test.py | 12 +- .../ngt-invalid-yaml-for-header1/do_test.py | 12 +- .../ngt-invalid-yaml-for-header2/do_test.py | 12 +- .../ngt-invalid-yaml-for-header3/do_test.py | 14 +- .../ngt-invalid-yaml-for-header4/do_test.py | 12 +- .../src/ngt-level-verbosity/do_test.py | 12 +- .../src/ngt-no-db-specified/do_test.py | 12 +- .../src/ngt-no-explicit-inroot/do_test.py | 12 +- .../src/ngt-no-file-type/do_test.py | 12 +- .../src/ngt-no-source-name/do_test.py | 12 +- .../src/ngt-opt-parsing-err/do_test.py | 12 +- .../src/ngt-out-root-len/do_test.py | 12 +- .../src/ngt-output-access/do_test.py | 12 +- .../src/ngt-output-create/do_test.py | 12 +- .../src/ngt-output-file-len/do_test.py | 12 +- .../src/ngt-output-not-empty/do_test.py | 12 +- .../src/ngt-output-verbosity/do_test.py | 12 +- .../src/ngt-report-file-len/do_test.py | 12 +- .../src/ngt-report-file-prefix/do_test.py | 12 +- .../src/ngt-report-file-prefix2/do_test.py | 12 +- .../src/ngt-report-format1/do_test.py | 12 +- .../src/ngt-report-format2/do_test.py | 12 +- .../src/ngt-report-type-diags/do_test.py | 12 +- behavior_tests/src/ngt-report-type/do_test.py | 12 +- .../src/ngt-rpt-prefix-too-long/do_test.py | 12 +- .../src/ngt-save-out-fail-lin/do_test.py | 12 +- behavior_tests/src/ngt-show-help/do_test.py | 12 +- .../src/ngt-skip-for-missing-cmd/do_test.py | 12 +- .../src/ngt-stop-on-parse-err/do_test.py | 12 +- .../src/ngt-suppress-warnings1/do_test.py | 12 +- .../src/ngt-suppress-warnings10/do_test.py | 12 +- .../src/ngt-suppress-warnings11/do_test.py | 12 +- .../src/ngt-suppress-warnings2/do_test.py | 12 +- .../src/ngt-suppress-warnings3/do_test.py | 12 +- .../src/ngt-suppress-warnings4/do_test.py | 12 +- .../src/ngt-suppress-warnings5/do_test.py | 12 +- .../src/ngt-suppress-warnings6/do_test.py | 12 +- .../src/ngt-suppress-warnings7/do_test.py | 12 +- .../src/ngt-suppress-warnings8/do_test.py | 12 +- .../src/ngt-suppress-warnings9/do_test.py | 12 +- .../src/ngt-use-dpcpp-extensions/do_test.py | 12 +- behavior_tests/src/ngt-usm-leve/do_test.py | 12 +- behavior_tests/src/ngt-usm-level/do_test.py | 12 +- .../src/ngt-vcxproj-does-not-exist/do_test.py | 12 +- .../src/ngt-vcxproj-to-db-fail/do_test.py | 12 +- .../do_test.py | 12 +- .../src/ngti-cdb-path-len/do_test.py | 12 +- behavior_tests/src/ngti-empty-make/do_test.py | 12 +- .../src/ngtn-database-fail/do_test.py | 12 +- behavior_tests/src/nominmax_bd/do_test.py | 14 +- .../src/open-source-mkl-compile/do_test.py | 12 +- .../src/path_validation_0/do_test.py | 16 +- .../src/path_validation_1/do_test.py | 16 +- .../src/relative_path_test/do_test.py | 14 +- behavior_tests/src/sh-ct-1306/do_test.py | 10 +- .../src/test_soft_link_folder/do_test.py | 12 +- behavior_tests/test_behavior.py | 22 +-- features/feature_case/backprop/do_test.py | 12 +- .../cudnn_multiple_files/do_test.py | 14 +- .../feature_case/kernel_library/do_test.py | 14 +- features/feature_case/module/do_test.py | 14 +- features/test_feature.py | 76 ++++---- help_function/test_help.py | 52 +++--- regressions/test_regression.py | 36 ++-- run_test.py | 175 ++++++++++++------ samples/test_samples.py | 24 +-- test_config.py | 25 +-- test_utils.py | 66 +++---- user_guide_samples/test_guide.py | 14 +- 171 files changed, 1288 insertions(+), 1222 deletions(-) diff --git a/README.md b/README.md index c36d0ea77..1722bf04a 100644 --- a/README.md +++ b/README.md @@ -113,10 +113,10 @@ For example, for test suite: internal_samples, there is a test driver configure The test driver implementation file test_samples.py needs to implement the following 4 interfaces: - 1. setup_test(): Setup the execution environment. eg. setup CPATH or LD_LIBRARY_PATH in Linux to contain library required for the test case. - 2. migrate_test(): Migration command for each test case. - 3. build_test(): Compile and link command for each test case. - 4. run_test(): Run the test cases in the test suite. + 1. setup_test(single_case_text): Setup the execution environment. eg. setup CPATH or LD_LIBRARY_PATH in Linux to contain library required for the test case. + 2. migrate_test(single_case_text): Migration command for each test case. + 3. build_test(single_case_text): Compile and link command for each test case. + 4. run_test(single_case_text): Run the test cases in the test suite. # Add or modify test case diff --git a/api_coverage/test_api_coverage.py b/api_coverage/test_api_coverage.py index d5f0bfcb7..d513db3c0 100644 --- a/api_coverage/test_api_coverage.py +++ b/api_coverage/test_api_coverage.py @@ -15,37 +15,37 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): +def migrate_test(single_case_text): src = [] extra_args = [] - in_root = os.path.join(os.getcwd(), test_config.current_test) - test_config.out_root = os.path.join(in_root, 'out_root') + in_root = os.path.join(os.getcwd(), single_case_text.name) + single_case_text.out_root = os.path.join(in_root, 'out_root') for dirpath, dirnames, filenames in os.walk(in_root): for filename in [f for f in filenames if re.match('.*(cu|cpp|c)$', f)]: src.append(os.path.abspath(os.path.join(dirpath, filename))) - return do_migrate(src, in_root, test_config.out_root, extra_args) + return do_migrate(src, in_root, single_case_text.out_root, single_case_text, extra_args) -def build_test(): - if (os.path.exists(test_config.current_test)): - os.chdir(test_config.current_test) +def build_test(single_case_text): + if (os.path.exists(single_case_text.name)): + os.chdir(single_case_text.name) srcs = [] cmp_opts = '' link_opts = '' objects = '' - for dirpath, dirnames, filenames in os.walk(test_config.out_root): + for dirpath, dirnames, filenames in os.walk(single_case_text.out_root): for filename in [f for f in filenames if re.match('.*(cpp|c)$', f)]: srcs.append(os.path.abspath(os.path.join(dirpath, filename))) ret = False - ret = compile_files(srcs, cmp_opts) + ret = compile_files(srcs, single_case_text, cmp_opts) return ret -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/array_size_fold/do_test.py b/behavior_tests/src/array_size_fold/do_test.py index d6967e877..03fb9b8d2 100644 --- a/behavior_tests/src/array_size_fold/do_test.py +++ b/behavior_tests/src/array_size_fold/do_test.py @@ -14,12 +14,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess( test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) @@ -37,9 +37,9 @@ def migrate_test(): return res -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bad_input_1/do_test.py b/behavior_tests/src/bad_input_1/do_test.py index 18ce0f583..52e46d24a 100644 --- a/behavior_tests/src/bad_input_1/do_test.py +++ b/behavior_tests/src/bad_input_1/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + os.path.join("cuda", "migrate_nonbuilding_code.cu")) - return is_sub_string("unknown type name", test_config.command_output) -def build_test(): + return is_sub_string("unknown type name", single_case_text.command_text) +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-analysis-scope-path1/do_test.py b/behavior_tests/src/bt-analysis-scope-path1/do_test.py index 1d1e52290..285445309 100644 --- a/behavior_tests/src/bt-analysis-scope-path1/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path1/do_test.py @@ -15,12 +15,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") @@ -50,9 +50,9 @@ def migrate_test(): return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-analysis-scope-path2/do_test.py b/behavior_tests/src/bt-analysis-scope-path2/do_test.py index 6a43f99c4..a9c6a1a7e 100644 --- a/behavior_tests/src/bt-analysis-scope-path2/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path2/do_test.py @@ -15,18 +15,18 @@ from test_utils import * -def setup_test(): - cur_dir = os.path.join(os.getcwd(), test_config.current_test) +def setup_test(single_case_text): + cur_dir = os.path.join(os.getcwd(), single_case_text.name) if platform.system() == 'Windows': # windows current working directory might start with lowercased drive(e.g., "d:\path") in some cases # so make the drive symbol in cwd to be upper explicitly to avoid inconsistent paths. if cur_dir[1] == ":" and cur_dir[0].islower(): cur_dir = cur_dir[0].upper() + cur_dir[1:] - change_dir(cur_dir) + change_dir(cur_dir, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") @@ -50,12 +50,12 @@ def migrate_test(): os.path.join("cuda", "..")) return is_sub_string( f"use the same option set as in previous migration: \"--analysis-scope-path=", - test_config.command_output) + single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-analysis-scope-path3/do_test.py b/behavior_tests/src/bt-analysis-scope-path3/do_test.py index f11102f91..c9f680dde 100644 --- a/behavior_tests/src/bt-analysis-scope-path3/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path3/do_test.py @@ -16,12 +16,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") @@ -54,9 +54,9 @@ def migrate_test(): return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-analysis-scope-path4/do_test.py b/behavior_tests/src/bt-analysis-scope-path4/do_test.py index cd5c9bf97..d40c9420e 100644 --- a/behavior_tests/src/bt-analysis-scope-path4/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path4/do_test.py @@ -16,15 +16,15 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) if os.path.exists("cuda_symlink"): os.unlink("cuda_symlink") os.symlink("cuda", "cuda_symlink") return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") @@ -40,9 +40,9 @@ def migrate_test(): return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-autocomplete/do_test.py b/behavior_tests/src/bt-autocomplete/do_test.py index f8ead03fa..8f28827ff 100644 --- a/behavior_tests/src/bt-autocomplete/do_test.py +++ b/behavior_tests/src/bt-autocomplete/do_test.py @@ -12,73 +12,73 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): res = True call_subprocess(test_config.CT_TOOL + " --autocomplete=--gen-build") reference = '--gen-build-script\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-gen-build") reference = '-gen-build-script\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=foo") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=#d") reference = 'detailed\n' + \ 'diagnostics\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=#d") reference = 'detailed\n' + \ 'diagnostics\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=") reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=") reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar##--enable-c") reference = '--enable-ctad\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar###--format-range=#a") reference = 'all\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file=") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file") reference = '--rule-file\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-p=") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-p") reference = '-p\n' + \ '-process-all\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,") reference = 'cl,sycl,cl\n' + \ @@ -86,28 +86,28 @@ def migrate_test(): 'cl,sycl,none\n' + \ 'cl,sycl,sycl\n' + \ 'cl,sycl,sycl-math\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,s") reference = 'cl,sycl,sycl\n' + \ 'cl,sycl,sycl-math\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=,") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete==") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=,,") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-") opts = ['--always-use-async-handler\n', @@ -152,20 +152,20 @@ def migrate_test(): '--version\n', '-p\n'] for opt in opts: - res = res and (opt in test_config.command_output) + res = res and (opt in single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=##") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=#") reference = '\n' - res = res and (reference == test_config.command_output) + res = res and (reference == single_case_text.command_text) return res -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py index 559c54ebb..365577197 100644 --- a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py @@ -14,19 +14,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make") in_root = "" extra_args = "" return call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + "-p .") -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-check-c2s/do_test.py b/behavior_tests/src/bt-check-c2s/do_test.py index 05b4fed89..2d61d4575 100644 --- a/behavior_tests/src/bt-check-c2s/do_test.py +++ b/behavior_tests/src/bt-check-c2s/do_test.py @@ -14,11 +14,11 @@ from test_utils import * from hashlib import md5 -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): dpct_path = shutil.which("dpct") c2s_path = shutil.which("c2s") @@ -34,8 +34,8 @@ def migrate_test(): c2s_file.close() return c2s_md5 == dpct_md5 -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-check-conflict-insertion/do_test.py b/behavior_tests/src/bt-check-conflict-insertion/do_test.py index ee4be7d4a..35871857b 100644 --- a/behavior_tests/src/bt-check-conflict-insertion/do_test.py +++ b/behavior_tests/src/bt-check-conflict-insertion/do_test.py @@ -14,19 +14,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make") in_root = "" extra_args = "" call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + "-p .") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-check-install-files/do_test.py b/behavior_tests/src/bt-check-install-files/do_test.py index aab44191e..291ff7812 100644 --- a/behavior_tests/src/bt-check-install-files/do_test.py +++ b/behavior_tests/src/bt-check-install-files/do_test.py @@ -14,11 +14,11 @@ from test_utils import * from hashlib import md5 -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): install_root = os.path.join(os.path.dirname(shutil.which("dpct")), '..') res = True @@ -35,9 +35,9 @@ def migrate_test(): return res -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-check-unexpected-message/do_test.py b/behavior_tests/src/bt-check-unexpected-message/do_test.py index 4f43a3fcd..2263e6286 100644 --- a/behavior_tests/src/bt-check-unexpected-message/do_test.py +++ b/behavior_tests/src/bt-check-unexpected-message/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path + " --extra-arg=-xc++") - return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", test_config.command_output) + return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return call_subprocess("icpx -fsycl out/test.dp.cpp") -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-check-warning1083/do_test.py b/behavior_tests/src/bt-check-warning1083/do_test.py index 2b1f8f1cd..a5713a46e 100644 --- a/behavior_tests/src/bt-check-warning1083/do_test.py +++ b/behavior_tests/src/bt-check-warning1083/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret_file = "" call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) @@ -26,12 +26,12 @@ def migrate_test(): ret = f.read() if not is_sub_string("1083", ret): return False - change_dir("out") + change_dir("out", single_case_text) return True -def build_test(): +def build_test(single_case_text): src_files = ["test.dp.cpp"] - return compile_files(src_files) + return compile_files(src_files, single_case_text) -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-comments/do_test.py b/behavior_tests/src/bt-comments/do_test.py index 5b8168508..33950cff9 100644 --- a/behavior_tests/src/bt-comments/do_test.py +++ b/behavior_tests/src/bt-comments/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret_file = "" call_subprocess(test_config.CT_TOOL + " --comments comments.cu --out-root=out --cuda-include-path=" + test_config.include_path) with open(os.path.join("out", "comments.dp.cpp"), 'r') as f: ret_file = f.read() return is_sub_string("//", ret_file) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-ct-default-out-folder/do_test.py b/behavior_tests/src/bt-ct-default-out-folder/do_test.py index 187d0c256..03332a7e5 100644 --- a/behavior_tests/src/bt-ct-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-ct-default-out-folder/do_test.py @@ -13,26 +13,26 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): src = ["hello.cu", "hello2.cu"] in_root = "" extra_args = "" out_root_path = "out" - do_migrate(src, in_root, out_root_path, extra_args) + do_migrate(src, in_root, out_root_path, single_case_text, extra_args) if os.path.exists(os.path.join("out", "hello.dp.cpp")): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py index 3aa8b13e1..c479ce28f 100644 --- a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py @@ -14,14 +14,14 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " -p=./ --cuda-include-path=" + test_config.include_path) - return is_sub_string("Migration not necessary; no CUDA code detected", test_config.command_output) -def build_test(): + return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.command_text) +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py b/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py index 637502091..4524ca816 100644 --- a/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py +++ b/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py @@ -14,17 +14,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): return call_subprocess(test_config.CT_TOOL + " --extra-arg=-I\"" + os.path.dirname(__file__) + "/header1 "+",-I" + os.path.dirname(__file__) + "/header2\"" + " --cuda-include-path=" + test_config.include_path + " test.cu") -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-extra-arg/do_test.py b/behavior_tests/src/bt-extra-arg/do_test.py index 08a69828f..4995119c3 100644 --- a/behavior_tests/src/bt-extra-arg/do_test.py +++ b/behavior_tests/src/bt-extra-arg/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): return (call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=" + test_config.include_path + "\" vector_add.cu") - and is_sub_string("Parsing", test_config.command_output) - and is_sub_string("Analyzing", test_config.command_output) - and is_sub_string("Migrating", test_config.command_output)) + and is_sub_string("Parsing", single_case_text.command_text) + and is_sub_string("Analyzing", single_case_text.command_text) + and is_sub_string("Migrating", single_case_text.command_text)) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-format-range/do_test.py b/behavior_tests/src/bt-format-range/do_test.py index 7ee48926c..d35a49a31 100644 --- a/behavior_tests/src/bt-format-range/do_test.py +++ b/behavior_tests/src/bt-format-range/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): os.mkdir("out_migrated") os.mkdir("out_all") @@ -33,8 +33,8 @@ def migrate_test(): ret = is_sub_string("; // variable declearation", "./out_custom/vector_add.dp.cpp") or ret ret = is_sub_string("; // allocate device memory", "./out_custom/vector_add.dp.cpp") or ret return not ret -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-format-style/do_test.py b/behavior_tests/src/bt-format-style/do_test.py index 70ebd3852..ef5b85578 100644 --- a/behavior_tests/src/bt-format-style/do_test.py +++ b/behavior_tests/src/bt-format-style/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): os.mkdir("out_custom") os.mkdir("out_llvm") os.mkdir("out_google") @@ -38,8 +38,8 @@ def migrate_test(): ret = is_sub_string("; //", file_str) or ret return ret -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-gen-helper-function/do_test.py b/behavior_tests/src/bt-gen-helper-function/do_test.py index 71f3fdbb6..89829cb1a 100644 --- a/behavior_tests/src/bt-gen-helper-function/do_test.py +++ b/behavior_tests/src/bt-gen-helper-function/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret_file = "" ret = call_subprocess(test_config.CT_TOOL + " --gen-helper-function --out-root=out") installed_header_file_root = os.path.join(os.path.dirname(get_ct_path()), "..", "include", "dpct") @@ -35,8 +35,8 @@ def migrate_test(): return False return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-help/do_test.py b/behavior_tests/src/bt-help/do_test.py index b0a047c11..8b91f41b3 100644 --- a/behavior_tests/src/bt-help/do_test.py +++ b/behavior_tests/src/bt-help/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL +" --help") - return is_sub_string("USAGE", test_config.command_output) + return is_sub_string("USAGE", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py index c66dae6b8..d57d4cbcd 100644 --- a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py +++ b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --process-all --cuda-include-path=" + test_config.include_path + " --in-root=") - return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", test_config.command_output) + return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-invalid-cuda-version/do_test.py b/behavior_tests/src/bt-invalid-cuda-version/do_test.py index 1c3567109..af690c90a 100644 --- a/behavior_tests/src/bt-invalid-cuda-version/do_test.py +++ b/behavior_tests/src/bt-invalid-cuda-version/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): include_path = os.path.join(os.getcwd(), "include") in_root = os.getcwd() test_case_path = os.path.join(in_root, "vector_add.cu") call_subprocess(test_config.CT_TOOL + " " + test_case_path + " --out-root=out --in-root=" + in_root + " --cuda-include-path=" + include_path) - return is_sub_string("Error: The version of CUDA header files specified by --cuda-include-path is not supported. See Release Notes for supported versions.", test_config.command_output) + return is_sub_string("Error: The version of CUDA header files specified by --cuda-include-path is not supported. See Release Notes for supported versions.", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-kernel-function-limitation/do_test.py b/behavior_tests/src/bt-kernel-function-limitation/do_test.py index 451b49016..217d577d9 100644 --- a/behavior_tests/src/bt-kernel-function-limitation/do_test.py +++ b/behavior_tests/src/bt-kernel-function-limitation/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --optimize-migration --out-root=./out kernel-func.cu --cuda-include-path=" + test_config.include_path) - ret = is_sub_string("Recursive functions cannot be called in SYCL device code", test_config.command_output) - ret = is_sub_string("Virtual functions cannot be called in SYCL device code", test_config.command_output) and ret + ret = is_sub_string("Recursive functions cannot be called in SYCL device code", single_case_text.command_text) + ret = is_sub_string("Virtual functions cannot be called in SYCL device code", single_case_text.command_text) and ret return ret -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-language-warning/do_test.py b/behavior_tests/src/bt-language-warning/do_test.py index e673cecd9..aa08281ea 100644 --- a/behavior_tests/src/bt-language-warning/do_test.py +++ b/behavior_tests/src/bt-language-warning/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cpp --out-root=out --cuda-include-path=" + test_config.include_path) - return is_sub_string("NOTE: test.cpp is treated as a CUDA file by default. Use the --extra-arg=-xc++ option to treat test.cpp as a C++ file if needed.", test_config.command_output) + return is_sub_string("NOTE: test.cpp is treated as a CUDA file by default. Use the --extra-arg=-xc++ option to treat test.cpp as a C++ file if needed.", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-modified-yaml/do_test.py b/behavior_tests/src/bt-modified-yaml/do_test.py index 2a4aa51b3..2966d25da 100644 --- a/behavior_tests/src/bt-modified-yaml/do_test.py +++ b/behavior_tests/src/bt-modified-yaml/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): yml_file = os.path.join("out", "test.h.yaml") test_file = os.path.join("out", "test.h") ret_str = "" @@ -39,7 +39,7 @@ def migrate_test(): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py b/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py index 159b67b02..6fbba454f 100644 --- a/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py +++ b/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py @@ -12,18 +12,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) call_subprocess("cp -r --dereference " + test_config.include_path + " + .") - change_dir("src") + change_dir("src", single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): command = test_config.CT_TOOL + " --out-root out test.cu --cuda-include-path ../include --extra-arg=\"-I" + test_config.include_path + "\"" print(command) return call_subprocess(command) -def build_test(): +def build_test(single_case_text): return call_subprocess("icpx -fsycl out/test.dp.cpp") -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-output/do_test.py b/behavior_tests/src/bt-output/do_test.py index f6c2a316f..e2ed73b38 100644 --- a/behavior_tests/src/bt-output/do_test.py +++ b/behavior_tests/src/bt-output/do_test.py @@ -13,15 +13,15 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): return call_subprocess(test_config.CT_TOOL + " hello.cu hello2.cu --cuda-include-path=" + test_config.include_path + " > output.txt") -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-report-only/do_test.py b/behavior_tests/src/bt-report-only/do_test.py index 82c4ab2fd..76de33154 100644 --- a/behavior_tests/src/bt-report-only/do_test.py +++ b/behavior_tests/src/bt-report-only/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --report-only vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path) if os.path.exists("out"): return False return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-stop-on-parse-err/do_test.py b/behavior_tests/src/bt-stop-on-parse-err/do_test.py index 4e263b1fd..c94528fe1 100644 --- a/behavior_tests/src/bt-stop-on-parse-err/do_test.py +++ b/behavior_tests/src/bt-stop-on-parse-err/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --stop-on-parse-err vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path) if os.path.exists(os.path.join("out", "vector_add.dp.cpp")): return False return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-suppress-warnings-all/do_test.py b/behavior_tests/src/bt-suppress-warnings-all/do_test.py index c4274092c..d220d3c24 100644 --- a/behavior_tests/src/bt-suppress-warnings-all/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings-all/do_test.py @@ -13,15 +13,15 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --suppress-warnings-all vector_add.cu --cuda-include-path=" + test_config.include_path) - return not is_sub_string("DPCT1015", test_config.command_output) -def build_test(): + return not is_sub_string("DPCT1015", single_case_text.command_text) +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-suppress-warnings/do_test.py b/behavior_tests/src/bt-suppress-warnings/do_test.py index f8f81573a..df7b3b828 100644 --- a/behavior_tests/src/bt-suppress-warnings/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings/do_test.py @@ -13,15 +13,15 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.cu --suppress-warnings=1000-1003,1008 --cuda-include-path=" + test_config.include_path) - return not is_sub_string("warning: DPCT10", test_config.command_output) -def build_test(): + return not is_sub_string("warning: DPCT10", single_case_text.command_text) +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-tilde-path/do_test.py b/behavior_tests/src/bt-tilde-path/do_test.py index 450a022f3..2a9b01bf0 100644 --- a/behavior_tests/src/bt-tilde-path/do_test.py +++ b/behavior_tests/src/bt-tilde-path/do_test.py @@ -15,14 +15,14 @@ from test_utils import * user_root_path = "" old_tilde = "" -def setup_test(): +def setup_test(single_case_text): global old_tilde - change_dir(test_config.current_test) + change_dir(single_case_text.name, single_case_text) old_tilde = os.path.expanduser("~") os.environ["HOME"] = "/tmp" return True -def migrate_test(): +def migrate_test(single_case_text): global user_root_path user_root_path = os.path.expanduser("~") + "/workspace" if os.path.exists(user_root_path): @@ -31,7 +31,7 @@ def migrate_test(): distutils.dir_util.copy_tree(test_config.include_path + "/..", user_root_path) return call_subprocess("dpct vector_add.cu --cuda-include-path=" + "~/workspace/include") -def build_test(): +def build_test(single_case_text): global old_tilde global user_root_path if os.path.exists(user_root_path): @@ -39,5 +39,5 @@ def build_test(): os.environ["HOME"] = old_tilde return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-unsupported-type-function/do_test.py b/behavior_tests/src/bt-unsupported-type-function/do_test.py index 5f9c442a2..fa1ea4ecb 100644 --- a/behavior_tests/src/bt-unsupported-type-function/do_test.py +++ b/behavior_tests/src/bt-unsupported-type-function/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): migrated_file = os.path.join("out_nvml", "test.dp.cpp") call_subprocess(test_config.CT_TOOL + " test.cu --out-root=./out_nvml --cuda-include-path=" + test_config.include_path) warn_1007_count = 0 @@ -32,8 +32,8 @@ def migrate_test(): if warn_1007_count == 5 and warn_1082_count == 19: return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-use-explicit-namespace1/do_test.py b/behavior_tests/src/bt-use-explicit-namespace1/do_test.py index 48f621c40..a6c0d2453 100644 --- a/behavior_tests/src/bt-use-explicit-namespace1/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace1/do_test.py @@ -13,20 +13,20 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) return True -def build_test(): +def build_test(single_case_text): srcs = [] srcs.append(os.path.join("sycl", "vector_add.dp.cpp")) - return compile_and_link(srcs) + return compile_and_link(srcs, single_case_text) -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter - return run_binary_with_args() + return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/bt-use-explicit-namespace2/do_test.py b/behavior_tests/src/bt-use-explicit-namespace2/do_test.py index c0cec7a91..cdaee0534 100644 --- a/behavior_tests/src/bt-use-explicit-namespace2/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace2/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) return ret -def build_test(): +def build_test(single_case_text): srcs = [] srcs.append(os.path.join("sycl", "vector_add.dp.cpp")) - return compile_and_link(srcs) + return compile_and_link(srcs, single_case_text) -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter - return run_binary_with_args() \ No newline at end of file + return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/bt-use-explicit-namespace3/do_test.py b/behavior_tests/src/bt-use-explicit-namespace3/do_test.py index 2ed5dbb6b..3d2f556b7 100644 --- a/behavior_tests/src/bt-use-explicit-namespace3/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace3/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) return ret -def build_test(): +def build_test(single_case_text): srcs = [] srcs.append(os.path.join("sycl", "vector_add.dp.cpp")) - return compile_and_link(srcs) + return compile_and_link(srcs, single_case_text) -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter - return run_binary_with_args() \ No newline at end of file + return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/bt-use-explicit-namespace4/do_test.py b/behavior_tests/src/bt-use-explicit-namespace4/do_test.py index 73f88d467..a24b5a232 100644 --- a/behavior_tests/src/bt-use-explicit-namespace4/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace4/do_test.py @@ -13,15 +13,15 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=cl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) return ret -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-use-explicit-namespace5/do_test.py b/behavior_tests/src/bt-use-explicit-namespace5/do_test.py index 182cee8be..4df691156 100644 --- a/behavior_tests/src/bt-use-explicit-namespace5/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace5/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) return ret -def build_test(): +def build_test(single_case_text): srcs = [] srcs.append(os.path.join("sycl", "vector_add.dp.cpp")) - return compile_and_link(srcs) + return compile_and_link(srcs, single_case_text) -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter - return run_binary_with_args() + return run_binary_with_args(single_case_text) diff --git a/behavior_tests/src/bt-use-explicit-namespace6/do_test.py b/behavior_tests/src/bt-use-explicit-namespace6/do_test.py index 71e79ac04..ce76f916b 100644 --- a/behavior_tests/src/bt-use-explicit-namespace6/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace6/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math,dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) return ret -def build_test(): +def build_test(single_case_text): srcs = [] srcs.append(os.path.join("sycl", "vector_add.dp.cpp")) - return compile_and_link(srcs) + return compile_and_link(srcs, single_case_text) -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter - return run_binary_with_args() + return run_binary_with_args(single_case_text) diff --git a/behavior_tests/src/bt-version/do_test.py b/behavior_tests/src/bt-version/do_test.py index 63f3ac1ae..e13fc2ac9 100644 --- a/behavior_tests/src/bt-version/do_test.py +++ b/behavior_tests/src/bt-version/do_test.py @@ -13,20 +13,20 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --version") ct_clang_version = get_ct_clang_version() expected_output = "dpct version {0}".format(ct_clang_version) print("expected dpct version output: {0}".format(expected_output)) - print("\n'dpct --version' outputs {0}".format(test_config.command_output)) - return is_sub_string(expected_output, test_config.command_output) + print("\n'dpct --version' outputs {0}".format(single_case_text.command_text)) + return is_sub_string(expected_output, single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py index 90f8c08ee..6fe09c395 100644 --- a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) - return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", test_config.command_output) + return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py index 6b04f8faf..736dc0ade 100644 --- a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --in-root . --out-root out --always-use-async-handler --assume-nd-range-dim=1 --comments --enable-ctad --no-dpcpp-extensions=enqueued_barriers --no-dry-pattern --process-all -p . --sycl-named-lambda --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --usm-level=none --cuda-include-path=" + test_config.include_path) call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path) - return is_sub_string("\"--analysis-scope-path=\"", test_config.command_output) and \ - is_sub_string("--always-use-async-handler --comments --compilation-database=\"", test_config.command_output) and \ - is_sub_string("--enable-ctad --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --no-dpcpp-extensions=enqueued_barriers --assume-nd-range-dim=1 --no-dry-pattern --process-all --sycl-named-lambda --usm-level=none\".", test_config.command_output) + return is_sub_string("\"--analysis-scope-path=\"", single_case_text.command_text) and \ + is_sub_string("--always-use-async-handler --comments --compilation-database=\"", single_case_text.command_text) and \ + is_sub_string("--enable-ctad --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --no-dpcpp-extensions=enqueued_barriers --assume-nd-range-dim=1 --no-dry-pattern --process-all --sycl-named-lambda --usm-level=none\".", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py index 68cfe7139..0dca3c6ab 100644 --- a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-cl-namespace-inline --cuda-include-path=" + test_config.include_path) call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path) - return is_sub_string("--no-cl-namespace-inline\".", test_config.command_output) + return is_sub_string("--no-cl-namespace-inline\".", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-yaml-with-different-options3/do_test.py b/behavior_tests/src/bt-yaml-with-different-options3/do_test.py index d34346c64..7d8d09ba8 100644 --- a/behavior_tests/src/bt-yaml-with-different-options3/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options3/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --usm-level=none --cuda-include-path=" + test_config.include_path) return call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-incremental-migration --cuda-include-path=" + test_config.include_path) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py index 62d557501..835b08862 100644 --- a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) - return is_sub_string("Failed to load", test_config.command_output) and \ - is_sub_string("Migration continues with incremental migration disabled", test_config.command_output) + return is_sub_string("Failed to load", single_case_text.command_text) and \ + is_sub_string("Migration continues with incremental migration disabled", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py index b16a5c252..7a1a0cb70 100644 --- a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py +++ b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py @@ -13,25 +13,25 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): - change_dir('cannot-acc-dir-in-db/helloworld') +def migrate_test(single_case_text): + change_dir('cannot-acc-dir-in-db/helloworld', single_case_text) call_subprocess('intercept-build /usr/bin/make') - change_dir('..') + change_dir('..', single_case_text) call_subprocess('mv helloworld helloworld_tst') call_subprocess(test_config.CT_TOOL + ' -p ./helloworld_tst/compile_commands.json --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) - if 'check if the directory exists and can be accessed by the tool' in test_config.command_output: + if 'check if the directory exists and can be accessed by the tool' in single_case_text.command_text: return True print("could not get expected message: check if the directory exists and can be accessed by the tool") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/change-filename-extension/do_test.py b/behavior_tests/src/change-filename-extension/do_test.py index 060a5e176..158455b79 100644 --- a/behavior_tests/src/change-filename-extension/do_test.py +++ b/behavior_tests/src/change-filename-extension/do_test.py @@ -14,47 +14,47 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess( test_config.CT_TOOL + " -p=. --change-cuda-files-extension-only --out-root=out --cuda-include-path=" + test_config.include_path) - print(test_config.command_output) + print(single_case_text.command_text) reference = 'main.dp.cpp' call_subprocess("ls out | grep " + reference) res = True - if reference not in test_config.command_output: + if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) reference = 'test.cpp' call_subprocess("ls out | grep " + reference) - if reference not in test_config.command_output: + if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) reference = 'test.dp.hpp' call_subprocess("ls out | grep " + reference) - if reference not in test_config.command_output: + if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) reference = 'test.h' call_subprocess("ls out | grep " + reference) - if reference not in test_config.command_output: + if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) return res -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/check-device-unsupport-aspect/do_test.py b/behavior_tests/src/check-device-unsupport-aspect/do_test.py index 9fa2127bc..3cf6e760b 100644 --- a/behavior_tests/src/check-device-unsupport-aspect/do_test.py +++ b/behavior_tests/src/check-device-unsupport-aspect/do_test.py @@ -11,12 +11,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): res = True cmd = test_config.CT_TOOL + " --out-root=out double.cu --cuda-include-path=" + test_config.include_path if not call_subprocess(cmd): @@ -33,9 +33,9 @@ def migrate_test(): return res -def build_test(): +def build_test(single_case_text): res = True - if not compile_files([os.path.join("out", "double.dp.cpp")]): + if not compile_files([os.path.join("out", "double.dp.cpp")], single_case_text): res = False print("double.dp.cpp compile failed") else: @@ -46,7 +46,7 @@ def build_test(): print("double.dp.cpp link failed") else: print("double.dp.cpp link pass") - if not compile_files([os.path.join("out", "half.dp.cpp")]): + if not compile_files([os.path.join("out", "half.dp.cpp")], single_case_text): res = False print("half.dp.cpp compile failed") else: @@ -60,7 +60,7 @@ def build_test(): return res -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter res = 0 @@ -69,7 +69,7 @@ def run_test(): res += 1 print("double.run run pass") print("double.run output:") - print(test_config.command_output) + print(single_case_text.command_text) if res != 1: print("case 'double' failed") return False @@ -79,7 +79,7 @@ def run_test(): res += 1 print("half.run run pass") print("half.run output:") - print(test_config.command_output) + print(single_case_text.command_text) if res != 2: print("case 'half' failed") return False diff --git a/behavior_tests/src/check-windows-version/do_test.py b/behavior_tests/src/check-windows-version/do_test.py index 6fdd37511..ab94b00dc 100644 --- a/behavior_tests/src/check-windows-version/do_test.py +++ b/behavior_tests/src/check-windows-version/do_test.py @@ -14,15 +14,15 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True def get_windows_version(arg1, arg2): call_subprocess("powershell \"(Get-Item -path " + arg1 + ").VersionInfo." + arg2 + "\"") - return test_config.command_output + return single_case_text.command_text -def migrate_test(): +def migrate_test(single_case_text): ct_path = get_ct_path() if not ct_path: print('Cannot find the path to dpct!') @@ -50,8 +50,8 @@ def migrate_test(): return file_version == ct_clang_version and product_version == ct_clang_version and \ product_name == "SYCLomatic" and file_description == "" and legal_copyright == "" -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/cl_compile_test_1/do_test.py b/behavior_tests/src/cl_compile_test_1/do_test.py index 937c7d065..3e2a61f39 100644 --- a/behavior_tests/src/cl_compile_test_1/do_test.py +++ b/behavior_tests/src/cl_compile_test_1/do_test.py @@ -13,25 +13,25 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): - change_dir('cannot-acc-dir-in-db/helloworld') +def migrate_test(single_case_text): + change_dir('cannot-acc-dir-in-db/helloworld', single_case_text) call_subprocess('intercept-build /usr/bin/make') - change_dir('..') + change_dir('..', single_case_text) call_subprocess('mv helloworld helloworld_tst') call_subprocess(test_config.CT_TOOL + ' helloworld_tst/src/test.cu --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) - if 'check if the directory exists and can be accessed by the tool' in test_config.command_output: + if 'check if the directory exists and can be accessed by the tool' in single_case_text.command_text: return True print("could not get expected message: check if the directory exists and can be accessed by the tool") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/cmp_intercept_build/do_test.py b/behavior_tests/src/cmp_intercept_build/do_test.py index 54229769d..452ec5122 100644 --- a/behavior_tests/src/cmp_intercept_build/do_test.py +++ b/behavior_tests/src/cmp_intercept_build/do_test.py @@ -14,8 +14,8 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True def parse_compilation_database(compilation_database_name): @@ -30,7 +30,7 @@ def parse_compilation_database(compilation_database_name): database_source_files.append(os.path.basename(compilation_item)) return database_source_files -def migrate_test(): +def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make --no-linker-entry") new_database = parse_compilation_database("compile_commands.json") @@ -43,8 +43,8 @@ def migrate_test(): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/cmps_cl_compile_test_1/do_test.py b/behavior_tests/src/cmps_cl_compile_test_1/do_test.py index 1e25d83cc..9bed37b18 100644 --- a/behavior_tests/src/cmps_cl_compile_test_1/do_test.py +++ b/behavior_tests/src/cmps_cl_compile_test_1/do_test.py @@ -13,12 +13,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): file_vcxproj = os.path.join(os.getcwd(), "cuda", "file_c.vcxproj") migrated_file = os.path.join(os.getcwd(), "cuda", "file.c") expected_str = "" @@ -41,8 +41,8 @@ def migrate_test(): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/cmps_cl_compile_test_2/do_test.py b/behavior_tests/src/cmps_cl_compile_test_2/do_test.py index badc4ad90..c25fd25c9 100644 --- a/behavior_tests/src/cmps_cl_compile_test_2/do_test.py +++ b/behavior_tests/src/cmps_cl_compile_test_2/do_test.py @@ -13,12 +13,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): file_vcxproj = os.path.join(os.getcwd(), "cuda", "file_cu.vcxproj") migrated_file = os.path.join(os.getcwd(), "cuda", "file.cu") expected_str = "" @@ -40,8 +40,8 @@ def migrate_test(): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py b/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py index 44d33db61..f7ed1830e 100644 --- a/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py +++ b/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py @@ -13,12 +13,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): file_vcxproj = os.path.join(os.getcwd(), "cuda", "file_c.vcxproj") migrated_file = os.path.join(os.getcwd(), "cuda", "file.c") expected_str = "" @@ -40,8 +40,8 @@ def migrate_test(): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py b/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py index 44d33db61..f7ed1830e 100644 --- a/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py +++ b/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py @@ -13,12 +13,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): file_vcxproj = os.path.join(os.getcwd(), "cuda", "file_c.vcxproj") migrated_file = os.path.join(os.getcwd(), "cuda", "file.c") expected_str = "" @@ -40,8 +40,8 @@ def migrate_test(): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/copy_all_files/do_test.py b/behavior_tests/src/copy_all_files/do_test.py index 2bb44804b..1f2881106 100644 --- a/behavior_tests/src/copy_all_files/do_test.py +++ b/behavior_tests/src/copy_all_files/do_test.py @@ -14,23 +14,23 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL +" --out-root=out --cuda-include-path=" + test_config.include_path + " t.c t.cpp t.cu") - # return is_sub_string("Migration not necessary", test_config.command_output) + # return is_sub_string("Migration not necessary", single_case_text.command_text) if os.path.exists(os.path.join("out", "t.c")) or os.path.exists(os.path.join("out", "t.cpp")) or \ os.path.exists(os.path.join("out", "t.dp.cpp")): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/execute_from_bundle_root/do_test.py b/behavior_tests/src/execute_from_bundle_root/do_test.py index 86a427dc1..0ce0c513f 100644 --- a/behavior_tests/src/execute_from_bundle_root/do_test.py +++ b/behavior_tests/src/execute_from_bundle_root/do_test.py @@ -14,8 +14,8 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) prepare_execution_folder() return True @@ -24,18 +24,18 @@ def prepare_execution_folder(): copy_ct_bin = os.path.dirname(str(shutil.which(test_config.CT_TOOL))) distutils.dir_util.copy_tree(copy_ct_bin, "bin") -def migrate_test(): +def migrate_test(single_case_text): ct_bin = os.path.join("bin", test_config.CT_TOOL) in_root = "" extra_args = "" call_subprocess(ct_bin + " --cuda-include-path=" + test_config.include_path + " " + "hellocuda.cu") - if ('or the same folder as' in test_config.command_output): + if ('or the same folder as' in single_case_text.command_text): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/execute_from_cuda_path/do_test.py b/behavior_tests/src/execute_from_cuda_path/do_test.py index f884086cd..ebadfa8b6 100644 --- a/behavior_tests/src/execute_from_cuda_path/do_test.py +++ b/behavior_tests/src/execute_from_cuda_path/do_test.py @@ -14,8 +14,8 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) prepare_execution_folder() return True @@ -23,18 +23,18 @@ def setup_test(): def prepare_execution_folder(): distutils.dir_util.copy_tree(test_config.include_path, "include") -def migrate_test(): +def migrate_test(single_case_text): src =os.path.join("include", "vector_types.h") in_root = "" extra_args = "" call_subprocess(test_config.CT_TOOL + " --cuda-include-path=./include " + src) - print("hello" + test_config.command_output) - if ('option is in the CUDA_PATH folder' in test_config.command_output): + print("hello" + single_case_text.command_text) + if ('option is in the CUDA_PATH folder' in single_case_text.command_text): return True return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/integer-overflow/do_test.py b/behavior_tests/src/integer-overflow/do_test.py index 9d5ca2c68..48f77c991 100644 --- a/behavior_tests/src/integer-overflow/do_test.py +++ b/behavior_tests/src/integer-overflow/do_test.py @@ -13,22 +13,22 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) - change_dir("helloworld") +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) + change_dir("helloworld", single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make") - change_dir("..") + change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst") call_subprocess(test_config.CT_TOOL + " helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path + " --suppress-warnings=-1,0,0x100,0x1000,0x3fffffff,0x7ffffffe,0x7fffffff,0x80000000,0xfffffffe,0xffffffff,0x10000,0x100000") - return is_sub_string("Error: Invalid warning ID or range; valid warning IDs range from 1000 to", test_config.command_output) + return is_sub_string("Error: Invalid warning ID or range; valid warning IDs range from 1000 to", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-UDR-idx1/do_test.py b/behavior_tests/src/ngt-UDR-idx1/do_test.py index 6b42cca54..883506489 100644 --- a/behavior_tests/src/ngt-UDR-idx1/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx1/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: in rule sample_rule, unknown keyword: $abd))", test_config.command_output) + return is_sub_string("Error: in rule sample_rule, unknown keyword: $abd))", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-UDR-idx2/do_test.py b/behavior_tests/src/ngt-UDR-idx2/do_test.py index 4b7604ac7..21e6819ca 100644 --- a/behavior_tests/src/ngt-UDR-idx2/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx2/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: in rule sample_rule, unknown keyword: $-1))", test_config.command_output) + return is_sub_string("Error: in rule sample_rule, unknown keyword: $-1))", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-UDR-idx3/do_test.py b/behavior_tests/src/ngt-UDR-idx3/do_test.py index 0bc09a798..c336b185d 100644 --- a/behavior_tests/src/ngt-UDR-idx3/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx3/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: in rule sample_rule, argument index out of range", test_config.command_output) + return is_sub_string("Error: in rule sample_rule, argument index out of range", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-UDR-keyword/do_test.py b/behavior_tests/src/ngt-UDR-keyword/do_test.py index ec203b982..90c504984 100644 --- a/behavior_tests/src/ngt-UDR-keyword/do_test.py +++ b/behavior_tests/src/ngt-UDR-keyword/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: in rule sample_rule, '(' is expected after $deref", test_config.command_output) + return is_sub_string("Error: in rule sample_rule, '(' is expected after $deref", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-UDR-path/do_test.py b/behavior_tests/src/ngt-UDR-path/do_test.py index e7af9350b..5d51066cb 100644 --- a/behavior_tests/src/ngt-UDR-path/do_test.py +++ b/behavior_tests/src/ngt-UDR-path/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./ruleaaa.yaml --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: failed to read", test_config.command_output) + return is_sub_string("Error: failed to read", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py index 3b14d8394..0e6e79807 100644 --- a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py +++ b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py @@ -15,12 +15,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") @@ -34,14 +34,14 @@ def migrate_test(): os.path.realpath(analysis_scope)) if not is_sub_string( "Error: The path for --analysis-scope-path is not the same as or a parent directory of --in-root", - test_config.command_output): + single_case_text.command_text): return False return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py index e0622fa47..30a5a6d01 100644 --- a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py +++ b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --assume-nd-range-dim=2 --cuda-include-path=" + test_config.include_path) - return is_sub_string("Cannot find option named", test_config.command_output) + return is_sub_string("Cannot find option named", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py index cd82cb752..31cd941fe 100644 --- a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py @@ -13,12 +13,12 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) - change_dir("helloworld") +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) + change_dir("helloworld", single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): cur_dr = os.getcwd() if (platform.system() == 'Windows'): cur_dr = cur_dr.replace('\\', '/') @@ -31,10 +31,10 @@ def migrate_test(): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: Cannot access directory", test_config.command_output) + return is_sub_string("Error: Cannot access directory", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-cannot-find-db/do_test.py b/behavior_tests/src/ngt-cannot-find-db/do_test.py index 669075f10..fcfd522ae 100644 --- a/behavior_tests/src/ngt-cannot-find-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-find-db/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) - change_dir("helloworld") +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) + change_dir("helloworld",single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " -p ./ --cuda-include-path=" + test_config.include_path) - return is_sub_string("Cannot find compilation database", test_config.command_output) + return is_sub_string("Cannot find compilation database", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-check-cannot-parse/do_test.py b/behavior_tests/src/ngt-check-cannot-parse/do_test.py index 264c3fb50..b63983a77 100644 --- a/behavior_tests/src/ngt-check-cannot-parse/do_test.py +++ b/behavior_tests/src/ngt-check-cannot-parse/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " vector_add.cu") - return is_sub_string("Migration not necessary", test_config.command_output) + return is_sub_string("Migration not necessary", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-database-notfound/do_test.py b/behavior_tests/src/ngt-database-notfound/do_test.py index 29ad1f099..f2d4afa76 100644 --- a/behavior_tests/src/ngt-database-notfound/do_test.py +++ b/behavior_tests/src/ngt-database-notfound/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " -p=.") - return is_sub_string("No compilation database found", test_config.command_output) + return is_sub_string("No compilation database found", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-file-parsing-err/do_test.py b/behavior_tests/src/ngt-file-parsing-err/do_test.py index 9b9275188..1ba524541 100644 --- a/behavior_tests/src/ngt-file-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-file-parsing-err/do_test.py @@ -13,20 +13,20 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu -stop-on-parse-err --cuda-include-path=" + test_config.include_path) - return (is_sub_string("Cannot parse input file", test_config.command_output) - and is_sub_string("Parsing", test_config.command_output) - and not is_sub_string("Analyzing", test_config.command_output) - and not is_sub_string("Migrating", test_config.command_output)) + return (is_sub_string("Cannot parse input file", single_case_text.command_text) + and is_sub_string("Parsing", single_case_text.command_text) + and not is_sub_string("Analyzing", single_case_text.command_text) + and not is_sub_string("Migrating", single_case_text.command_text)) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-format-range/do_test.py b/behavior_tests/src/ngt-format-range/do_test.py index f74d139bb..c98063659 100644 --- a/behavior_tests/src/ngt-format-range/do_test.py +++ b/behavior_tests/src/ngt-format-range/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --format-range=aaa") - return is_sub_string("Cannot find option named", test_config.command_output) + return is_sub_string("Cannot find option named", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-format-style/do_test.py b/behavior_tests/src/ngt-format-style/do_test.py index c0b629607..7ca92c70b 100644 --- a/behavior_tests/src/ngt-format-style/do_test.py +++ b/behavior_tests/src/ngt-format-style/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --format-style=aaa") - return is_sub_string("Cannot find option named", test_config.command_output) + return is_sub_string("Cannot find option named", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-in-root-len/do_test.py b/behavior_tests/src/ngt-in-root-len/do_test.py index 213dd2679..a99035852 100644 --- a/behavior_tests/src/ngt-in-root-len/do_test.py +++ b/behavior_tests/src/ngt-in-root-len/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): max_len = 511 if (platform.system() == 'Windows'): max_len = 32 @@ -29,10 +29,10 @@ def migrate_test(): os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ long_path) - return is_sub_string("should be less than", test_config.command_output) + return is_sub_string("should be less than", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-in-root-path/do_test.py b/behavior_tests/src/ngt-in-root-path/do_test.py index 577a09f61..3d5579381 100644 --- a/behavior_tests/src/ngt-in-root-path/do_test.py +++ b/behavior_tests/src/ngt-in-root-path/do_test.py @@ -14,16 +14,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --in-root=./inroot vector_add.cu") - return is_sub_string("is not under the specified input root directory", test_config.command_output) + return is_sub_string("is not under the specified input root directory", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-include-path-len/do_test.py b/behavior_tests/src/ngt-include-path-len/do_test.py index 9aa50079b..c9333acd0 100644 --- a/behavior_tests/src/ngt-include-path-len/do_test.py +++ b/behavior_tests/src/ngt-include-path-len/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): max_len = 511 if (platform.system() == 'Windows'): max_len = 32 @@ -28,10 +28,10 @@ def migrate_test(): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + long_path) - return is_sub_string("should be less than", test_config.command_output) + return is_sub_string("should be less than", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py index 8444b283e..8b9a5fd83 100644 --- a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py +++ b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py @@ -13,18 +13,18 @@ import shutil from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): shutil.copytree(test_config.include_path, "cc") call_subprocess(test_config.CT_TOOL + " --in-root=./ ./simple_foo.cu --cuda-include-path=./cc") - return is_sub_string("Error: Input folder specified by --in-root or --analysis-scope-path is the parent of, or the same folder", test_config.command_output) + return is_sub_string("Error: Input folder specified by --in-root or --analysis-scope-path is the parent of, or the same folder", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py index 39547bf72..d09b4ad67 100644 --- a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py +++ b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=/usr/local/folder-does-not-contain-cuda\" vector_add.cu") - return is_sub_string("Could not detect path to CUDA header files", test_config.command_output) + return is_sub_string("Could not detect path to CUDA header files", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py index d123a60bc..dc1ecf768 100644 --- a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py +++ b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --use-experimental-features=logical-group,abc") - return is_sub_string("for the --use-experimental-features option: Cannot find option named \'abc\'!", test_config.command_output) + return is_sub_string("for the --use-experimental-features option: Cannot find option named \'abc\'!", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py index 252ec61b6..cefc40308 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none,dpct vector_add.cu --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", test_config.command_output) + return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py index 0522d4e87..b09b14317 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,cl,dpct vector_add.cu --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", test_config.command_output) + return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py index eeb602668..5117f4ebc 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,sycl-math vector_add.cu --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", test_config.command_output) + return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-inroot/do_test.py b/behavior_tests/src/ngt-invalid-inroot/do_test.py index 7da8a27c9..32ab09023 100644 --- a/behavior_tests/src/ngt-invalid-inroot/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-root=/notavalidfolder --cuda-include-path=" + test_config.include_path) - return is_sub_string("The path for --in-root or --out-root is not valid", test_config.command_output) + return is_sub_string("The path for --in-root or --out-root is not valid", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-inroot2/do_test.py b/behavior_tests/src/ngt-invalid-inroot2/do_test.py index 30cf1a293..93233618d 100644 --- a/behavior_tests/src/ngt-invalid-inroot2/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot2/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-root=/usr/local --cuda-include-path=" + test_config.include_path) - return is_sub_string("The path for --in-root is not valid", test_config.command_output) + return is_sub_string("The path for --in-root is not valid", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-inroot3/do_test.py b/behavior_tests/src/ngt-invalid-inroot3/do_test.py index 4db7e311b..fa53e3232 100644 --- a/behavior_tests/src/ngt-invalid-inroot3/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot3/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-root=C:\Windows --cuda-include-path=" + test_config.include_path) - return is_sub_string("The path for --in-root is not valid", test_config.command_output) + return is_sub_string("The path for --in-root is not valid", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-json1/do_test.py b/behavior_tests/src/ngt-invalid-json1/do_test.py index ee2ae54b7..d9f9f7d1a 100644 --- a/behavior_tests/src/ngt-invalid-json1/do_test.py +++ b/behavior_tests/src/ngt-invalid-json1/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -30,10 +30,10 @@ def migrate_test(): f.writelines(ret[1:]) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("Expected array", test_config.command_output) + return is_sub_string("Expected array", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json10/do_test.py b/behavior_tests/src/ngt-invalid-json10/do_test.py index fdd11e4ef..4f71642eb 100644 --- a/behavior_tests/src/ngt-invalid-json10/do_test.py +++ b/behavior_tests/src/ngt-invalid-json10/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -30,12 +30,12 @@ def migrate_test(): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", test_config.command_output) + return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json2/do_test.py b/behavior_tests/src/ngt-invalid-json2/do_test.py index abe94ced5..442f2c03c 100644 --- a/behavior_tests/src/ngt-invalid-json2/do_test.py +++ b/behavior_tests/src/ngt-invalid-json2/do_test.py @@ -15,11 +15,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -31,11 +31,11 @@ def migrate_test(): with open("compile_commands.json", 'w') as f: f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("Missing key: \"file\"", test_config.command_output) + return is_sub_string("Missing key: \"file\"", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json3/do_test.py b/behavior_tests/src/ngt-invalid-json3/do_test.py index cd035cb03..1b137f1e4 100644 --- a/behavior_tests/src/ngt-invalid-json3/do_test.py +++ b/behavior_tests/src/ngt-invalid-json3/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -30,12 +30,12 @@ def migrate_test(): with open("compile_commands.json", 'w') as f: f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("Expected Key, Flow Entry, or Flow Mapping End", test_config.command_output) + return is_sub_string("Expected Key, Flow Entry, or Flow Mapping End", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json4/do_test.py b/behavior_tests/src/ngt-invalid-json4/do_test.py index 36007cb20..e325262c2 100644 --- a/behavior_tests/src/ngt-invalid-json4/do_test.py +++ b/behavior_tests/src/ngt-invalid-json4/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -30,12 +30,12 @@ def migrate_test(): ret.pop(6) f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("Could not find closing ]", test_config.command_output) + return is_sub_string("Could not find closing ]", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json5/do_test.py b/behavior_tests/src/ngt-invalid-json5/do_test.py index e4f743867..011bde6c3 100644 --- a/behavior_tests/src/ngt-invalid-json5/do_test.py +++ b/behavior_tests/src/ngt-invalid-json5/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -32,10 +32,10 @@ def migrate_test(): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", test_config.command_output) + return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json6/do_test.py b/behavior_tests/src/ngt-invalid-json6/do_test.py index b03ca0ced..a5ede9fd8 100644 --- a/behavior_tests/src/ngt-invalid-json6/do_test.py +++ b/behavior_tests/src/ngt-invalid-json6/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -31,11 +31,11 @@ def migrate_test(): with open("compile_commands.json", 'w') as f: f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", test_config.command_output) + return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json7/do_test.py b/behavior_tests/src/ngt-invalid-json7/do_test.py index 09b55d9e1..e36fc9ff6 100644 --- a/behavior_tests/src/ngt-invalid-json7/do_test.py +++ b/behavior_tests/src/ngt-invalid-json7/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -32,11 +32,11 @@ def migrate_test(): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("Unknown key: \"\"output\"\"", test_config.command_output) + return is_sub_string("Unknown key: \"\"output\"\"", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json8/do_test.py b/behavior_tests/src/ngt-invalid-json8/do_test.py index eed7182e4..6670484b2 100644 --- a/behavior_tests/src/ngt-invalid-json8/do_test.py +++ b/behavior_tests/src/ngt-invalid-json8/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] with open("compile_commands.json", 'r') as f: @@ -32,12 +32,12 @@ def migrate_test(): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("Unknown key: \"\"arguments\"\"", test_config.command_output) + return is_sub_string("Unknown key: \"\"arguments\"\"", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json9/do_test.py b/behavior_tests/src/ngt-invalid-json9/do_test.py index e051635d1..fbe958659 100644 --- a/behavior_tests/src/ngt-invalid-json9/do_test.py +++ b/behavior_tests/src/ngt-invalid-json9/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): data = [] ret = [] iter = 0 @@ -35,13 +35,13 @@ def migrate_test(): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) - return is_sub_string("Processed 1 file(s)", test_config.command_output) + return is_sub_string("Processed 1 file(s)", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py index 6c48aaeb8..5a0f766c2 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu") - return is_sub_string("invalid number", test_config.command_output) + return is_sub_string("invalid number", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py index 737d56ec7..186c996f8 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py @@ -15,18 +15,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu") - return is_sub_string("invalid number", test_config.command_output) + return is_sub_string("invalid number", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py index a2515c667..d1f260257 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu") - return is_sub_string("invalid number", test_config.command_output) + return is_sub_string("invalid number", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py index b92ac6d2f..501cb7a16 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu") - return is_sub_string("unknown key \'ColumnLimi\'", test_config.command_output) + return is_sub_string("unknown key \'ColumnLimi\'", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py index cb2bc8b3c..d80d7f6f9 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) @@ -30,14 +30,14 @@ def migrate_test(): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) - if "error: unknown key \'ConstantFla\'" in test_config.command_output: + if "error: unknown key \'ConstantFla\'" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py index 5b107dcf5..22965c0a3 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) @@ -30,14 +30,14 @@ def migrate_test(): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) - if "Unexpected token. Expected Key or Block End" in test_config.command_output: + if "Unexpected token. Expected Key or Block End" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py index 0ccdaa1cb..7a188b41b 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): print("test-----------------") call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) @@ -32,15 +32,15 @@ def migrate_test(): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH']) - print(test_config.command_output) - if "Unexpected token. Expected Key or Block End" in test_config.command_output: + print(single_case_text.command_text) + if "Unexpected token. Expected Key or Block End" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py index 1d85d6c08..1f9114f14 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"]) migrated_yaml = os.path.join("out", "hello.h.yaml") @@ -30,14 +30,14 @@ def migrate_test(): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=./out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"]) - if "differnt path" in test_config.command_output: + if "differnt path" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-level-verbosity/do_test.py b/behavior_tests/src/ngt-level-verbosity/do_test.py index a3d5e992e..54b32ef80 100644 --- a/behavior_tests/src/ngt-level-verbosity/do_test.py +++ b/behavior_tests/src/ngt-level-verbosity/do_test.py @@ -15,18 +15,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --usm-level=abc --output-verbositi=abc") - return is_sub_string("Unknown command line argument '--output-verbositi=abc'", test_config.command_output) + return is_sub_string("Unknown command line argument '--output-verbositi=abc'", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-no-db-specified/do_test.py b/behavior_tests/src/ngt-no-db-specified/do_test.py index d64ebae72..192a4aba8 100644 --- a/behavior_tests/src/ngt-no-db-specified/do_test.py +++ b/behavior_tests/src/ngt-no-db-specified/do_test.py @@ -14,17 +14,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " -in-root=./ -out-root=out -p=./") - return is_sub_string("Error: Cannot find compilation database", test_config.command_output) + return is_sub_string("Error: Cannot find compilation database", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py index a7a22982a..bda347030 100644 --- a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py +++ b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path) - return is_sub_string("Error: The option --process-all requires that the", test_config.command_output) + return is_sub_string("Error: The option --process-all requires that the", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-no-file-type/do_test.py b/behavior_tests/src/ngt-no-file-type/do_test.py index e8b658cb3..4771eeba3 100644 --- a/behavior_tests/src/ngt-no-file-type/do_test.py +++ b/behavior_tests/src/ngt-no-file-type/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo --cuda-include-path=" + test_config.include_path) - return is_sub_string("File Type not available for input file", test_config.command_output) + return is_sub_string("File Type not available for input file", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-no-source-name/do_test.py b/behavior_tests/src/ngt-no-source-name/do_test.py index 2ea78e2e6..c1c36238f 100644 --- a/behavior_tests/src/ngt-no-source-name/do_test.py +++ b/behavior_tests/src/ngt-no-source-name/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " vector_add") - return is_sub_string("does not have an extension", test_config.command_output) + return is_sub_string("does not have an extension", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-opt-parsing-err/do_test.py b/behavior_tests/src/ngt-opt-parsing-err/do_test.py index cae2a59a9..51346cfbc 100644 --- a/behavior_tests/src/ngt-opt-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-opt-parsing-err/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-rooooot=/aaa --cuda-include-path=" + test_config.include_path) - return is_sub_string("Option parsing error", test_config.command_output) + return is_sub_string("Option parsing error", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-out-root-len/do_test.py b/behavior_tests/src/ngt-out-root-len/do_test.py index 213dd2679..a99035852 100644 --- a/behavior_tests/src/ngt-out-root-len/do_test.py +++ b/behavior_tests/src/ngt-out-root-len/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): max_len = 511 if (platform.system() == 'Windows'): max_len = 32 @@ -29,10 +29,10 @@ def migrate_test(): os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ long_path) - return is_sub_string("should be less than", test_config.command_output) + return is_sub_string("should be less than", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-output-access/do_test.py b/behavior_tests/src/ngt-output-access/do_test.py index 18eaa05b3..a9f085c19 100644 --- a/behavior_tests/src/ngt-output-access/do_test.py +++ b/behavior_tests/src/ngt-output-access/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): os.mkdir("dpct_output") call_subprocess("chmod u-r dpct_output") call_subprocess("dpct vector_add.cu --cuda-include-path=" + test_config.include_path ) - return is_sub_string("Could not access output directory", test_config.command_output) + return is_sub_string("Could not access output directory", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): call_subprocess("chmod 777 dpct_output") return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-output-create/do_test.py b/behavior_tests/src/ngt-output-create/do_test.py index cf9d0e550..e0a66dd85 100644 --- a/behavior_tests/src/ngt-output-create/do_test.py +++ b/behavior_tests/src/ngt-output-create/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path) - return is_sub_string("Unable to save the output to the specified directory", test_config.command_output) + return is_sub_string("Unable to save the output to the specified directory", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-output-file-len/do_test.py b/behavior_tests/src/ngt-output-file-len/do_test.py index 845f41904..a03fc53a7 100644 --- a/behavior_tests/src/ngt-output-file-len/do_test.py +++ b/behavior_tests/src/ngt-output-file-len/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): max_len = 511 if (platform.system() == 'Windows'): max_len = 32 @@ -28,10 +28,10 @@ def migrate_test(): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --output-file=" +long_path) - return is_sub_string("should be less than", test_config.command_output) + return is_sub_string("should be less than", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-output-not-empty/do_test.py b/behavior_tests/src/ngt-output-not-empty/do_test.py index 347d97f36..ffa47a2d8 100644 --- a/behavior_tests/src/ngt-output-not-empty/do_test.py +++ b/behavior_tests/src/ngt-output-not-empty/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): os.mkdir("dpct_output") with open(os.path.join("dpct_output", "test"), 'w') as f: f.write("2") call_subprocess(test_config.CT_TOOL + " vector_add.cu --cuda-include-path=" + test_config.include_path) - return is_sub_string("directory is not empty.", test_config.command_output) + return is_sub_string("directory is not empty.", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-output-verbosity/do_test.py b/behavior_tests/src/ngt-output-verbosity/do_test.py index cec497281..0415447c8 100644 --- a/behavior_tests/src/ngt-output-verbosity/do_test.py +++ b/behavior_tests/src/ngt-output-verbosity/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --output-verbosity=abc") - return is_sub_string("--output-verbosity option: Cannot find option named", test_config.command_output) + return is_sub_string("--output-verbosity option: Cannot find option named", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-report-file-len/do_test.py b/behavior_tests/src/ngt-report-file-len/do_test.py index 62f0e51e0..3d7be49a7 100644 --- a/behavior_tests/src/ngt-report-file-len/do_test.py +++ b/behavior_tests/src/ngt-report-file-len/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): max_len = 511 if (platform.system() == 'Windows'): max_len = 32 @@ -28,10 +28,10 @@ def migrate_test(): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=" +long_path) - return is_sub_string("should be less than 128", test_config.command_output) + return is_sub_string("should be less than 128", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-report-file-prefix/do_test.py b/behavior_tests/src/ngt-report-file-prefix/do_test.py index 5f90dbc82..040c6e9e7 100644 --- a/behavior_tests/src/ngt-report-file-prefix/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=abc:") - return is_sub_string("contains special character ':'", test_config.command_output) + return is_sub_string("contains special character ':'", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-report-file-prefix2/do_test.py b/behavior_tests/src/ngt-report-file-prefix2/do_test.py index 4a2389807..556d29c17 100644 --- a/behavior_tests/src/ngt-report-file-prefix2/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix2/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=\"/abc\"") - return is_sub_string("contains special character", test_config.command_output) + return is_sub_string("contains special character", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-report-format1/do_test.py b/behavior_tests/src/ngt-report-format1/do_test.py index fe925ff5d..29584162b 100644 --- a/behavior_tests/src/ngt-report-format1/do_test.py +++ b/behavior_tests/src/ngt-report-format1/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-format=abc") - return is_sub_string("--report-format option: Cannot find option named", test_config.command_output) + return is_sub_string("--report-format option: Cannot find option named", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-report-format2/do_test.py b/behavior_tests/src/ngt-report-format2/do_test.py index ab6a019b0..c7ea8e2aa 100644 --- a/behavior_tests/src/ngt-report-format2/do_test.py +++ b/behavior_tests/src/ngt-report-format2/do_test.py @@ -14,17 +14,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-format=xx vector_add.cu") - return is_sub_string("--report-format option: Cannot find option named 'xx'!", test_config.command_output) + return is_sub_string("--report-format option: Cannot find option named 'xx'!", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-report-type-diags/do_test.py b/behavior_tests/src/ngt-report-type-diags/do_test.py index 8c6d33831..a8e4e7bfd 100644 --- a/behavior_tests/src/ngt-report-type-diags/do_test.py +++ b/behavior_tests/src/ngt-report-type-diags/do_test.py @@ -14,17 +14,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-type=xxx --report-diags-content=transformation vector_add.cu") - return is_sub_string("--report-type option: Cannot find option named 'xxx'!", test_config.command_output) + return is_sub_string("--report-type option: Cannot find option named 'xxx'!", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-report-type/do_test.py b/behavior_tests/src/ngt-report-type/do_test.py index eade7e3fe..924c0fb3d 100644 --- a/behavior_tests/src/ngt-report-type/do_test.py +++ b/behavior_tests/src/ngt-report-type/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-type=abc") - return is_sub_string("--report-type option: Cannot find option named", test_config.command_output) + return is_sub_string("--report-type option: Cannot find option named", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py index c8a488843..51b535b6a 100644 --- a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py +++ b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu -report-format=csv -report-file-prefix=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ --cuda-include-path=" + test_config.include_path ) - return is_sub_string("Prefix is too long", test_config.command_output) + return is_sub_string("Prefix is too long", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py index 4107aefc3..6a875299e 100644 --- a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py +++ b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py @@ -13,19 +13,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess("mkdir ./read_only_folder") call_subprocess("chmod 0444 ./read_only_folder") call_subprocess(test_config.CT_TOOL + " simple_foo.cu --out-root=./read_only_folder --cuda-include-path=" + test_config.include_path) - return is_sub_string("Unable to save the output to the specified directory", test_config.command_output) -def build_test(): + return is_sub_string("Unable to save the output to the specified directory", single_case_text.command_text) +def build_test(single_case_text): call_subprocess("rm -rf ./read_only_folder") call_subprocess("chmod 0777 ./read_only_folder") return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-show-help/do_test.py b/behavior_tests/src/ngt-show-help/do_test.py index d6b4fafc1..9e8c45d56 100644 --- a/behavior_tests/src/ngt-show-help/do_test.py +++ b/behavior_tests/src/ngt-show-help/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL) - return is_sub_string("To get help on the tool usage", test_config.command_output) + return is_sub_string("To get help on the tool usage", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py index 35c2fa19b..69fba4381 100644 --- a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py +++ b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path ) - return is_sub_string("Error: The option --process-all requires that the", test_config.command_output) + return is_sub_string("Error: The option --process-all requires that the", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py index b89fda679..500be8d16 100644 --- a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py +++ b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --stop-on-parse-err vector_add.cu") - return is_sub_string("Cannot parse input", test_config.command_output) + return is_sub_string("Cannot parse input", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings1/do_test.py b/behavior_tests/src/ngt-suppress-warnings1/do_test.py index acd2c2b94..b6f1f0437 100644 --- a/behavior_tests/src/ngt-suppress-warnings1/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings1/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=100e") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings10/do_test.py b/behavior_tests/src/ngt-suppress-warnings10/do_test.py index 8f5b1f7be..a2a53e193 100644 --- a/behavior_tests/src/ngt-suppress-warnings10/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings10/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1000-1900") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings11/do_test.py b/behavior_tests/src/ngt-suppress-warnings11/do_test.py index 2b5a25d21..f284bb16a 100644 --- a/behavior_tests/src/ngt-suppress-warnings11/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings11/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1010-1020-1023") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings2/do_test.py b/behavior_tests/src/ngt-suppress-warnings2/do_test.py index faccc31a6..71c54d42b 100644 --- a/behavior_tests/src/ngt-suppress-warnings2/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings2/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess( test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ " --suppress-warnings=999") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings3/do_test.py b/behavior_tests/src/ngt-suppress-warnings3/do_test.py index b27ab0f00..81d660b00 100644 --- a/behavior_tests/src/ngt-suppress-warnings3/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings3/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1900") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings4/do_test.py b/behavior_tests/src/ngt-suppress-warnings4/do_test.py index f4cc1d178..80e483d90 100644 --- a/behavior_tests/src/ngt-suppress-warnings4/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings4/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=-1000") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings5/do_test.py b/behavior_tests/src/ngt-suppress-warnings5/do_test.py index 4382f43d4..3bb00ee6f 100644 --- a/behavior_tests/src/ngt-suppress-warnings5/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings5/do_test.py @@ -14,19 +14,19 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1000-") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings6/do_test.py b/behavior_tests/src/ngt-suppress-warnings6/do_test.py index 98ada803a..930f02591 100644 --- a/behavior_tests/src/ngt-suppress-warnings6/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings6/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=999-1023") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings7/do_test.py b/behavior_tests/src/ngt-suppress-warnings7/do_test.py index bdabdf19d..da77e1ee5 100644 --- a/behavior_tests/src/ngt-suppress-warnings7/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings7/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=100e-1023") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings8/do_test.py b/behavior_tests/src/ngt-suppress-warnings8/do_test.py index bdabdf19d..da77e1ee5 100644 --- a/behavior_tests/src/ngt-suppress-warnings8/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings8/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=100e-1023") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-suppress-warnings9/do_test.py b/behavior_tests/src/ngt-suppress-warnings9/do_test.py index 8198ffc04..1bdcf7b95 100644 --- a/behavior_tests/src/ngt-suppress-warnings9/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings9/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1010-1020-1023") - return is_sub_string("Invalid warning ID or range:", test_config.command_output) + return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py index 4b8ea2d96..147d0339a 100644 --- a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py +++ b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --use-dpcpp-extensions=abc") - return is_sub_string("Cannot find option named 'abc'", test_config.command_output) + return is_sub_string("Cannot find option named 'abc'", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-usm-leve/do_test.py b/behavior_tests/src/ngt-usm-leve/do_test.py index 86ebb2d2e..36b551ef4 100644 --- a/behavior_tests/src/ngt-usm-leve/do_test.py +++ b/behavior_tests/src/ngt-usm-leve/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --usm-leve=abc") - return is_sub_string("Unknown command line argument '--usm-leve=abc'", test_config.command_output) + return is_sub_string("Unknown command line argument '--usm-leve=abc'", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-usm-level/do_test.py b/behavior_tests/src/ngt-usm-level/do_test.py index ac878950f..4d253ac22 100644 --- a/behavior_tests/src/ngt-usm-level/do_test.py +++ b/behavior_tests/src/ngt-usm-level/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ " --usm-level=abc") - return is_sub_string("--usm-level option: Cannot find option named 'abc'", test_config.command_output) + return is_sub_string("--usm-level option: Cannot find option named 'abc'", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py index d768ed26a..c72dd6b3f 100644 --- a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py @@ -14,17 +14,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --vcxprojfile=aaa.vcxproj --cuda-include-path=" + test_config.include_path) - return is_sub_string("Cannot Open VcxprojFile", test_config.command_output) + return is_sub_string("Cannot Open VcxprojFile", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py index 50e7f9dcb..57d92e087 100644 --- a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess("icacls ./source /deny Everyone\:\(WD\)") @@ -25,10 +25,10 @@ def migrate_test(): source_path = os.path.join(os.getcwd(), "source", "simple_foo.cu") call_subprocess(test_config.CT_TOOL + " " + source_path + " --vcxprojfile=\"" + vcxproj_path + "\" --cuda-include-path=" + test_config.include_path) call_subprocess("icacls ./source /grant Everyone\:\(WD\)") - return is_sub_string("Cannot create CompilationDatabase", test_config.command_output) + return is_sub_string("Cannot create CompilationDatabase", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py index 931e51d46..8f6018de9 100644 --- a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"]) migrated_yaml = os.path.join("out", "hello.h.yaml") @@ -30,14 +30,14 @@ def migrate_test(): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"]) - if "differnt path" in test_config.command_output: + if "differnt path" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") return False -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/ngti-cdb-path-len/do_test.py b/behavior_tests/src/ngti-cdb-path-len/do_test.py index ebb534b77..8bb39a56f 100644 --- a/behavior_tests/src/ngti-cdb-path-len/do_test.py +++ b/behavior_tests/src/ngti-cdb-path-len/do_test.py @@ -13,11 +13,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): max_len = 511 if (platform.system() == 'Windows'): max_len = 32 @@ -28,10 +28,10 @@ def migrate_test(): os.path.join(long_path, "name") call_subprocess("intercept-build --cdb " + long_path) - return is_sub_string("File name", test_config.command_output) + return is_sub_string("File name", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngti-empty-make/do_test.py b/behavior_tests/src/ngti-empty-make/do_test.py index 291ae9c42..f5587ad06 100644 --- a/behavior_tests/src/ngti-empty-make/do_test.py +++ b/behavior_tests/src/ngti-empty-make/do_test.py @@ -13,16 +13,16 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess("intercept-build make") - return is_sub_string("No targets", test_config.command_output) + return is_sub_string("No targets", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/ngtn-database-fail/do_test.py b/behavior_tests/src/ngtn-database-fail/do_test.py index 4a225f5a1..1e7990926 100644 --- a/behavior_tests/src/ngtn-database-fail/do_test.py +++ b/behavior_tests/src/ngtn-database-fail/do_test.py @@ -14,18 +14,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " -p=. -in-root=./ -out-root=out") - return is_sub_string("Cannot parse compilation database", test_config.command_output) + return is_sub_string("Cannot parse compilation database", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/nominmax_bd/do_test.py b/behavior_tests/src/nominmax_bd/do_test.py index 8b6208ec8..7159ca6b7 100644 --- a/behavior_tests/src/nominmax_bd/do_test.py +++ b/behavior_tests/src/nominmax_bd/do_test.py @@ -13,17 +13,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): return True -def build_test(): +def build_test(single_case_text): srcs = [] srcs.append(os.path.join("sycl", "hello.cpp")) - return compile_and_link(srcs) + return compile_and_link(srcs, single_case_text) -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter - return run_binary_with_args() \ No newline at end of file + return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/open-source-mkl-compile/do_test.py b/behavior_tests/src/open-source-mkl-compile/do_test.py index cdfd75e7a..f549865c5 100644 --- a/behavior_tests/src/open-source-mkl-compile/do_test.py +++ b/behavior_tests/src/open-source-mkl-compile/do_test.py @@ -11,26 +11,26 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): print("ONEMKLROOT =", end = " ") print(os.environ["ONEMKLROOT"]) if not os.path.exists(os.environ["ONEMKLROOT"] + "/include"): print("The path '${ONEMKLROOT}/include' is not exist!") return False - change_dir(test_config.current_test) + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): return True -def build_test(): +def build_test(single_case_text): cmp_opts = ["-I${ONEMKLROOT}/include"] ret = False - ret = compile_files(["main.dp.cpp"], cmp_opts) + ret = compile_files(["main.dp.cpp"], single_case_text, cmp_opts) return ret -def run_test(): +def run_test(single_case_text): return True diff --git a/behavior_tests/src/path_validation_0/do_test.py b/behavior_tests/src/path_validation_0/do_test.py index 76b74c92c..abd66ea0c 100644 --- a/behavior_tests/src/path_validation_0/do_test.py +++ b/behavior_tests/src/path_validation_0/do_test.py @@ -13,20 +13,20 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): - change_dir("helloworld") +def migrate_test(single_case_text): + change_dir("helloworld", single_case_text) call_subprocess("intercept-build /usr/bin/make") - change_dir("..") + change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst") call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path) - return is_sub_string("is not under the specified input root directory", test_config.command_output) + return is_sub_string("is not under the specified input root directory", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/path_validation_1/do_test.py b/behavior_tests/src/path_validation_1/do_test.py index a46706c6f..7ee1fb48b 100644 --- a/behavior_tests/src/path_validation_1/do_test.py +++ b/behavior_tests/src/path_validation_1/do_test.py @@ -13,20 +13,20 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): - change_dir("helloworld") +def migrate_test(single_case_text): + change_dir("helloworld", single_case_text) call_subprocess("intercept-build /usr/bin/make") - change_dir("..") + change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst") call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/rootdir/../test.cu --cuda-include-path=" + test_config.include_path) - return is_sub_string("is not under the specified input root directory", test_config.command_output) + return is_sub_string("is not under the specified input root directory", single_case_text.command_text) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/relative_path_test/do_test.py b/behavior_tests/src/relative_path_test/do_test.py index 81c7dabfd..e915eff48 100644 --- a/behavior_tests/src/relative_path_test/do_test.py +++ b/behavior_tests/src/relative_path_test/do_test.py @@ -13,18 +13,18 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): - change_dir("build") +def migrate_test(single_case_text): + change_dir("build", single_case_text) call_subprocess(test_config.CT_TOOL + " -in-root ../src -out-root ../sycl -p ./ --cuda-include-path=" + test_config.include_path) - change_dir("..") + change_dir("..", single_case_text) return os.path.exists(os.path.join("sycl", "kernel.dp.cpp")) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/sh-ct-1306/do_test.py b/behavior_tests/src/sh-ct-1306/do_test.py index 5364b2822..747a714fb 100644 --- a/behavior_tests/src/sh-ct-1306/do_test.py +++ b/behavior_tests/src/sh-ct-1306/do_test.py @@ -13,15 +13,15 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): os.environ["CUDA_INCLUDE_PATH"] = test_config.include_path return call_subprocess("/bin/bash sh-ct-1306.sh") -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/test_soft_link_folder/do_test.py b/behavior_tests/src/test_soft_link_folder/do_test.py index 7de2a15a1..d1680fe56 100644 --- a/behavior_tests/src/test_soft_link_folder/do_test.py +++ b/behavior_tests/src/test_soft_link_folder/do_test.py @@ -13,8 +13,8 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) prepare_soft_link_folder() return True @@ -22,15 +22,15 @@ def setup_test(): def prepare_soft_link_folder(): os.symlink("cuda_", "cuda") -def migrate_test(): +def migrate_test(single_case_text): src = [os.path.join("cuda", "test_soft_link_folder.cu")] in_root = "" extra_args = "" - return do_migrate(src, in_root, test_config.out_root, extra_args) + return do_migrate(src, in_root, single_case_text.out_root, single_case_text, extra_args) -def build_test(): +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/test_behavior.py b/behavior_tests/test_behavior.py index ba7e02205..4ed21a657 100644 --- a/behavior_tests/test_behavior.py +++ b/behavior_tests/test_behavior.py @@ -15,36 +15,36 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): +def migrate_test(single_case_text): src = [] extra_args = [] - in_root = os.path.join(os.getcwd(), test_config.current_test) - test_config.out_root = os.path.join(in_root, 'out_root') + in_root = os.path.join(os.getcwd(), single_case_text.name) + single_case_text.out_root = os.path.join(in_root, 'out_root') for dirpath, dirnames, filenames in os.walk(in_root): for filename in [f for f in filenames if re.match('.*(cu|cpp|c)$', f)]: src.append(os.path.abspath(os.path.join(dirpath, filename))) - return do_migrate(src, in_root, test_config.out_root, extra_args) + return do_migrate(src, in_root, single_case_text.out_root, single_case_text, extra_args) -def build_test(): - if (os.path.exists(test_config.current_test)): - os.chdir(test_config.current_test) +def build_test(single_case_text): + if (os.path.exists(single_case_text.name)): + os.chdir(single_case_text.name) srcs = [] cmp_opts = '' link_opts = '' objects = '' - for dirpath, dirnames, filenames in os.walk(test_config.out_root): + for dirpath, dirnames, filenames in os.walk(single_case_text.out_root): for filename in [f for f in filenames if re.match('.*(cpp|c)$', f)]: srcs.append(os.path.abspath(os.path.join(dirpath, filename))) ret = False - ret = compile_files(srcs, cmp_opts) + ret = compile_files(srcs, single_case_text, cmp_opts) return ret -def run_test(): +def run_test(single_case_text): return True diff --git a/features/feature_case/backprop/do_test.py b/features/feature_case/backprop/do_test.py index 52693f2af..6da89c25a 100644 --- a/features/feature_case/backprop/do_test.py +++ b/features/feature_case/backprop/do_test.py @@ -14,14 +14,14 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " -out-root=./ backprop.c --cuda-include-path=" + test_config.include_path + " --") - return is_sub_string("Migration not necessary; no CUDA code detected", test_config.command_output) -def build_test(): + return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.command_text) +def build_test(single_case_text): return True -def run_test(): +def run_test(single_case_text): return True \ No newline at end of file diff --git a/features/feature_case/cudnn_multiple_files/do_test.py b/features/feature_case/cudnn_multiple_files/do_test.py index d63cf2167..1650f0bb9 100644 --- a/features/feature_case/cudnn_multiple_files/do_test.py +++ b/features/feature_case/cudnn_multiple_files/do_test.py @@ -14,11 +14,11 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") @@ -28,7 +28,7 @@ def migrate_test(): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " multiple_main.cpp cudnn-scale.cu cudnn-sum.cu") return os.path.exists(os.path.join("dpct_output", "cudnn-scale.dp.cpp")) -def build_test(): +def build_test(single_case_text): srcs = [] objects = [] cmp_options = [] @@ -45,7 +45,7 @@ def build_test(): srcs.append(os.path.join("dpct_output", "multiple_main.cpp")) srcs.append(os.path.join("dpct_output", "cudnn-scale.dp.cpp")) srcs.append(os.path.join("dpct_output", "cudnn-sum.dp.cpp")) - return compile_and_link(srcs, cmp_options, objects, linkopt) + return compile_and_link(srcs, single_case_text, cmp_options, objects, linkopt) -def run_test(): - return call_subprocess(os.path.join(os.path.curdir, test_config.current_test + '.run ')) +def run_test(single_case_text): + return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run ')) diff --git a/features/feature_case/kernel_library/do_test.py b/features/feature_case/kernel_library/do_test.py index 36b5f0f57..ea8432561 100644 --- a/features/feature_case/kernel_library/do_test.py +++ b/features/feature_case/kernel_library/do_test.py @@ -14,17 +14,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " kernel_library.cpp jit.cu --extra-arg=--ptx") return os.path.exists(os.path.join("dpct_output", "kernel_library.cpp.dp.cpp")) -def build_test(): +def build_test(single_case_text): # make shared library if (platform.system() == 'Windows'): ret = call_subprocess("icpx -fsycl dpct_output/jit.dp.cpp -shared -o premade.ptx") @@ -36,6 +36,6 @@ def build_test(): srcs = [] srcs.append(os.path.join("dpct_output", "kernel_library.cpp.dp.cpp")) - return compile_and_link(srcs, linkopt=["-lstdc++fs"]) -def run_test(): - return call_subprocess(os.path.join(os.path.curdir, test_config.current_test + '.run ')) + return compile_and_link(srcs, single_case_text, linkopt=["-lstdc++fs"]) +def run_test(single_case_text): + return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run ')) diff --git a/features/feature_case/module/do_test.py b/features/feature_case/module/do_test.py index efe66ae5a..33fc34b86 100644 --- a/features/feature_case/module/do_test.py +++ b/features/feature_case/module/do_test.py @@ -14,17 +14,17 @@ from test_utils import * -def setup_test(): - change_dir(test_config.current_test) +def setup_test(single_case_text): + change_dir(single_case_text.name, single_case_text) return True -def migrate_test(): +def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " module-helper.cpp module-main.cu module-kernel.cu --extra-arg=--ptx") return os.path.exists(os.path.join("dpct_output", "module-kernel.dp.cpp")) -def build_test(): +def build_test(single_case_text): # make shared library if (platform.system() == 'Windows'): ret = call_subprocess("icpx -fsycl dpct_output/module-kernel.dp.cpp -shared -o module-kernel.dll") @@ -37,6 +37,6 @@ def build_test(): srcs = [] srcs.append(os.path.join("dpct_output", "module-helper.cpp")) srcs.append(os.path.join("dpct_output", "module-main.dp.cpp")) - return compile_and_link(srcs) -def run_test(): - return call_subprocess(os.path.join(os.path.curdir, test_config.current_test + '.run ')) + return compile_and_link(srcs, single_case_text) +def run_test(single_case_text): + return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run ')) diff --git a/features/test_feature.py b/features/test_feature.py index 710f22059..6d8055bc6 100644 --- a/features/test_feature.py +++ b/features/test_feature.py @@ -54,17 +54,17 @@ occupancy_calculation_exper = ['occupancy_calculation'] -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): +def migrate_test(single_case_text): src = [] extra_args = [] - in_root = os.path.join(os.getcwd(), test_config.current_test) - test_config.out_root = os.path.join(in_root, 'out_root') + in_root = os.path.join(os.getcwd(), single_case_text.name) + single_case_text.out_root = os.path.join(in_root, 'out_root') - if test_config.current_test == 'cufft_test': - return do_migrate([os.path.join(in_root, 'cufft_test.cu')], in_root, test_config.out_root, extra_args) + if single_case_text.name == 'cufft_test': + return do_migrate([os.path.join(in_root, 'cufft_test.cu')], in_root, single_case_text.out_root, single_case_text, extra_args) for dirpath, dirnames, filenames in os.walk(in_root): for filename in [f for f in filenames if re.match('.*(cu|cpp|c)$', f)]: @@ -75,23 +75,23 @@ def migrate_test(): math_extension_tests = ['math-ext-double', 'math-ext-float', 'math-ext-half', 'math-ext-half2', 'math-ext-simd'] - if test_config.current_test in nd_range_bar_exper: + if single_case_text.name in nd_range_bar_exper: src.append(' --use-experimental-features=nd_range_barrier ') - if test_config.current_test == "user_defined_rules": + if single_case_text.name == "user_defined_rules": src.append(' --rule-file=./user_defined_rules/rules.yaml') - if test_config.current_test in logical_group_exper: + if single_case_text.name in logical_group_exper: src.append(' --use-experimental-features=logical-group ') - if test_config.current_test == 'math_intel_specific': + if single_case_text.name == 'math_intel_specific': src.append(' --rule-file=./math_intel_specific/intel_specific_math.yaml') - if test_config.current_test in math_extension_tests: + if single_case_text.name in math_extension_tests: src.append(' --use-dpcpp-extensions=intel_device_math') - if test_config.current_test in occupancy_calculation_exper: + if single_case_text.name in occupancy_calculation_exper: src.append(' --use-experimental-features=occupancy-calculation ') - if test_config.current_test == 'feature_profiling': + if single_case_text.name == 'feature_profiling': src.append(' --enable-profiling ') - if test_config.current_test == 'sync_warp_p2': + if single_case_text.name == 'sync_warp_p2': src.append(' --use-experimental-features=masked-sub-group-operation ') - return do_migrate(src, in_root, test_config.out_root, extra_args) + return do_migrate(src, in_root, single_case_text.out_root, single_case_text, extra_args) def manual_fix_for_cufft_external_workspace(migrated_file): lines = [] @@ -120,9 +120,9 @@ def manual_fix_for_occupancy_calculation(migrated_file): for line in lines: out_f.write(line) -def build_test(): - if (os.path.exists(test_config.current_test)): - os.chdir(test_config.current_test) +def build_test(single_case_text): + if (os.path.exists(single_case_text.name)): + os.chdir(single_case_text.name) srcs = [] cmp_options = [] link_opts = [] @@ -139,53 +139,53 @@ def build_test(): 'cudnn-types', 'cudnn-version', 'cudnn-dropout' ] - if test_config.current_test in oneDPL_related: - cmp_options.append(prepare_oneDPL_specific_macro()) + if single_case_text.name in oneDPL_related: + cmp_options.append(prepare_oneDPL_specific_macro(single_case_text)) - if re.match('^cu.*', test_config.current_test): + if re.match('^cu.*', single_case_text.name): if platform.system() == 'Linux': link_opts = test_config.mkl_link_opt_lin else: link_opts = test_config.mkl_link_opt_win cmp_options.append("-DMKL_ILP64") - if test_config.current_test.startswith('ccl-test'): + if single_case_text.name.startswith('ccl-test'): link_opts.append('-lccl -lmpi') - for dirpath, dirnames, filenames in os.walk(test_config.out_root): + for dirpath, dirnames, filenames in os.walk(single_case_text.out_root): for filename in [f for f in filenames if re.match('.*(cpp|c)$', f)]: srcs.append(os.path.abspath(os.path.join(dirpath, filename))) if platform.system() == 'Linux': link_opts.append(' -lpthread ') - if test_config.current_test in oneDNN_related: + if single_case_text.name in oneDNN_related: if platform.system() == 'Linux': link_opts.append(' -ldnnl') else: link_opts.append(' dnnl.lib') ret = False - if (test_config.current_test == 'cufft-external-workspace'): + if (single_case_text.name == 'cufft-external-workspace'): manual_fix_for_cufft_external_workspace(srcs[0]) - if (test_config.current_test in occupancy_calculation_exper): + if (single_case_text.name in occupancy_calculation_exper): manual_fix_for_occupancy_calculation(srcs[0]) - if test_config.current_test == 'cufft_test': - ret = compile_and_link([os.path.join(test_config.out_root, 'cufft_test.dp.cpp')], cmp_options, objects, link_opts) - elif test_config.current_test in exec_tests: - ret = compile_and_link(srcs, cmp_options, objects, link_opts) - elif re.match('^cufft.*', test_config.current_test) and platform.system() == 'Linux': - ret = compile_and_link(srcs, cmp_options, objects, link_opts) + if single_case_text.name == 'cufft_test': + ret = compile_and_link([os.path.join(single_case_text.out_root, 'cufft_test.dp.cpp')], single_case_text, cmp_options, objects, link_opts) + elif single_case_text.name in exec_tests: + ret = compile_and_link(srcs, single_case_text, cmp_options, objects, link_opts) + elif re.match('^cufft.*', single_case_text.name) and platform.system() == 'Linux': + ret = compile_and_link(srcs, single_case_text, cmp_options, objects, link_opts) else: - ret = compile_files(srcs, cmp_options) + ret = compile_files(srcs, single_case_text, cmp_options) return ret -def run_test(): - if test_config.current_test not in exec_tests: +def run_test(single_case_text): + if single_case_text.name not in exec_tests: return True os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter os.environ['CL_CONFIG_CPU_EXPERIMENTAL_FP16']="1" - if test_config.current_test.startswith('ccl-test'): - return call_subprocess('mpirun -n 2 ' + os.path.join(os.path.curdir, test_config.current_test + '.run ')) - return run_binary_with_args() + if single_case_text.name.startswith('ccl-test'): + return call_subprocess('mpirun -n 2 ' + os.path.join(os.path.curdir, single_case_text.name + '.run '),single_case_text) + return run_binary_with_args(single_case_text) diff --git a/help_function/test_help.py b/help_function/test_help.py index 1ccb5db39..f7be8714c 100644 --- a/help_function/test_help.py +++ b/help_function/test_help.py @@ -15,16 +15,16 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): +def migrate_test(single_case_text): return True -def build_test(): - if (os.path.exists(test_config.current_test)): - os.chdir(test_config.current_test) - test_config.out_root = os.getcwd() +def build_test(single_case_text): + if (os.path.exists(single_case_text.name)): + os.chdir(single_case_text.name) + single_case_text.out_root = os.getcwd() lpthread_link_cases = ["devicemgr_multi_thread_aware", "memory_async_dpct_free", "blas_extension_api_usm", "blas_extension_api_buffer", "fft_utils_engine_buffer", "fft_utils_engine_usm", @@ -56,36 +56,36 @@ def build_test(): link_opts = [] objects = [] - if test_config.current_test in oneDPL_related: - cmp_opts.append(prepare_oneDPL_specific_macro()) - if test_config.current_test in lpthread_link_cases and platform.system() == "Linux": + if single_case_text.name in oneDPL_related: + cmp_opts.append(prepare_oneDPL_specific_macro(single_case_text)) + if single_case_text.name in lpthread_link_cases and platform.system() == "Linux": link_opts.append("-lpthread") - for dirpath, dirnames, filenames in os.walk(test_config.out_root): - srcs.append(os.path.abspath(os.path.join(dirpath, test_config.current_test + ".cpp"))) + for dirpath, dirnames, filenames in os.walk(single_case_text.out_root): + srcs.append(os.path.abspath(os.path.join(dirpath, single_case_text.name + ".cpp"))) ret = False - if test_config.current_test == "test_default_queue_2": + if single_case_text.name == "test_default_queue_2": srcs.append("test_default_queue_1.cpp") - if test_config.current_test == "kernel_function_lin": + if single_case_text.name == "kernel_function_lin": ret = call_subprocess(test_config.DPCXX_COM + " -shared -fPIC -o module.so kernel_module_lin.cpp") if not ret: print("kernel_function_lin created the shared lib failed.") return False - if test_config.current_test == "kernel_function_win": + if single_case_text.name == "kernel_function_win": ret = call_subprocess("icx-cl -fsycl /EHsc /LD kernel_module_win.cpp /link /OUT:module.dll") if not ret: print("kernel_function_win created the shared lib failed.") return False - if test_config.current_test in oneDNN_related: + if single_case_text.name in oneDNN_related: if platform.system() == 'Linux': link_opts.append(' -ldnnl') else: link_opts.append(' dnnl.lib') - if (test_config.current_test in blas_cases) or (test_config.current_test in fft_cases) or ( - test_config.current_test in lapack_cases) or (test_config.current_test in rng_cases) or ( - test_config.current_test in oneDNN_related) or (test_config.current_test in sparse_cases): + if (single_case_text.name in blas_cases) or (single_case_text.name in fft_cases) or ( + single_case_text.name in lapack_cases) or (single_case_text.name in rng_cases) or ( + single_case_text.name in oneDNN_related) or (single_case_text.name in sparse_cases): mkl_opts = [] if platform.system() == "Linux": mkl_opts = test_config.mkl_link_opt_lin @@ -94,23 +94,23 @@ def build_test(): link_opts += mkl_opts cmp_opts.append("-DMKL_ILP64") - if test_config.current_test == 'fft_utils_engine_buffer' or test_config.current_test == 'fft_utils_engine_usm': - ret = compile_and_link([os.path.join(test_config.out_root, 'cufft_test.dp.cpp')], cmp_opts, objects, link_opts) + if single_case_text.name == 'fft_utils_engine_buffer' or single_case_text.name == 'fft_utils_engine_usm': + ret = compile_and_link([os.path.join(single_case_text.out_root, 'cufft_test.dp.cpp')], single_case_text, cmp_opts, objects, link_opts) else: - ret = compile_and_link(srcs, cmp_opts, objects, link_opts) + ret = compile_and_link(srcs, single_case_text, cmp_opts, objects, link_opts) return ret -def run_test(): +def run_test(single_case_text): os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter args = [] - if test_config.current_test == "kernel_function_lin": + if single_case_text.name == "kernel_function_lin": args.append("./module.so") - if test_config.current_test == "kernel_function_win": + if single_case_text.name == "kernel_function_win": args.append("./module.dll") os.environ['CL_CONFIG_CPU_EXPERIMENTAL_FP16']="1" - ret = run_binary_with_args(args) - if test_config.current_test == "async_exception" and "Caught asynchronous SYCL exception" in test_config.command_output and "test_dpct_async_handler" in test_config.command_output: + ret = run_binary_with_args(single_case_text, args) + if single_case_text.name == "async_exception" and "Caught asynchronous SYCL exception" in single_case_text.command_text and "test_dpct_async_handler" in single_case_text.command_text: return True return ret diff --git a/regressions/test_regression.py b/regressions/test_regression.py index 39e5dcee1..c2b8aa0a1 100644 --- a/regressions/test_regression.py +++ b/regressions/test_regression.py @@ -17,56 +17,56 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): - if test_config.current_test in ["test-1399", "test-1247"]: - os.chdir(test_config.current_test) +def migrate_test(single_case_text): + if single_case_text.name in ["test-1399", "test-1247"]: + os.chdir(single_case_text.name) return call_subprocess("sh ./run.sh") src = [] extra_args = [] - in_root = os.path.join(os.getcwd(), test_config.current_test) + in_root = os.path.join(os.getcwd(), single_case_text.name) - test_config.out_root = os.path.join(in_root, 'out_root') + single_case_text.out_root = os.path.join(in_root, 'out_root') for dirpath, dirnames, filenames in os.walk(in_root): for filename in [f for f in filenames if re.match('.*(cu|cpp|c)$', f)]: src.append(os.path.abspath(os.path.join(dirpath, filename))) - return do_migrate(src, in_root, test_config.out_root, extra_args) + return do_migrate(src, in_root, single_case_text.out_root, single_case_text, extra_args) -def build_test(): - if test_config.current_test in ["test-1399", "test-1247"]: +def build_test(single_case_text): + if single_case_text.name in ["test-1399", "test-1247"]: return True - if (os.path.exists(test_config.current_test)): - os.chdir(test_config.current_test) + if (os.path.exists(single_case_text.name)): + os.chdir(single_case_text.name) srcs = [] cmp_opts = [] link_opts = [] objects = [] - for dirpath, dirnames, filenames in os.walk(test_config.out_root): + for dirpath, dirnames, filenames in os.walk(single_case_text.out_root): for filename in [f for f in filenames if re.match('.*(cpp|c)$', f)]: srcs.append(os.path.abspath(os.path.join(dirpath, filename))) mkl_related_cases = ["test-1585", "test-1554", "test-1765", "test-1766a", "test-1766b", \ "test-850a", "test-850b", "test-850c"] - if test_config.current_test in mkl_related_cases: + if single_case_text.name in mkl_related_cases: if platform.system() == 'Linux': link_opts = test_config.mkl_link_opt_lin else: link_opts = test_config.mkl_link_opt_win ret = False - ret = compile_and_link(srcs, cmp_opts, objects, link_opts) + ret = compile_and_link(srcs, single_case_text, cmp_opts, objects, link_opts) return ret -def run_test(): +def run_test(single_case_text): args = [] - if test_config.current_test in ["test-1399", "test-1247", "test-1662"]: + if single_case_text.name in ["test-1399", "test-1247", "test-1662"]: return True - if test_config.current_test == "test-1601": + if single_case_text.name == "test-1601": args.append("12 12 12") os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter - return run_binary_with_args(args) + return run_binary_with_args(single_case_text, args) diff --git a/run_test.py b/run_test.py index 6e8d1ee9e..795d5e533 100644 --- a/run_test.py +++ b/run_test.py @@ -24,6 +24,7 @@ from test_utils import * +import multiprocessing class suite_config: def __init__(self, suite_name, test_config_map, suite_deps_files): @@ -62,6 +63,21 @@ def __init__(self, case_name, test_dep_files, option_rule_list, platform_rule_li self.platform_rule_list = platform_rule_list self.split_group = split_group +class case_text: + def __init__(self, case_name, command_file = "", command_text = "", log_file = "", log_text = "", + result_file = "", result_text = "", print_text = ""): + self.name = case_name + self.command_file = command_file + self.command_text = command_text + self.log_file = log_file + self.log_text = log_text + self.result_file = result_file + self.result_text = result_text + self.print_text = print_text + self.test_status = "BADTEST" + self.out_root = "" + + def parse_suite_cfg(suite_name, root_path): xml_file = os.path.join(os.path.abspath(root_path), suite_name + ".xml") root = parse_xml_cfg_file(xml_file) @@ -156,40 +172,41 @@ def pop_module(workspace): sys.path.pop() return "" -def test_setup(test_driver_module, specific_module): +def test_setup(test_driver_module, specific_module, single_case_text): if not specific_module: - return test_driver_module.setup_test() + return test_driver_module.setup_test(single_case_text) elif hasattr(specific_module, "setup_test"): - return specific_module.setup_test() + return specific_module.setup_test(single_case_text) return True -def test_migrate(test_driver_module, specific_module): +def test_migrate(test_driver_module, specific_module, single_case_text): if not specific_module: - return test_driver_module.migrate_test() + return test_driver_module.migrate_test(single_case_text) elif hasattr(specific_module, "migrate_test"): - return specific_module.migrate_test() + return specific_module.migrate_test(single_case_text) return True -def test_build(test_driver_module, specific_module): +def test_build(test_driver_module, specific_module, single_case_text): if not specific_module: - return test_driver_module.build_test() + return test_driver_module.build_test(single_case_text) elif hasattr(specific_module, "build_test"): - return specific_module.build_test() + return specific_module.build_test(single_case_text) return True -def run_migrated_binary_test(test_driver_module, specific_module): +def run_migrated_binary_test(test_driver_module, specific_module, single_case_text): if not specific_module: - return test_driver_module.run_test() + return test_driver_module.run_test(single_case_text) elif hasattr(specific_module, "run_test"): - return specific_module.run_test() + return specific_module.run_test(single_case_text) return True # Execute the test driver to do the validation. -def run_test_driver(module): - with open(test_config.command_file, "a+") as f: - f.write("================= " + test_config.current_test + " ==================\n") - case_workspace = os.path.join(os.path.dirname(test_config.result_text), test_config.current_test) - test_config.test_status = "" +def run_test_driver(module, single_case_text): + # with open(test_config.command_file, "a+") as f: + # f.write("================= " + single_case_text.name + " ==================\n") + single_case_text.command_text += "================= " + single_case_text.name + " ==================\n" + case_workspace = os.path.join(os.path.dirname(single_case_text.result_text), single_case_text.name) + single_case_text.test_status = "" ret_val = True specific_module = "" @@ -199,37 +216,37 @@ def run_test_driver(module): built = False run = False - ret_val = test_setup(module, specific_module) + ret_val = test_setup(module, specific_module, single_case_text) if ret_val: - ret_val = test_migrate(module, specific_module) + ret_val = test_migrate(module, specific_module, single_case_text) migrated = True else: - test_config.test_status = "BADTEST" + single_case_text.test_status = "BADTEST" if ret_val: - ret_val = test_build(module, specific_module) + ret_val = test_build(module, specific_module, single_case_text) built = True elif migrated: - test_config.test_status = "MIGFAIL" + single_case_text.test_status = "MIGFAIL" if ret_val: - ret_val = run_migrated_binary_test(module, specific_module) + ret_val = run_migrated_binary_test(module, specific_module, single_case_text) run = True elif migrated and built: - test_config.test_status = "COMPFAIL" + single_case_text.test_status = "COMPFAIL" if migrated and built and run and ret_val: - test_config.test_status = "PASS" + single_case_text.test_status = "PASS" elif migrated and built and run: - test_config.test_status = "RUNFAIL" + single_case_text.test_status = "RUNFAIL" if is_registered_module(case_workspace): pop_module(case_workspace) - append_msg_to_file(test_config.result_text, test_config.current_test + " " + test_config.test_status + "\n") - append_msg_to_file(test_config.log_file, "------------------------------------------------------------------------\n\n" + \ - "=================== "+ test_config.current_test + " is " + test_config.test_status + " ======================\n ") - print_result(test_config.current_test, test_config.test_status, test_config.command_output) + single_case_text.result_text += single_case_text.name + " " + single_case_text.test_status + "\n" + single_case_text.log_text += "------------------------------------------------------------------------\n\n" + \ + "=================== "+ single_case_text.name + " is " + single_case_text.test_status + " ======================\n " + print_result(single_case_text) return ret_val # To do: if the API was enabled in CUDA 9.2 version but deprecated in the CUDA 11.4 version, @@ -273,14 +290,16 @@ def is_option_supported(option_rule_list): return False return True -def test_single_case(current_test, single_case_config, workspace, module, suite_root_path): - test_config.current_test = current_test +def test_single_case(current_test, single_case_config, workspace, suite_root_path, single_case_text): + module = import_test_driver(suite_root_path) if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list): - append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") + single_case_text.result_text += current_test + " Skip " + "\n" + # append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") return True if single_case_config.option_rule_list and not is_option_supported(single_case_config.option_rule_list): - append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") + single_case_text.result_text += current_test + " Skip " + "\n" + # append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") return True case_workspace = os.path.join(workspace, current_test) @@ -288,9 +307,9 @@ def test_single_case(current_test, single_case_config, workspace, module, suite_ os.makedirs(case_workspace) os.chdir(workspace) - test_config.log_file = os.path.join(workspace, current_test + ".lf") + # test_config.log_file = os.path.join(workspace, current_test + ".lf") copy_source_to_ws(single_case_config.test_dep_files, case_workspace, suite_root_path) - return run_test_driver(module) + return run_test_driver(module, single_case_text) def prepare_test_workspace(root_path, suite_name, opt, case = ""): suite_workspace = os.path.join(os.path.abspath(root_path), suite_name, opt) @@ -318,20 +337,46 @@ def get_gpu_split_test_suite(suite_cfg): elif test_config.backend_device not in test_config.support_double_gpu and not case_config.split_group: new_test_config_map[current_test] = case_config return new_test_config_map + +def record_msg_case(single_case_text): + if single_case_text.test_status is not "BADTEST": + append_msg_to_file(single_case_text.command_file, single_case_text.command_text) + ppend_msg_to_file(single_case_text.log_file, single_case_text.log_text) + append_msg_to_file(single_case_text.result_file, single_case_text.result_text) + print(single_case_text.print_text) + return + def test_suite(suite_root_path, suite_name, opt): test_ws_root = os.path.join(os.path.dirname(suite_root_path), "test_workspace") # module means the test driver for a test suite. - module = import_test_driver(suite_root_path) test_config.suite_cfg = parse_suite_cfg(suite_name, suite_root_path) test_workspace = prepare_test_workspace(test_ws_root, suite_name, opt) suite_result = True failed_cases = [] + command_data = "" test_config.suite_cfg.test_config_map = get_gpu_split_test_suite(test_config.suite_cfg) - for current_test, single_case_config in test_config.suite_cfg.test_config_map.items(): - ret = test_single_case(current_test, single_case_config, test_workspace, module, suite_root_path) - if not ret: - failed_cases.append(current_test + " " + test_config.test_status) - suite_result = ret & suite_result + # Enable multi process + with multiprocessing.Pool(processes= int(multiprocessing.cpu_count() * 0.8)) as pool: + results = [] + + for current_test, single_case_config in test_config.suite_cfg.test_config_map.items(): + single_case_text = case_text(current_test, os.path.join(test_workspace, "command.tst"),"", + os.path.join(test_workspace, current_test, current_test + ".lf"), "", + os.path.join(test_workspace, "result.md"), "", "") + result = pool.apply_async(test_single_case, (current_test, single_case_config, test_workspace, + suite_root_path, single_case_text,)) + # store all msg + results.append([result, current_test, single_case_config, test_workspace, suite_root_path, single_case_text]) + # ret = test_single_case(current_test, single_case_config, test_workspace, module, suite_root_path) + + for result_iter in results: + ret = result_iter[0].get() + record_msg_case(result_iter[5]) + if not ret: + # TODO we can add auto rerun + failed_cases.append(current_test + " " + result_iter[5].test_status) + suite_result = ret & suite_result + if failed_cases: print("===============Failed case(s) ==========================") for case in failed_cases: @@ -341,15 +386,31 @@ def test_suite(suite_root_path, suite_name, opt): def test_single_case_in_suite(suite_root_path, suite_name, case, option): test_ws_root = os.path.join(os.path.dirname(suite_root_path), "test_workspace") - module = import_test_driver(suite_root_path) - test_config.suite_cfg = parse_suite_cfg(suite_name, suite_root_path) + suite_cfg = parse_suite_cfg(suite_name, suite_root_path) test_workspace = prepare_test_workspace(test_ws_root, suite_name, option, case) config_running_device(option) - if case not in test_config.suite_cfg.test_config_map.keys(): + if case not in suite_cfg.test_config_map.keys(): exit("The test case " + case + " is not in the " + suite_name + " test suite! Please double check.") - single_case_config = test_config.suite_cfg.test_config_map[case] - return test_single_case(case, single_case_config, test_workspace, module, suite_root_path) + single_case_config = suite_cfg.test_config_map[case] + # create single_case_text to store result msg + single_case_text = case_text(case, os.path.join(test_workspace, "command.tst"),"", + os.path.join(test_workspace, case, case + ".lf"), "", + os.path.join(test_workspace, "result.md"), "", "") + ret = test_single_case(case, single_case_config, test_workspace, suite_root_path, single_case_text) + # print(single_case_text.name) + # print(single_case_text.command_file) + # print(single_case_text.command_text) + # print(single_case_text.log_file) + # print(single_case_text.log_text) + # print(single_case_text.result_file) + # print(single_case_text.result_text) + # print(single_case_text.print_text) + # print(single_case_text.test_status) + # print(single_case_text.out_root) + record_msg_case(single_case_text) + return ret + # Before run the test: # 1. Please specify the CUDA header files with CUDA_INCLUDE_PATH environment variable. @@ -382,15 +443,15 @@ def import_test_driver(suite_folder): test_config.test_driver = str(test_driver.get("driverID")) return importlib.import_module(test_config.test_driver) -def clean_global_setting(): - test_config.current_test = "" - test_config.command_file = "" # Used to store the executed command. - test_config.log_file = "" # Used to store the executed log for each case. - test_config.result_text = "" # Used to store the executed status for each case. - test_config.out_root = "" - test_config.subprocess_stdout_log = "" - test_config.test_status = "" # Default: "SKIPPED" - test_config.test_driver = "" +# def clean_global_setting(): +# single_case_text.name = "" +# test_config.command_file = "" # Used to store the executed command. +# test_config.log_file = "" # Used to store the executed log for each case. +# test_config.result_text = "" # Used to store the executed status for each case. +# single_case_text.out_root = "" +# test_config.subprocess_stdout_log = "" +# test_config.test_status = "" # Default: "SKIPPED" +# test_config.test_driver = "" # Parse the test suite configuration file and get the supported suite list. def get_suite_list(): @@ -429,7 +490,7 @@ def test_suite_with_opts(suite_root_path, suite_name, opts): def test_full_suite_list(suite_list): ret = True for suite_name in suite_list: - clean_global_setting() + # clean_global_setting() os.chdir(test_config.root_path) suite_root_path = suite_list[suite_name][0] if os.path.exists(suite_root_path): diff --git a/samples/test_samples.py b/samples/test_samples.py index 3d8f0e6e0..b9d3f3faa 100644 --- a/samples/test_samples.py +++ b/samples/test_samples.py @@ -15,37 +15,37 @@ sys.path.append(parent) from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): +def migrate_test(single_case_text): src = [] extra_args = [] - in_root = os.path.join(os.getcwd(), test_config.current_test) - test_config.out_root = os.path.join(in_root, 'out_root') + in_root = os.path.join(os.getcwd(), single_case_text.name) + single_case_text.out_root = os.path.join(in_root, 'out_root') for dirpath, dirnames, filenames in os.walk(in_root): for filename in [f for f in filenames if re.match('.*(cu|cpp|c)$', f)]: src.append(os.path.abspath(os.path.join(dirpath, filename))) - return do_migrate(src, in_root, test_config.out_root, extra_args) + return do_migrate(src, in_root, single_case_text.out_root, single_case_text, extra_args) -def build_test(): - if (os.path.exists(test_config.current_test)): - os.chdir(test_config.current_test) +def build_test(single_case_text): + if (os.path.exists(single_case_text.name)): + os.chdir(single_case_text.name) srcs = [] cmp_opts = [] link_opts = '' objects = '' - for dirpath, dirnames, filenames in os.walk(test_config.out_root): + for dirpath, dirnames, filenames in os.walk(single_case_text.out_root): for filename in [f for f in filenames if re.match('.*(cpp|c)$', f)]: srcs.append(os.path.abspath(os.path.join(dirpath, filename))) ret = False - ret = compile_and_link(srcs, cmp_opts) + ret = compile_and_link(srcs, single_case_text, cmp_opts) return ret -def run_test(): +def run_test(single_case_text): os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter - return run_binary_with_args() + return run_binary_with_args(single_case_text) diff --git a/test_config.py b/test_config.py index 394b19dec..59b1195f0 100644 --- a/test_config.py +++ b/test_config.py @@ -7,6 +7,7 @@ # # ===----------------------------------------------------------------------===# +#Only high level config, global variable and static variable are reserved in test_config # The arguments DPCXX_COM = "" # Default compiler will set by set_default_compiler API call. CT_TOOL = "dpct" # The migration tool binary name @@ -15,22 +16,22 @@ VERBOSE_LEVEL = 0 # Debug verbose level: 0: silent all the debug information. None 0: turn on all the debug information. -current_test = "" # The name of current test. The test driver will automatically set a name for current test, if the current test is empty. -command_file = "" # Used to store the execution command. -log_file = "" # Default: /[test name].lf -result_text = "" # Default: /result.md +# current_test = "" # The name of current test. The test driver will automatically set a name for current test, if the current test is empty. +# command_file = "" # Used to store the execution command. +# log_file = "" # Default: /[test name].lf +# result_text = "" # Default: /result.md include_path = "" # Specify the CUDA header file path. -out_root = "" -command_output = "" +# out_root = "" +# command_output = "" cuda_ver = 0 # CUDA header file version. -test_status = "" # the test case execution status: MIGFAIL, COMPFAIL, RUNFAIL, SKIPPED or PASS. -test_option = "" # Ref the option_mapping.json file table. -failed_message = "" -test_driver = "" -suite_cfg = "" # Parsed from .xml. +# test_status = "" # the test case execution status: MIGFAIL, COMPFAIL, RUNFAIL, SKIPPED or PASS. +# test_option = "" # Ref the option_mapping.json file table. +# failed_message = "" +# test_driver = "" +# suite_cfg = "" # Parsed from .xml. migrate_option = "" -workspace = "" +# workspace = "" option_map = "" # Option mapping table. Ref: option_mapping.json root_path = "" # The root path of test repo. timeout = 1200 # The time limit for each test case. diff --git a/test_utils.py b/test_utils.py index e043e1e3e..460e41e95 100644 --- a/test_utils.py +++ b/test_utils.py @@ -25,10 +25,11 @@ # Call subprocess to run migration, build and test binary. Store the command and execution result to # command.tst and result.md. -def call_subprocess(cmd): - with open(test_config.command_file, 'a+') as f: - f.write(cmd + "\n") - with open(test_config.log_file, 'a+') as f: +def call_subprocess(cmd, single_case_text): + # with open(test_config.command_file, 'a+') as f: + # f.write(cmd + "\n") + single_case_text.command_text += cmd + "\n" + with open(single_case_text.log_file, 'a+') as f: try: run_on_shell = False if (platform.system() == 'Linux'): @@ -36,7 +37,7 @@ def call_subprocess(cmd): complete_process = subprocess.run(cmd, shell=run_on_shell, check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding="utf-8", timeout=test_config.timeout) - test_config.command_output = complete_process.stdout + single_case_text.command_output = complete_process.stdout f.write(complete_process.stdout) except subprocess.TimeoutExpired: f.write("========= Execution time out(" + str(test_config.timeout) + "s) Please check. ======") @@ -45,11 +46,12 @@ def call_subprocess(cmd): return False return True -def change_dir(dir): +def change_dir(dir, single_case_text): cmd = "cd " + dir - with open(test_config.command_file, 'a+') as f: - f.write(cmd + "\n") + # with open(test_config.command_file, 'a+') as f: + # f.write(cmd + "\n") + single_case_text.command_text += cmd + "\n" if os.path.exists(dir): os.chdir(dir) return True @@ -70,14 +72,14 @@ def print_debug_log(desc, *args): print(arg) print('\n') -def compile_files(srcs, cmpopts = []): +def compile_files(srcs, single_case_text,cmpopts = []): ret = True base_cmd = test_config.DPCXX_COM + " -c " if (platform.system() == 'Windows'): base_cmd += " /EHsc -DNOMINMAX " for src in srcs: cmd = base_cmd + src + ' ' + ' '.join(cmpopts) - ret = call_subprocess(cmd) and ret + ret = call_subprocess(cmd, single_case_text) and ret return ret def prepare_obj_name(src): @@ -88,8 +90,8 @@ def prepare_obj_name(src): obj_name[-1] = suffix return '.'.join(obj_name) -def compile_and_link(srcs, cmpopts = [], objects = [], linkopt = []): - if not compile_files(srcs, cmpopts): +def compile_and_link(srcs, single_case_text,cmpopts = [], objects = [], linkopt = []): + if not compile_files(srcs, single_case_text, cmpopts): return False obj_files = [] for src in srcs: @@ -97,13 +99,13 @@ def compile_and_link(srcs, cmpopts = [], objects = [], linkopt = []): if new_obj not in obj_files: obj_files.append(new_obj) cmd = test_config.DPCXX_COM + ' ' + ' '.join(obj_files) + ' ' + \ - ' '.join(linkopt) + ' ' + ' '.join(objects) + ' -o ' + test_config.current_test + '.run' - return call_subprocess(cmd) + ' '.join(linkopt) + ' ' + ' '.join(objects) + ' -o ' + single_case_text.name + '.run' + return call_subprocess(cmd, single_case_text) -def run_binary_with_args(args = []): - cmd = os.path.join(os.path.curdir, test_config.current_test + '.run ') + ' '.join(args) - return call_subprocess(cmd) +def run_binary_with_args(single_case_text, args = []): + cmd = os.path.join(os.path.curdir, single_case_text.name+ '.run ') + ' '.join(args) + return call_subprocess(cmd, single_case_text) # Replace the ${testName} with the specific test name. @@ -117,7 +119,7 @@ def copy_source_to_ws(source_files, test_ws_path, suite_root_path): for file in source_files: print_debug_log("The file copied: ", file) if "${testName}" in file: - file.replace("${testName}", test_config.current_test) + file.replace("${testName}", single_case_text.name) file = os.path.join(suite_root_path, file) if os.path.isdir(file): distutils.dir_util.copy_tree(file, test_ws_path) @@ -125,13 +127,13 @@ def copy_source_to_ws(source_files, test_ws_path, suite_root_path): shutil.copy(file, test_ws_path) return -def prepare_oneDPL_specific_macro(): +def prepare_oneDPL_specific_macro(single_case_text): if (platform.system() == 'Windows'): return '' - call_subprocess('gcc -dumpversion') - if ('9' in test_config.command_output): + call_subprocess('gcc -dumpversion', single_case_text) + if ('9' in single_case_text.command_output): return "-DPSTL_USE_PARALLEL_POLICIES=0" - elif ('10' in test_config.command_output): + elif ('10' in single_case_text.command_output): return "-D_GLIBCXX_USE_TBB_PAR_BACKEND=0" return "" @@ -150,7 +152,7 @@ def append_msg_to_file(file_path, msg): f.write(msg) -def do_migrate(src, in_root, out_root, extra_args = []): +def do_migrate(src, in_root, out_root, single_case_text, extra_args = []): cmd = test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ ' ' + ' '.join(src) if in_root: @@ -162,10 +164,10 @@ def do_migrate(src, in_root, out_root, extra_args = []): cmd += ' --extra-arg=\" ' + arg + '\"' if test_config.migrate_option: cmd += ' ' + test_config.migrate_option - return call_subprocess(cmd) + return call_subprocess(cmd, single_case_text) -def check_migration_result(msg): - with open(test_config.log_file, 'a+') as f: +def check_migration_result(msg, single_case_text): + with open(single_case_text.log_file, 'a+') as f: if msg in f.read(): return True return False @@ -180,13 +182,15 @@ def is_registered_module(test_case_workspace): return False # Print the failed test result and details in the screen. -def print_result(case, status, details_log): - print("============= " + case + ": " + status + " ==================\n") - call_subprocess("sycl-ls") +def print_result(single_case_text): + print("============= " + single_case_text.name + ": " + + single_case_text.test_status + " ==================\n") + call_subprocess("sycl-ls", single_case_text) print("========== Device Runtime Info: ===============") - print(test_config.command_output) + print(single_case_text.command_output) print("=============================================\n") - print("----------------------------\n" + details_log + "\n----------------------\n") + print("----------------------------\n" + single_case_text.command_output + + "\n----------------------\n") def is_sub_string(substr, fullstr): if substr in fullstr: diff --git a/user_guide_samples/test_guide.py b/user_guide_samples/test_guide.py index 360816835..b95de44b3 100644 --- a/user_guide_samples/test_guide.py +++ b/user_guide_samples/test_guide.py @@ -15,21 +15,21 @@ from test_utils import * -def setup_test(): +def setup_test(single_case_text): return True -def migrate_test(): +def migrate_test(single_case_text): return True -def build_test(): +def build_test(single_case_text): return True -def run_test(): - change_dir(test_config.current_test) - test_driver = test_config.current_test + ".py" +def run_test(single_case_text): + change_dir(single_case_text.name, single_case_text) + test_driver = single_case_text.name + ".py" options = " \" \"" os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter call_subprocess("python " + test_driver + options) - if "case pass" in test_config.command_output: + if "case pass" in single_case_text.command_text: return True return False From 999916cb52b6b8257778be1fccf06d2c4ba357c7 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Mon, 3 Jul 2023 09:23:59 +0800 Subject: [PATCH 02/10] fix features run fail Signed-off-by: Ni, Wenhui --- behavior_tests/src/array_size_fold/do_test.py | 2 +- behavior_tests/src/bad_input_1/do_test.py | 2 +- .../src/bt-analysis-scope-path1/do_test.py | 6 +-- .../src/bt-analysis-scope-path2/do_test.py | 6 +-- .../src/bt-analysis-scope-path3/do_test.py | 2 +- .../src/bt-analysis-scope-path4/do_test.py | 2 +- behavior_tests/src/bt-autocomplete/do_test.py | 42 +++++++++---------- .../src/bt-cdb-default-out-folder/do_test.py | 2 +- .../bt-check-conflict-insertion/do_test.py | 4 +- .../bt-check-unexpected-message/do_test.py | 4 +- .../src/bt-check-warning1083/do_test.py | 2 +- behavior_tests/src/bt-comments/do_test.py | 2 +- .../do_test.py | 2 +- .../bt-extra-arg-comma-separate/do_test.py | 2 +- behavior_tests/src/bt-extra-arg/do_test.py | 2 +- behavior_tests/src/bt-format-range/do_test.py | 4 +- behavior_tests/src/bt-format-style/do_test.py | 6 +-- .../src/bt-gen-helper-function/do_test.py | 2 +- behavior_tests/src/bt-help/do_test.py | 2 +- .../bt-in-root-empty-process-all/do_test.py | 2 +- .../src/bt-invalid-cuda-version/do_test.py | 2 +- .../bt-kernel-function-limitation/do_test.py | 2 +- .../src/bt-language-warning/do_test.py | 2 +- .../src/bt-modified-yaml/do_test.py | 4 +- .../src/bt-multi-cuda-inc-path/do_test.py | 6 +-- behavior_tests/src/bt-output/do_test.py | 2 +- behavior_tests/src/bt-report-only/do_test.py | 2 +- .../src/bt-stop-on-parse-err/do_test.py | 2 +- .../src/bt-suppress-warnings-all/do_test.py | 2 +- .../src/bt-suppress-warnings/do_test.py | 2 +- behavior_tests/src/bt-tilde-path/do_test.py | 2 +- .../bt-unsupported-type-function/do_test.py | 2 +- .../src/bt-use-explicit-namespace1/do_test.py | 2 +- .../src/bt-use-explicit-namespace2/do_test.py | 2 +- .../src/bt-use-explicit-namespace3/do_test.py | 2 +- .../src/bt-use-explicit-namespace4/do_test.py | 2 +- .../src/bt-use-explicit-namespace5/do_test.py | 2 +- .../src/bt-use-explicit-namespace6/do_test.py | 2 +- behavior_tests/src/bt-version/do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 4 +- .../do_test.py | 4 +- .../do_test.py | 4 +- .../src/bt-yaml-without-ct-version/do_test.py | 2 +- .../src/cannot-acc-dir-in-db/do_test.py | 6 +-- .../src/change-filename-extension/do_test.py | 10 ++--- .../check-device-unsupport-aspect/do_test.py | 12 +++--- .../src/check-windows-version/do_test.py | 2 +- .../src/cl_compile_test_1/do_test.py | 6 +-- .../src/cmp_intercept_build/do_test.py | 2 +- .../src/cmps_cl_compile_test_1/do_test.py | 2 +- .../src/cmps_cl_compile_test_2/do_test.py | 2 +- .../src/cmps_cuda_compile_test_1/do_test.py | 2 +- .../src/cmps_cuda_compile_test_2/do_test.py | 2 +- behavior_tests/src/copy_all_files/do_test.py | 2 +- .../src/execute_from_bundle_root/do_test.py | 2 +- .../src/execute_from_cuda_path/do_test.py | 2 +- .../src/integer-overflow/do_test.py | 6 +-- behavior_tests/src/ngt-UDR-idx1/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx2/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx3/do_test.py | 2 +- behavior_tests/src/ngt-UDR-keyword/do_test.py | 2 +- behavior_tests/src/ngt-UDR-path/do_test.py | 2 +- .../src/ngt-analysis-scope-path1/do_test.py | 2 +- .../src/ngt-assume-nd-range-dim/do_test.py | 2 +- .../ngt-cannot-access-dir-in-db/do_test.py | 2 +- .../src/ngt-cannot-find-db/do_test.py | 2 +- .../src/ngt-check-cannot-parse/do_test.py | 2 +- .../src/ngt-database-notfound/do_test.py | 2 +- .../src/ngt-file-parsing-err/do_test.py | 2 +- .../src/ngt-format-range/do_test.py | 2 +- .../src/ngt-format-style/do_test.py | 2 +- behavior_tests/src/ngt-in-root-len/do_test.py | 2 +- .../src/ngt-in-root-path/do_test.py | 2 +- .../src/ngt-include-path-len/do_test.py | 2 +- .../ngt-inroot-contain-cuda-path/do_test.py | 2 +- .../ngt-invalid-cuda-include-path/do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../src/ngt-invalid-inroot/do_test.py | 2 +- .../src/ngt-invalid-inroot2/do_test.py | 2 +- .../src/ngt-invalid-inroot3/do_test.py | 2 +- .../src/ngt-invalid-json1/do_test.py | 2 +- .../src/ngt-invalid-json10/do_test.py | 2 +- .../src/ngt-invalid-json2/do_test.py | 2 +- .../src/ngt-invalid-json3/do_test.py | 2 +- .../src/ngt-invalid-json4/do_test.py | 2 +- .../src/ngt-invalid-json5/do_test.py | 2 +- .../src/ngt-invalid-json6/do_test.py | 2 +- .../src/ngt-invalid-json7/do_test.py | 2 +- .../src/ngt-invalid-json8/do_test.py | 2 +- .../src/ngt-invalid-json9/do_test.py | 2 +- .../ngt-invalid-yaml-for-format1/do_test.py | 2 +- .../ngt-invalid-yaml-for-format2/do_test.py | 2 +- .../ngt-invalid-yaml-for-format3/do_test.py | 2 +- .../ngt-invalid-yaml-for-format4/do_test.py | 2 +- .../ngt-invalid-yaml-for-header1/do_test.py | 4 +- .../ngt-invalid-yaml-for-header2/do_test.py | 4 +- .../ngt-invalid-yaml-for-header3/do_test.py | 4 +- .../ngt-invalid-yaml-for-header4/do_test.py | 4 +- .../src/ngt-level-verbosity/do_test.py | 2 +- .../src/ngt-no-db-specified/do_test.py | 2 +- .../src/ngt-no-explicit-inroot/do_test.py | 2 +- .../src/ngt-no-file-type/do_test.py | 2 +- .../src/ngt-no-source-name/do_test.py | 2 +- .../src/ngt-opt-parsing-err/do_test.py | 2 +- .../src/ngt-out-root-len/do_test.py | 2 +- .../src/ngt-output-access/do_test.py | 6 +-- .../src/ngt-output-create/do_test.py | 4 +- .../src/ngt-output-file-len/do_test.py | 2 +- .../src/ngt-output-not-empty/do_test.py | 2 +- .../src/ngt-output-verbosity/do_test.py | 2 +- .../src/ngt-report-file-len/do_test.py | 2 +- .../src/ngt-report-file-prefix/do_test.py | 2 +- .../src/ngt-report-file-prefix2/do_test.py | 2 +- .../src/ngt-report-format1/do_test.py | 2 +- .../src/ngt-report-format2/do_test.py | 2 +- .../src/ngt-report-type-diags/do_test.py | 2 +- behavior_tests/src/ngt-report-type/do_test.py | 2 +- .../src/ngt-rpt-prefix-too-long/do_test.py | 2 +- .../src/ngt-save-out-fail-lin/do_test.py | 10 ++--- behavior_tests/src/ngt-show-help/do_test.py | 2 +- .../src/ngt-skip-for-missing-cmd/do_test.py | 2 +- .../src/ngt-stop-on-parse-err/do_test.py | 2 +- .../src/ngt-suppress-warnings1/do_test.py | 2 +- .../src/ngt-suppress-warnings10/do_test.py | 2 +- .../src/ngt-suppress-warnings11/do_test.py | 2 +- .../src/ngt-suppress-warnings2/do_test.py | 2 +- .../src/ngt-suppress-warnings3/do_test.py | 2 +- .../src/ngt-suppress-warnings4/do_test.py | 2 +- .../src/ngt-suppress-warnings5/do_test.py | 2 +- .../src/ngt-suppress-warnings6/do_test.py | 2 +- .../src/ngt-suppress-warnings7/do_test.py | 2 +- .../src/ngt-suppress-warnings8/do_test.py | 2 +- .../src/ngt-suppress-warnings9/do_test.py | 2 +- .../src/ngt-use-dpcpp-extensions/do_test.py | 2 +- behavior_tests/src/ngt-usm-leve/do_test.py | 2 +- behavior_tests/src/ngt-usm-level/do_test.py | 2 +- .../src/ngt-vcxproj-does-not-exist/do_test.py | 2 +- .../src/ngt-vcxproj-to-db-fail/do_test.py | 6 +-- .../do_test.py | 4 +- .../src/ngti-cdb-path-len/do_test.py | 2 +- behavior_tests/src/ngti-empty-make/do_test.py | 2 +- .../src/ngtn-database-fail/do_test.py | 2 +- .../src/path_validation_0/do_test.py | 6 +-- .../src/path_validation_1/do_test.py | 6 +-- .../src/relative_path_test/do_test.py | 2 +- behavior_tests/src/sh-ct-1306/do_test.py | 2 +- features/feature_case/backprop/do_test.py | 2 +- .../cudnn_multiple_files/do_test.py | 8 ++-- .../feature_case/kernel_library/do_test.py | 8 ++-- features/feature_case/module/do_test.py | 8 ++-- help_function/test_help.py | 4 +- regressions/test_regression.py | 2 +- user_guide_samples/test_guide.py | 2 +- 157 files changed, 235 insertions(+), 235 deletions(-) diff --git a/behavior_tests/src/array_size_fold/do_test.py b/behavior_tests/src/array_size_fold/do_test.py index 03fb9b8d2..c798aeff5 100644 --- a/behavior_tests/src/array_size_fold/do_test.py +++ b/behavior_tests/src/array_size_fold/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess( - test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) + test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) with open(os.path.join("out", "test.dp.cpp"), 'r') as f: ret_str = f.read() diff --git a/behavior_tests/src/bad_input_1/do_test.py b/behavior_tests/src/bad_input_1/do_test.py index 52e46d24a..087f150c7 100644 --- a/behavior_tests/src/bad_input_1/do_test.py +++ b/behavior_tests/src/bad_input_1/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + - os.path.join("cuda", "migrate_nonbuilding_code.cu")) + os.path.join("cuda", "migrate_nonbuilding_code.cu"), single_case_text) return is_sub_string("unknown type name", single_case_text.command_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-analysis-scope-path1/do_test.py b/behavior_tests/src/bt-analysis-scope-path1/do_test.py index 285445309..0f218e7e5 100644 --- a/behavior_tests/src/bt-analysis-scope-path1/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path1/do_test.py @@ -28,14 +28,14 @@ def migrate_test(single_case_text): "cuda", "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" # migrate with implicit --analysis-scope-path which defaults to --in-root - call_subprocess(migrate_cmd) + call_subprocess(migrate_cmd, single_case_text) if (not os.path.exists( os.path.join("out", "call_device_func_outside.dp.cpp"))): return False shutil.rmtree("out") # migrate with specified --analysis-scope-path which equals --in-root - call_subprocess(migrate_cmd + " --analysis-scope-path=cuda") + call_subprocess(migrate_cmd + " --analysis-scope-path=cuda", single_case_text) if (not os.path.exists( os.path.join("out", "call_device_func_outside.dp.cpp"))): return False @@ -43,7 +43,7 @@ def migrate_test(single_case_text): # migrate with specified --analysis-scope-path which is the parent of --in-root call_subprocess(migrate_cmd + " --analysis-scope-path=" + - os.path.join("cuda", "..")) + os.path.join("cuda", ".."), single_case_text) if (not os.path.exists( os.path.join("out", "call_device_func_outside.dp.cpp"))): return False diff --git a/behavior_tests/src/bt-analysis-scope-path2/do_test.py b/behavior_tests/src/bt-analysis-scope-path2/do_test.py index a9c6a1a7e..bd6581022 100644 --- a/behavior_tests/src/bt-analysis-scope-path2/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path2/do_test.py @@ -34,20 +34,20 @@ def migrate_test(single_case_text): "cuda", "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" # migrate with implicit --analysis-scope-path which defaults to --in-root - call_subprocess(migrate_cmd) + call_subprocess(migrate_cmd, single_case_text) if (not os.path.exists( os.path.join("out", "call_device_func_outside.dp.cpp"))): return False # expect incremental migration with specified --analysis-scope-path which equals --in-root - call_subprocess(migrate_cmd + " --analysis-scope-path=cuda") + call_subprocess(migrate_cmd + " --analysis-scope-path=cuda", single_case_text) if (not os.path.exists( os.path.join("out", "call_device_func_outside.dp.cpp"))): return False # not expect incremental migration with specified --analysis-scope-path which is the parent of --in-root call_subprocess(migrate_cmd + " --analysis-scope-path=" + - os.path.join("cuda", "..")) + os.path.join("cuda", ".."), single_case_text) return is_sub_string( f"use the same option set as in previous migration: \"--analysis-scope-path=", single_case_text.command_text) diff --git a/behavior_tests/src/bt-analysis-scope-path3/do_test.py b/behavior_tests/src/bt-analysis-scope-path3/do_test.py index c9f680dde..5747255b6 100644 --- a/behavior_tests/src/bt-analysis-scope-path3/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path3/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" call_subprocess(migrate_cmd + " --analysis-scope-path=" + - os.path.join("cuda", "..")) + os.path.join("cuda", ".."), single_case_text) expected_files = [ os.path.join("out", "call_device_func_outside.dp.cpp"), ] diff --git a/behavior_tests/src/bt-analysis-scope-path4/do_test.py b/behavior_tests/src/bt-analysis-scope-path4/do_test.py index d40c9420e..34c89c145 100644 --- a/behavior_tests/src/bt-analysis-scope-path4/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path4/do_test.py @@ -33,7 +33,7 @@ def migrate_test(single_case_text): "cuda", "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" - call_subprocess(migrate_cmd + " --analysis-scope-path=cuda_symlink") + call_subprocess(migrate_cmd + " --analysis-scope-path=cuda_symlink", single_case_text) if (not os.path.exists( os.path.join("out", "call_device_func_outside.dp.cpp"))): return False diff --git a/behavior_tests/src/bt-autocomplete/do_test.py b/behavior_tests/src/bt-autocomplete/do_test.py index 8f28827ff..b3529fa3f 100644 --- a/behavior_tests/src/bt-autocomplete/do_test.py +++ b/behavior_tests/src/bt-autocomplete/do_test.py @@ -19,11 +19,11 @@ def setup_test(single_case_text): def migrate_test(single_case_text): res = True - call_subprocess(test_config.CT_TOOL + " --autocomplete=--gen-build") + call_subprocess(test_config.CT_TOOL + " --autocomplete=--gen-build", single_case_text) reference = '--gen-build-script\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-gen-build") + call_subprocess(test_config.CT_TOOL + " --autocomplete=-gen-build", single_case_text) reference = '-gen-build-script\n' res = res and (reference == single_case_text.command_text) @@ -31,56 +31,56 @@ def migrate_test(single_case_text): reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=#d") + call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=#d", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=#d") + call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=#d", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=") + call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=") + call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar##--enable-c") + call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar##--enable-c", single_case_text) reference = '--enable-ctad\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar###--format-range=#a") + call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar###--format-range=#a", single_case_text) reference = 'all\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file=") + call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file=", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file") + call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file", single_case_text) reference = '--rule-file\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-p=") + call_subprocess(test_config.CT_TOOL + " --autocomplete=-p=", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-p") + call_subprocess(test_config.CT_TOOL + " --autocomplete=-p", single_case_text) reference = '-p\n' + \ '-process-all\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,") + call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,", single_case_text) reference = 'cl,sycl,cl\n' + \ 'cl,sycl,dpct\n' + \ 'cl,sycl,none\n' + \ @@ -88,28 +88,28 @@ def migrate_test(single_case_text): 'cl,sycl,sycl-math\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,s") + call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,s", single_case_text) reference = 'cl,sycl,sycl\n' + \ 'cl,sycl,sycl-math\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=") + call_subprocess(test_config.CT_TOOL + " --autocomplete=", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=,") + call_subprocess(test_config.CT_TOOL + " --autocomplete=,", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete==") + call_subprocess(test_config.CT_TOOL + " --autocomplete==", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=,,") + call_subprocess(test_config.CT_TOOL + " --autocomplete=,,", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-") + call_subprocess(test_config.CT_TOOL + " --autocomplete=-", single_case_text) opts = ['--always-use-async-handler\n', '--analysis-scope-path\n', '--assume-nd-range-dim=\n', @@ -154,11 +154,11 @@ def migrate_test(single_case_text): for opt in opts: res = res and (opt in single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=##") + call_subprocess(test_config.CT_TOOL + " --autocomplete=##", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=#") + call_subprocess(test_config.CT_TOOL + " --autocomplete=#", single_case_text) reference = '\n' res = res and (reference == single_case_text.command_text) diff --git a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py index 365577197..9a81bd84b 100644 --- a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): in_root = "" extra_args = "" return call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + - "-p .") + "-p .", single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-check-conflict-insertion/do_test.py b/behavior_tests/src/bt-check-conflict-insertion/do_test.py index 35871857b..aea45ef3d 100644 --- a/behavior_tests/src/bt-check-conflict-insertion/do_test.py +++ b/behavior_tests/src/bt-check-conflict-insertion/do_test.py @@ -19,11 +19,11 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess("intercept-build /usr/bin/make") + call_subprocess("intercept-build /usr/bin/make", single_case_text) in_root = "" extra_args = "" call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + - "-p .") + "-p .", single_case_text) return False def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-check-unexpected-message/do_test.py b/behavior_tests/src/bt-check-unexpected-message/do_test.py index 2263e6286..de3e5dea2 100644 --- a/behavior_tests/src/bt-check-unexpected-message/do_test.py +++ b/behavior_tests/src/bt-check-unexpected-message/do_test.py @@ -18,11 +18,11 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path + " --extra-arg=-xc++") + call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path + " --extra-arg=-xc++", single_case_text) return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", single_case_text.command_text) def build_test(single_case_text): - return call_subprocess("icpx -fsycl out/test.dp.cpp") + return call_subprocess("icpx -fsycl out/test.dp.cpp", single_case_text) def run_test(single_case_text): return True \ No newline at end of file diff --git a/behavior_tests/src/bt-check-warning1083/do_test.py b/behavior_tests/src/bt-check-warning1083/do_test.py index a5713a46e..b1e370dbb 100644 --- a/behavior_tests/src/bt-check-warning1083/do_test.py +++ b/behavior_tests/src/bt-check-warning1083/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): ret_file = "" - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) ret = "" with open(os.path.join("out", "test.dp.cpp"), 'r') as f: ret = f.read() diff --git a/behavior_tests/src/bt-comments/do_test.py b/behavior_tests/src/bt-comments/do_test.py index 33950cff9..28fe93bfd 100644 --- a/behavior_tests/src/bt-comments/do_test.py +++ b/behavior_tests/src/bt-comments/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): ret_file = "" - call_subprocess(test_config.CT_TOOL + " --comments comments.cu --out-root=out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --comments comments.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) with open(os.path.join("out", "comments.dp.cpp"), 'r') as f: ret_file = f.read() return is_sub_string("//", ret_file) diff --git a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py index c479ce28f..8cb12d54e 100644 --- a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " -p=./ --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " -p=./ --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.command_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py b/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py index 4524ca816..8fa08c14b 100644 --- a/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py +++ b/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): return call_subprocess(test_config.CT_TOOL + " --extra-arg=-I\"" + os.path.dirname(__file__) + "/header1 "+",-I" + os.path.dirname(__file__) + "/header2\"" + - " --cuda-include-path=" + test_config.include_path + " test.cu") + " --cuda-include-path=" + test_config.include_path + " test.cu", single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-extra-arg/do_test.py b/behavior_tests/src/bt-extra-arg/do_test.py index 4995119c3..ed6e72850 100644 --- a/behavior_tests/src/bt-extra-arg/do_test.py +++ b/behavior_tests/src/bt-extra-arg/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - return (call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=" + test_config.include_path + "\" vector_add.cu") + return (call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=" + test_config.include_path + "\" vector_add.cu", single_case_text) and is_sub_string("Parsing", single_case_text.command_text) and is_sub_string("Analyzing", single_case_text.command_text) and is_sub_string("Migrating", single_case_text.command_text)) diff --git a/behavior_tests/src/bt-format-range/do_test.py b/behavior_tests/src/bt-format-range/do_test.py index d35a49a31..4f920607c 100644 --- a/behavior_tests/src/bt-format-range/do_test.py +++ b/behavior_tests/src/bt-format-range/do_test.py @@ -23,8 +23,8 @@ def migrate_test(single_case_text): os.mkdir("out_all") os.mkdir("out_none") call_subprocess(test_config.CT_TOOL + " --format-range=migrated --out-root=./out_migrated vector_add.cu --cuda-include-path=" + test_config.include_path) - call_subprocess(test_config.CT_TOOL + " --format-range=all --out-root=./out_all vector_add.cu --cuda-include-path=" + test_config.include_path) - call_subprocess(test_config.CT_TOOL + " -format-range=none --out-root=./out_none vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --format-range=all --out-root=./out_all vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(test_config.CT_TOOL + " -format-range=none --out-root=./out_none vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) ret = is_sub_string(";\/\/ variable declearation", "./out_llvm/vector_add.dp.cpp") ret = is_sub_string(";\/\/ allocate device memory", "./out_google/vector_add.dp.cpp") or ret diff --git a/behavior_tests/src/bt-format-style/do_test.py b/behavior_tests/src/bt-format-style/do_test.py index ef5b85578..437d9b96f 100644 --- a/behavior_tests/src/bt-format-style/do_test.py +++ b/behavior_tests/src/bt-format-style/do_test.py @@ -21,9 +21,9 @@ def migrate_test(single_case_text): os.mkdir("out_custom") os.mkdir("out_llvm") os.mkdir("out_google") - call_subprocess(test_config.CT_TOOL + " --format-style=custom --out-root=./out_custom vector_add.cu --cuda-include-path=" + test_config.include_path) - call_subprocess(test_config.CT_TOOL + " --format-style=llvm --out-root=./out_llvm vector_add.cu --cuda-include-path=" + test_config.include_path) - call_subprocess(test_config.CT_TOOL + " --format-style=google --out-root=./out_google vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --format-style=custom --out-root=./out_custom vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(test_config.CT_TOOL + " --format-style=llvm --out-root=./out_llvm vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(test_config.CT_TOOL + " --format-style=google --out-root=./out_google vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) ret = False with open(os.path.join("out_llvm", "vector_add.dp.cpp")) as f: file_str = f.read() diff --git a/behavior_tests/src/bt-gen-helper-function/do_test.py b/behavior_tests/src/bt-gen-helper-function/do_test.py index 89829cb1a..fdc2e8162 100644 --- a/behavior_tests/src/bt-gen-helper-function/do_test.py +++ b/behavior_tests/src/bt-gen-helper-function/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): ret_file = "" - ret = call_subprocess(test_config.CT_TOOL + " --gen-helper-function --out-root=out") + ret = call_subprocess(test_config.CT_TOOL + " --gen-helper-function --out-root=out", single_case_text) installed_header_file_root = os.path.join(os.path.dirname(get_ct_path()), "..", "include", "dpct") generated_header_file_root = os.path.join(os.getcwd(), "out", "include", "dpct") diff --git a/behavior_tests/src/bt-help/do_test.py b/behavior_tests/src/bt-help/do_test.py index 8b91f41b3..6c12e84e2 100644 --- a/behavior_tests/src/bt-help/do_test.py +++ b/behavior_tests/src/bt-help/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL +" --help") + call_subprocess(test_config.CT_TOOL +" --help", single_case_text) return is_sub_string("USAGE", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py index d57d4cbcd..99e1fbfde 100644 --- a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py +++ b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --process-all --cuda-include-path=" + test_config.include_path + " --in-root=") + call_subprocess(test_config.CT_TOOL + " --process-all --cuda-include-path=" + test_config.include_path + " --in-root=", single_case_text) return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-invalid-cuda-version/do_test.py b/behavior_tests/src/bt-invalid-cuda-version/do_test.py index af690c90a..a916d5040 100644 --- a/behavior_tests/src/bt-invalid-cuda-version/do_test.py +++ b/behavior_tests/src/bt-invalid-cuda-version/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): include_path = os.path.join(os.getcwd(), "include") in_root = os.getcwd() test_case_path = os.path.join(in_root, "vector_add.cu") - call_subprocess(test_config.CT_TOOL + " " + test_case_path + " --out-root=out --in-root=" + in_root + " --cuda-include-path=" + include_path) + call_subprocess(test_config.CT_TOOL + " " + test_case_path + " --out-root=out --in-root=" + in_root + " --cuda-include-path=" + include_path, single_case_text) return is_sub_string("Error: The version of CUDA header files specified by --cuda-include-path is not supported. See Release Notes for supported versions.", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-kernel-function-limitation/do_test.py b/behavior_tests/src/bt-kernel-function-limitation/do_test.py index 217d577d9..6482f5986 100644 --- a/behavior_tests/src/bt-kernel-function-limitation/do_test.py +++ b/behavior_tests/src/bt-kernel-function-limitation/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --optimize-migration --out-root=./out kernel-func.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --optimize-migration --out-root=./out kernel-func.cu --cuda-include-path=" + test_config.include_path, single_case_text) ret = is_sub_string("Recursive functions cannot be called in SYCL device code", single_case_text.command_text) ret = is_sub_string("Virtual functions cannot be called in SYCL device code", single_case_text.command_text) and ret diff --git a/behavior_tests/src/bt-language-warning/do_test.py b/behavior_tests/src/bt-language-warning/do_test.py index aa08281ea..2f2018927 100644 --- a/behavior_tests/src/bt-language-warning/do_test.py +++ b/behavior_tests/src/bt-language-warning/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cpp --out-root=out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cpp --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("NOTE: test.cpp is treated as a CUDA file by default. Use the --extra-arg=-xc++ option to treat test.cpp as a C++ file if needed.", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-modified-yaml/do_test.py b/behavior_tests/src/bt-modified-yaml/do_test.py index 2966d25da..d974c1c44 100644 --- a/behavior_tests/src/bt-modified-yaml/do_test.py +++ b/behavior_tests/src/bt-modified-yaml/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): test_file = os.path.join("out", "test.h") ret_str = "" ret = [] - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xc\" --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xc\" --cuda-include-path=" + test_config.include_path, single_case_text) if not os.path.exists(yml_file): return False with open(yml_file, 'r') as f: @@ -32,7 +32,7 @@ def migrate_test(single_case_text): ret.append(line) with open(yml_file, 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xcuda\" --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xcuda\" --cuda-include-path=" + test_config.include_path, single_case_text) with open(test_file, 'r') as f: ret_str = f.read() if ret_str.count("DPCT1056") == 1: diff --git a/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py b/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py index 6fbba454f..02392c56b 100644 --- a/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py +++ b/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py @@ -14,16 +14,16 @@ def setup_test(single_case_text): change_dir(single_case_text.name, single_case_text) - call_subprocess("cp -r --dereference " + test_config.include_path + " + .") + call_subprocess("cp -r --dereference " + test_config.include_path + " + .", single_case_text) change_dir("src", single_case_text) return True def migrate_test(single_case_text): command = test_config.CT_TOOL + " --out-root out test.cu --cuda-include-path ../include --extra-arg=\"-I" + test_config.include_path + "\"" print(command) - return call_subprocess(command) + return call_subprocess(command, single_case_text) def build_test(single_case_text): - return call_subprocess("icpx -fsycl out/test.dp.cpp") + return call_subprocess("icpx -fsycl out/test.dp.cpp", single_case_text) def run_test(single_case_text): return True diff --git a/behavior_tests/src/bt-output/do_test.py b/behavior_tests/src/bt-output/do_test.py index e2ed73b38..17b84e70b 100644 --- a/behavior_tests/src/bt-output/do_test.py +++ b/behavior_tests/src/bt-output/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - return call_subprocess(test_config.CT_TOOL + " hello.cu hello2.cu --cuda-include-path=" + test_config.include_path + " > output.txt") + return call_subprocess(test_config.CT_TOOL + " hello.cu hello2.cu --cuda-include-path=" + test_config.include_path + " > output.txt", single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-report-only/do_test.py b/behavior_tests/src/bt-report-only/do_test.py index 76de33154..1f3e58447 100644 --- a/behavior_tests/src/bt-report-only/do_test.py +++ b/behavior_tests/src/bt-report-only/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --report-only vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --report-only vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) if os.path.exists("out"): return False return True diff --git a/behavior_tests/src/bt-stop-on-parse-err/do_test.py b/behavior_tests/src/bt-stop-on-parse-err/do_test.py index c94528fe1..2df039bc3 100644 --- a/behavior_tests/src/bt-stop-on-parse-err/do_test.py +++ b/behavior_tests/src/bt-stop-on-parse-err/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --stop-on-parse-err vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --stop-on-parse-err vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) if os.path.exists(os.path.join("out", "vector_add.dp.cpp")): return False return True diff --git a/behavior_tests/src/bt-suppress-warnings-all/do_test.py b/behavior_tests/src/bt-suppress-warnings-all/do_test.py index d220d3c24..6739c6228 100644 --- a/behavior_tests/src/bt-suppress-warnings-all/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings-all/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --suppress-warnings-all vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --suppress-warnings-all vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return not is_sub_string("DPCT1015", single_case_text.command_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-suppress-warnings/do_test.py b/behavior_tests/src/bt-suppress-warnings/do_test.py index df7b3b828..fc5c378b6 100644 --- a/behavior_tests/src/bt-suppress-warnings/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " hello.cu --suppress-warnings=1000-1003,1008 --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " hello.cu --suppress-warnings=1000-1003,1008 --cuda-include-path=" + test_config.include_path, single_case_text) return not is_sub_string("warning: DPCT10", single_case_text.command_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-tilde-path/do_test.py b/behavior_tests/src/bt-tilde-path/do_test.py index 2a9b01bf0..fa5f24c2c 100644 --- a/behavior_tests/src/bt-tilde-path/do_test.py +++ b/behavior_tests/src/bt-tilde-path/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): shutil.rmtree(user_root_path) os.makedirs(user_root_path) distutils.dir_util.copy_tree(test_config.include_path + "/..", user_root_path) - return call_subprocess("dpct vector_add.cu --cuda-include-path=" + "~/workspace/include") + return call_subprocess("dpct vector_add.cu --cuda-include-path=" + "~/workspace/include", single_case_text) def build_test(single_case_text): global old_tilde diff --git a/behavior_tests/src/bt-unsupported-type-function/do_test.py b/behavior_tests/src/bt-unsupported-type-function/do_test.py index fa1ea4ecb..95b1d7dae 100644 --- a/behavior_tests/src/bt-unsupported-type-function/do_test.py +++ b/behavior_tests/src/bt-unsupported-type-function/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): migrated_file = os.path.join("out_nvml", "test.dp.cpp") - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=./out_nvml --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root=./out_nvml --cuda-include-path=" + test_config.include_path, single_case_text) warn_1007_count = 0 warn_1082_count = 0 with open(migrated_file, "r") as f: diff --git a/behavior_tests/src/bt-use-explicit-namespace1/do_test.py b/behavior_tests/src/bt-use-explicit-namespace1/do_test.py index a6c0d2453..450be4446 100644 --- a/behavior_tests/src/bt-use-explicit-namespace1/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace1/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return True def build_test(single_case_text): srcs = [] diff --git a/behavior_tests/src/bt-use-explicit-namespace2/do_test.py b/behavior_tests/src/bt-use-explicit-namespace2/do_test.py index cdaee0534..132117721 100644 --- a/behavior_tests/src/bt-use-explicit-namespace2/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) + ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] diff --git a/behavior_tests/src/bt-use-explicit-namespace3/do_test.py b/behavior_tests/src/bt-use-explicit-namespace3/do_test.py index 3d2f556b7..41c46c945 100644 --- a/behavior_tests/src/bt-use-explicit-namespace3/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace3/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) + ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] diff --git a/behavior_tests/src/bt-use-explicit-namespace4/do_test.py b/behavior_tests/src/bt-use-explicit-namespace4/do_test.py index a24b5a232..24feef615 100644 --- a/behavior_tests/src/bt-use-explicit-namespace4/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace4/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=cl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) + ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=cl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return ret def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-use-explicit-namespace5/do_test.py b/behavior_tests/src/bt-use-explicit-namespace5/do_test.py index 4df691156..a1e1ffa7c 100644 --- a/behavior_tests/src/bt-use-explicit-namespace5/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace5/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) + ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] diff --git a/behavior_tests/src/bt-use-explicit-namespace6/do_test.py b/behavior_tests/src/bt-use-explicit-namespace6/do_test.py index ce76f916b..e30cbbb01 100644 --- a/behavior_tests/src/bt-use-explicit-namespace6/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace6/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math,dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path) + ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math,dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] diff --git a/behavior_tests/src/bt-version/do_test.py b/behavior_tests/src/bt-version/do_test.py index e13fc2ac9..7915e997a 100644 --- a/behavior_tests/src/bt-version/do_test.py +++ b/behavior_tests/src/bt-version/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --version") + call_subprocess(test_config.CT_TOOL + " --version", single_case_text) ct_clang_version = get_ct_clang_version() expected_output = "dpct version {0}".format(ct_clang_version) print("expected dpct version output: {0}".format(expected_output)) diff --git a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py index 6fe09c395..49bfbd1ed 100644 --- a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py index 736dc0ade..caf76741f 100644 --- a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --in-root . --out-root out --always-use-async-handler --assume-nd-range-dim=1 --comments --enable-ctad --no-dpcpp-extensions=enqueued_barriers --no-dry-pattern --process-all -p . --sycl-named-lambda --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --usm-level=none --cuda-include-path=" + test_config.include_path) - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --in-root . --out-root out --always-use-async-handler --assume-nd-range-dim=1 --comments --enable-ctad --no-dpcpp-extensions=enqueued_barriers --no-dry-pattern --process-all -p . --sycl-named-lambda --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --usm-level=none --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("\"--analysis-scope-path=\"", single_case_text.command_text) and \ is_sub_string("--always-use-async-handler --comments --compilation-database=\"", single_case_text.command_text) and \ is_sub_string("--enable-ctad --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --no-dpcpp-extensions=enqueued_barriers --assume-nd-range-dim=1 --no-dry-pattern --process-all --sycl-named-lambda --usm-level=none\".", single_case_text.command_text) diff --git a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py index 0dca3c6ab..189f020ed 100644 --- a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-cl-namespace-inline --cuda-include-path=" + test_config.include_path) - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-cl-namespace-inline --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("--no-cl-namespace-inline\".", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-yaml-with-different-options3/do_test.py b/behavior_tests/src/bt-yaml-with-different-options3/do_test.py index 7d8d09ba8..965d6b0aa 100644 --- a/behavior_tests/src/bt-yaml-with-different-options3/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options3/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --usm-level=none --cuda-include-path=" + test_config.include_path) - return call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-incremental-migration --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --usm-level=none --cuda-include-path=" + test_config.include_path, single_case_text) + return call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-incremental-migration --cuda-include-path=" + test_config.include_path, single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py index 835b08862..01a89f89e 100644 --- a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Failed to load", single_case_text.command_text) and \ is_sub_string("Migration continues with incremental migration disabled", single_case_text.command_text) diff --git a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py index 7a1a0cb70..b98d6c501 100644 --- a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py +++ b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py @@ -18,12 +18,12 @@ def setup_test(single_case_text): def migrate_test(single_case_text): change_dir('cannot-acc-dir-in-db/helloworld', single_case_text) - call_subprocess('intercept-build /usr/bin/make') + call_subprocess('intercept-build /usr/bin/make', single_case_text) change_dir('..', single_case_text) - call_subprocess('mv helloworld helloworld_tst') + call_subprocess('mv helloworld helloworld_tst', single_case_text) call_subprocess(test_config.CT_TOOL + ' -p ./helloworld_tst/compile_commands.json --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) if 'check if the directory exists and can be accessed by the tool' in single_case_text.command_text: return True diff --git a/behavior_tests/src/change-filename-extension/do_test.py b/behavior_tests/src/change-filename-extension/do_test.py index 158455b79..261113ee1 100644 --- a/behavior_tests/src/change-filename-extension/do_test.py +++ b/behavior_tests/src/change-filename-extension/do_test.py @@ -21,30 +21,30 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess( - test_config.CT_TOOL + " -p=. --change-cuda-files-extension-only --out-root=out --cuda-include-path=" + test_config.include_path) + test_config.CT_TOOL + " -p=. --change-cuda-files-extension-only --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) print(single_case_text.command_text) reference = 'main.dp.cpp' - call_subprocess("ls out | grep " + reference) + call_subprocess("ls out | grep " + reference, single_case_text) res = True if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) reference = 'test.cpp' - call_subprocess("ls out | grep " + reference) + call_subprocess("ls out | grep " + reference, single_case_text) if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) reference = 'test.dp.hpp' - call_subprocess("ls out | grep " + reference) + call_subprocess("ls out | grep " + reference, single_case_text) if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) reference = 'test.h' - call_subprocess("ls out | grep " + reference) + call_subprocess("ls out | grep " + reference, single_case_text) if reference not in single_case_text.command_text: res = False print("there should be a file: " + reference) diff --git a/behavior_tests/src/check-device-unsupport-aspect/do_test.py b/behavior_tests/src/check-device-unsupport-aspect/do_test.py index 3cf6e760b..f4f994216 100644 --- a/behavior_tests/src/check-device-unsupport-aspect/do_test.py +++ b/behavior_tests/src/check-device-unsupport-aspect/do_test.py @@ -19,13 +19,13 @@ def setup_test(single_case_text): def migrate_test(single_case_text): res = True cmd = test_config.CT_TOOL + " --out-root=out double.cu --cuda-include-path=" + test_config.include_path - if not call_subprocess(cmd): + if not call_subprocess(cmd, single_case_text): res = False print("double.cu migrate failed") else: print("double.cu migrate pass") cmd = test_config.CT_TOOL + " --out-root=out half.cu --cuda-include-path=" + test_config.include_path - if not call_subprocess(cmd): + if not call_subprocess(cmd, single_case_text): res = False print("half.cu migrate failed") else: @@ -41,7 +41,7 @@ def build_test(single_case_text): else: print("double.dp.cpp compile pass") cmd = test_config.DPCXX_COM + ' ' + prepare_obj_name(os.path.join("out", "double.dp.cpp")) + " -o double.run" - if not call_subprocess(cmd): + if not call_subprocess(cmd, single_case_text): res = False print("double.dp.cpp link failed") else: @@ -52,7 +52,7 @@ def build_test(single_case_text): else: print("half.dp.cpp compile pass") cmd = test_config.DPCXX_COM + ' ' + prepare_obj_name(os.path.join("out", "half.dp.cpp")) + " -o half.run" - if not call_subprocess(cmd): + if not call_subprocess(cmd, single_case_text): res = False print("half.dp.cpp link failed") else: @@ -65,7 +65,7 @@ def run_test(single_case_text): res = 0 cmd = os.path.join(os.path.curdir, 'double.run') - if call_subprocess(cmd): + if call_subprocess(cmd, single_case_text): res += 1 print("double.run run pass") print("double.run output:") @@ -75,7 +75,7 @@ def run_test(single_case_text): return False cmd = os.path.join(os.path.curdir, 'half.run') - if call_subprocess(cmd): + if call_subprocess(cmd, single_case_text): res += 1 print("half.run run pass") print("half.run output:") diff --git a/behavior_tests/src/check-windows-version/do_test.py b/behavior_tests/src/check-windows-version/do_test.py index ab94b00dc..29a2c9dee 100644 --- a/behavior_tests/src/check-windows-version/do_test.py +++ b/behavior_tests/src/check-windows-version/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def get_windows_version(arg1, arg2): - call_subprocess("powershell \"(Get-Item -path " + arg1 + ").VersionInfo." + arg2 + "\"") + call_subprocess("powershell \"(Get-Item -path " + arg1 + ").VersionInfo." + arg2 + "\"", single_case_text) return single_case_text.command_text def migrate_test(single_case_text): diff --git a/behavior_tests/src/cl_compile_test_1/do_test.py b/behavior_tests/src/cl_compile_test_1/do_test.py index 3e2a61f39..cefdb3215 100644 --- a/behavior_tests/src/cl_compile_test_1/do_test.py +++ b/behavior_tests/src/cl_compile_test_1/do_test.py @@ -18,12 +18,12 @@ def setup_test(single_case_text): def migrate_test(single_case_text): change_dir('cannot-acc-dir-in-db/helloworld', single_case_text) - call_subprocess('intercept-build /usr/bin/make') + call_subprocess('intercept-build /usr/bin/make', single_case_text) change_dir('..', single_case_text) - call_subprocess('mv helloworld helloworld_tst') + call_subprocess('mv helloworld helloworld_tst', single_case_text) call_subprocess(test_config.CT_TOOL + ' helloworld_tst/src/test.cu --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) if 'check if the directory exists and can be accessed by the tool' in single_case_text.command_text: return True diff --git a/behavior_tests/src/cmp_intercept_build/do_test.py b/behavior_tests/src/cmp_intercept_build/do_test.py index 452ec5122..ab3dd50b8 100644 --- a/behavior_tests/src/cmp_intercept_build/do_test.py +++ b/behavior_tests/src/cmp_intercept_build/do_test.py @@ -32,7 +32,7 @@ def parse_compilation_database(compilation_database_name): def migrate_test(single_case_text): - call_subprocess("intercept-build /usr/bin/make --no-linker-entry") + call_subprocess("intercept-build /usr/bin/make --no-linker-entry", single_case_text) new_database = parse_compilation_database("compile_commands.json") reference_database = parse_compilation_database("compile_commands.json_ref") new_database = list(set(new_database)) diff --git a/behavior_tests/src/cmps_cl_compile_test_1/do_test.py b/behavior_tests/src/cmps_cl_compile_test_1/do_test.py index 9bed37b18..c814f3403 100644 --- a/behavior_tests/src/cmps_cl_compile_test_1/do_test.py +++ b/behavior_tests/src/cmps_cl_compile_test_1/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): migrated_str = "" call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: lines = f.readlines() for line in lines: diff --git a/behavior_tests/src/cmps_cl_compile_test_2/do_test.py b/behavior_tests/src/cmps_cl_compile_test_2/do_test.py index c25fd25c9..09726c9f7 100644 --- a/behavior_tests/src/cmps_cl_compile_test_2/do_test.py +++ b/behavior_tests/src/cmps_cl_compile_test_2/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): migrated_str = "" call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: lines = f.readlines() for line in lines: diff --git a/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py b/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py index f7ed1830e..50915fbb1 100644 --- a/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py +++ b/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): migrated_str = "" call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: lines = f.readlines() for line in lines: diff --git a/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py b/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py index f7ed1830e..50915fbb1 100644 --- a/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py +++ b/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): migrated_str = "" call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: lines = f.readlines() for line in lines: diff --git a/behavior_tests/src/copy_all_files/do_test.py b/behavior_tests/src/copy_all_files/do_test.py index 1f2881106..e7a3f4dee 100644 --- a/behavior_tests/src/copy_all_files/do_test.py +++ b/behavior_tests/src/copy_all_files/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL +" --out-root=out --cuda-include-path=" + test_config.include_path + - " t.c t.cpp t.cu") + " t.c t.cpp t.cu", single_case_text) # return is_sub_string("Migration not necessary", single_case_text.command_text) if os.path.exists(os.path.join("out", "t.c")) or os.path.exists(os.path.join("out", "t.cpp")) or \ diff --git a/behavior_tests/src/execute_from_bundle_root/do_test.py b/behavior_tests/src/execute_from_bundle_root/do_test.py index 0ce0c513f..073520cad 100644 --- a/behavior_tests/src/execute_from_bundle_root/do_test.py +++ b/behavior_tests/src/execute_from_bundle_root/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): in_root = "" extra_args = "" call_subprocess(ct_bin + " --cuda-include-path=" + test_config.include_path + - " " + "hellocuda.cu") + " " + "hellocuda.cu", single_case_text) if ('or the same folder as' in single_case_text.command_text): return True return False diff --git a/behavior_tests/src/execute_from_cuda_path/do_test.py b/behavior_tests/src/execute_from_cuda_path/do_test.py index ebadfa8b6..a76f1df24 100644 --- a/behavior_tests/src/execute_from_cuda_path/do_test.py +++ b/behavior_tests/src/execute_from_cuda_path/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): in_root = "" extra_args = "" call_subprocess(test_config.CT_TOOL + " --cuda-include-path=./include " + src) - print("hello" + single_case_text.command_text) + print("hello" + single_case_text.command_text, single_case_text) if ('option is in the CUDA_PATH folder' in single_case_text.command_text): return True return False diff --git a/behavior_tests/src/integer-overflow/do_test.py b/behavior_tests/src/integer-overflow/do_test.py index 48f77c991..ad401b09a 100644 --- a/behavior_tests/src/integer-overflow/do_test.py +++ b/behavior_tests/src/integer-overflow/do_test.py @@ -19,11 +19,11 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess("intercept-build /usr/bin/make") + call_subprocess("intercept-build /usr/bin/make", single_case_text) change_dir("..", single_case_text) - call_subprocess("mv helloworld helloworld_tst") + call_subprocess("mv helloworld helloworld_tst", single_case_text) call_subprocess(test_config.CT_TOOL + " helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=-1,0,0x100,0x1000,0x3fffffff,0x7ffffffe,0x7fffffff,0x80000000,0xfffffffe,0xffffffff,0x10000,0x100000") + " --suppress-warnings=-1,0,0x100,0x1000,0x3fffffff,0x7ffffffe,0x7fffffff,0x80000000,0xfffffffe,0xffffffff,0x10000,0x100000", single_case_text) return is_sub_string("Error: Invalid warning ID or range; valid warning IDs range from 1000 to", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-UDR-idx1/do_test.py b/behavior_tests/src/ngt-UDR-idx1/do_test.py index 883506489..a5bf3fc58 100644 --- a/behavior_tests/src/ngt-UDR-idx1/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx1/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, unknown keyword: $abd))", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-idx2/do_test.py b/behavior_tests/src/ngt-UDR-idx2/do_test.py index 21e6819ca..20ea4c6bf 100644 --- a/behavior_tests/src/ngt-UDR-idx2/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, unknown keyword: $-1))", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-idx3/do_test.py b/behavior_tests/src/ngt-UDR-idx3/do_test.py index c336b185d..4937752bb 100644 --- a/behavior_tests/src/ngt-UDR-idx3/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx3/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, argument index out of range", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-keyword/do_test.py b/behavior_tests/src/ngt-UDR-keyword/do_test.py index 90c504984..3bc982587 100644 --- a/behavior_tests/src/ngt-UDR-keyword/do_test.py +++ b/behavior_tests/src/ngt-UDR-keyword/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, '(' is expected after $deref", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-path/do_test.py b/behavior_tests/src/ngt-UDR-path/do_test.py index 5d51066cb..4ed0d36b1 100644 --- a/behavior_tests/src/ngt-UDR-path/do_test.py +++ b/behavior_tests/src/ngt-UDR-path/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./ruleaaa.yaml --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./ruleaaa.yaml --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: failed to read", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py index 0e6e79807..48c449428 100644 --- a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py +++ b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py @@ -31,7 +31,7 @@ def migrate_test(single_case_text): for analysis_scope in (os.path.join(".", "cuda"), os.path.join("non_exist_dir", "abc")): call_subprocess(migrate_cmd + " --analysis-scope-path=" + - os.path.realpath(analysis_scope)) + os.path.realpath(analysis_scope), single_case_text) if not is_sub_string( "Error: The path for --analysis-scope-path is not the same as or a parent directory of --in-root", single_case_text.command_text): diff --git a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py index 30a5a6d01..7f1f5bf99 100644 --- a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py +++ b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --assume-nd-range-dim=2 --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --assume-nd-range-dim=2 --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Cannot find option named", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py index 31cd941fe..9051baeac 100644 --- a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.write(ret) - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " simple_foo.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: Cannot access directory", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-cannot-find-db/do_test.py b/behavior_tests/src/ngt-cannot-find-db/do_test.py index fcfd522ae..908bc7ae8 100644 --- a/behavior_tests/src/ngt-cannot-find-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-find-db/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " -p ./ --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " -p ./ --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Cannot find compilation database", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-check-cannot-parse/do_test.py b/behavior_tests/src/ngt-check-cannot-parse/do_test.py index b63983a77..98db63cd3 100644 --- a/behavior_tests/src/ngt-check-cannot-parse/do_test.py +++ b/behavior_tests/src/ngt-check-cannot-parse/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " vector_add.cu") + " vector_add.cu", single_case_text) return is_sub_string("Migration not necessary", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-database-notfound/do_test.py b/behavior_tests/src/ngt-database-notfound/do_test.py index f2d4afa76..f2b2b84cc 100644 --- a/behavior_tests/src/ngt-database-notfound/do_test.py +++ b/behavior_tests/src/ngt-database-notfound/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " -p=.") + " -p=.", single_case_text) return is_sub_string("No compilation database found", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-file-parsing-err/do_test.py b/behavior_tests/src/ngt-file-parsing-err/do_test.py index 1ba524541..5b8446105 100644 --- a/behavior_tests/src/ngt-file-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-file-parsing-err/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu -stop-on-parse-err --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " simple_foo.cu -stop-on-parse-err --cuda-include-path=" + test_config.include_path, single_case_text) return (is_sub_string("Cannot parse input file", single_case_text.command_text) and is_sub_string("Parsing", single_case_text.command_text) and not is_sub_string("Analyzing", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-format-range/do_test.py b/behavior_tests/src/ngt-format-range/do_test.py index c98063659..ffaa21b6b 100644 --- a/behavior_tests/src/ngt-format-range/do_test.py +++ b/behavior_tests/src/ngt-format-range/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --format-range=aaa") + " --format-range=aaa", single_case_text) return is_sub_string("Cannot find option named", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-format-style/do_test.py b/behavior_tests/src/ngt-format-style/do_test.py index 7ca92c70b..5e6eed581 100644 --- a/behavior_tests/src/ngt-format-style/do_test.py +++ b/behavior_tests/src/ngt-format-style/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --format-style=aaa") + " --format-style=aaa", single_case_text) return is_sub_string("Cannot find option named", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-in-root-len/do_test.py b/behavior_tests/src/ngt-in-root-len/do_test.py index a99035852..4a32dca08 100644 --- a/behavior_tests/src/ngt-in-root-len/do_test.py +++ b/behavior_tests/src/ngt-in-root-len/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ - long_path) + long_path, single_case_text) return is_sub_string("should be less than", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-in-root-path/do_test.py b/behavior_tests/src/ngt-in-root-path/do_test.py index 3d5579381..f2f5284f5 100644 --- a/behavior_tests/src/ngt-in-root-path/do_test.py +++ b/behavior_tests/src/ngt-in-root-path/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --in-root=./inroot vector_add.cu") + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --in-root=./inroot vector_add.cu", single_case_text) return is_sub_string("is not under the specified input root directory", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-include-path-len/do_test.py b/behavior_tests/src/ngt-include-path-len/do_test.py index c9333acd0..96562d213 100644 --- a/behavior_tests/src/ngt-include-path-len/do_test.py +++ b/behavior_tests/src/ngt-include-path-len/do_test.py @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + long_path) + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + long_path, single_case_text) return is_sub_string("should be less than", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py index 8b9a5fd83..667ca1813 100644 --- a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py +++ b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): shutil.copytree(test_config.include_path, "cc") - call_subprocess(test_config.CT_TOOL + " --in-root=./ ./simple_foo.cu --cuda-include-path=./cc") + call_subprocess(test_config.CT_TOOL + " --in-root=./ ./simple_foo.cu --cuda-include-path=./cc", single_case_text) return is_sub_string("Error: Input folder specified by --in-root or --analysis-scope-path is the parent of, or the same folder", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py index d09b4ad67..314da0483 100644 --- a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py +++ b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + - " --extra-arg=\"--cuda-path=/usr/local/folder-does-not-contain-cuda\" vector_add.cu") + " --extra-arg=\"--cuda-path=/usr/local/folder-does-not-contain-cuda\" vector_add.cu", single_case_text) return is_sub_string("Could not detect path to CUDA header files", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py index dc1ecf768..5f25e249f 100644 --- a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py +++ b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --use-experimental-features=logical-group,abc") + " --use-experimental-features=logical-group,abc", single_case_text) return is_sub_string("for the --use-experimental-features option: Cannot find option named \'abc\'!", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py index cefc40308..4c3786c1b 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none,dpct vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none,dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py index b09b14317..11ef2f6d4 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,cl,dpct vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,cl,dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py index 5117f4ebc..37de04964 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,sycl-math vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,sycl-math vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-inroot/do_test.py b/behavior_tests/src/ngt-invalid-inroot/do_test.py index 32ab09023..b5ba08ec8 100644 --- a/behavior_tests/src/ngt-invalid-inroot/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + - " simple_foo.cu --in-root=/notavalidfolder --cuda-include-path=" + test_config.include_path) + " simple_foo.cu --in-root=/notavalidfolder --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("The path for --in-root or --out-root is not valid", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-inroot2/do_test.py b/behavior_tests/src/ngt-invalid-inroot2/do_test.py index 93233618d..d4d5cc9c1 100644 --- a/behavior_tests/src/ngt-invalid-inroot2/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot2/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + - " simple_foo.cu --in-root=/usr/local --cuda-include-path=" + test_config.include_path) + " simple_foo.cu --in-root=/usr/local --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("The path for --in-root is not valid", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-inroot3/do_test.py b/behavior_tests/src/ngt-invalid-inroot3/do_test.py index fa53e3232..c1d57725c 100644 --- a/behavior_tests/src/ngt-invalid-inroot3/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot3/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + - " simple_foo.cu --in-root=C:\Windows --cuda-include-path=" + test_config.include_path) + " simple_foo.cu --in-root=C:\Windows --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("The path for --in-root is not valid", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-json1/do_test.py b/behavior_tests/src/ngt-invalid-json1/do_test.py index d9f9f7d1a..ca83f968d 100644 --- a/behavior_tests/src/ngt-invalid-json1/do_test.py +++ b/behavior_tests/src/ngt-invalid-json1/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret[1:]) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("Expected array", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json10/do_test.py b/behavior_tests/src/ngt-invalid-json10/do_test.py index 4f71642eb..95c32b5f3 100644 --- a/behavior_tests/src/ngt-invalid-json10/do_test.py +++ b/behavior_tests/src/ngt-invalid-json10/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-json2/do_test.py b/behavior_tests/src/ngt-invalid-json2/do_test.py index 442f2c03c..6b3de512b 100644 --- a/behavior_tests/src/ngt-invalid-json2/do_test.py +++ b/behavior_tests/src/ngt-invalid-json2/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): ret.pop(1) with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("Missing key: \"file\"", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json3/do_test.py b/behavior_tests/src/ngt-invalid-json3/do_test.py index 1b137f1e4..680e39a69 100644 --- a/behavior_tests/src/ngt-invalid-json3/do_test.py +++ b/behavior_tests/src/ngt-invalid-json3/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): ret.pop(5) with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("Expected Key, Flow Entry, or Flow Mapping End", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json4/do_test.py b/behavior_tests/src/ngt-invalid-json4/do_test.py index e325262c2..1ddcbbe96 100644 --- a/behavior_tests/src/ngt-invalid-json4/do_test.py +++ b/behavior_tests/src/ngt-invalid-json4/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: ret.pop(6) f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("Could not find closing ]", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json5/do_test.py b/behavior_tests/src/ngt-invalid-json5/do_test.py index 011bde6c3..1a9dbae00 100644 --- a/behavior_tests/src/ngt-invalid-json5/do_test.py +++ b/behavior_tests/src/ngt-invalid-json5/do_test.py @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json6/do_test.py b/behavior_tests/src/ngt-invalid-json6/do_test.py index a5ede9fd8..5504490d8 100644 --- a/behavior_tests/src/ngt-invalid-json6/do_test.py +++ b/behavior_tests/src/ngt-invalid-json6/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): ret.append(line) with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json7/do_test.py b/behavior_tests/src/ngt-invalid-json7/do_test.py index e36fc9ff6..8a9e713bd 100644 --- a/behavior_tests/src/ngt-invalid-json7/do_test.py +++ b/behavior_tests/src/ngt-invalid-json7/do_test.py @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("Unknown key: \"\"output\"\"", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json8/do_test.py b/behavior_tests/src/ngt-invalid-json8/do_test.py index 6670484b2..5dc799d70 100644 --- a/behavior_tests/src/ngt-invalid-json8/do_test.py +++ b/behavior_tests/src/ngt-invalid-json8/do_test.py @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("Unknown key: \"\"arguments\"\"", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-json9/do_test.py b/behavior_tests/src/ngt-invalid-json9/do_test.py index fbe958659..ce5360bb4 100644 --- a/behavior_tests/src/ngt-invalid-json9/do_test.py +++ b/behavior_tests/src/ngt-invalid-json9/do_test.py @@ -34,7 +34,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path) + call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) return is_sub_string("Processed 1 file(s)", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py index 5a0f766c2..674ebef79 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " hello.cu") + " hello.cu", single_case_text) return is_sub_string("invalid number", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py index 186c996f8..d750cbf41 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py @@ -22,7 +22,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " hello.cu") + " hello.cu", single_case_text) return is_sub_string("invalid number", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py index d1f260257..6d6ec2178 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " hello.cu") + " hello.cu", single_case_text) return is_sub_string("invalid number", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py index 501cb7a16..1ed4968ef 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " hello.cu") + " hello.cu", single_case_text) return is_sub_string("unknown key \'ColumnLimi\'", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py index d80d7f6f9..618aafc48 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open('out/hello.h.yaml', 'r') as f: file_data = f.read() @@ -29,7 +29,7 @@ def migrate_test(single_case_text): f.write(file_data) call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) if "error: unknown key \'ConstantFla\'" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py index 22965c0a3..f0304b904 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open('out/hello.h.yaml', 'r') as f: file_data = f.read() @@ -29,7 +29,7 @@ def migrate_test(single_case_text): f.write(file_data) call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) if "Unexpected token. Expected Key or Block End" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py index 7a188b41b..229f5b991 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): print("test-----------------") call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) file_data="" with open('out/hello.h.yaml', 'r') as f: file_data = f.read() @@ -31,7 +31,7 @@ def migrate_test(single_case_text): f.write(file_data) call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ - os.environ['CUDA_INCLUDE_PATH']) + os.environ['CUDA_INCLUDE_PATH'], single_case_text) print(single_case_text.command_text) if "Unexpected token. Expected Key or Block End" in single_case_text.command_text: return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py index 1f9114f14..fc3cce179 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ - os.environ["CUDA_INCLUDE_PATH"]) + os.environ["CUDA_INCLUDE_PATH"], single_case_text) migrated_yaml = os.path.join("out", "hello.h.yaml") with open(migrated_yaml, "r") as f: file_data = f.read() @@ -29,7 +29,7 @@ def migrate_test(single_case_text): f.write(file_data) call_subprocess(test_config.CT_TOOL + " hello.h --out-root=./out --cuda-include-path=" + \ - os.environ["CUDA_INCLUDE_PATH"]) + os.environ["CUDA_INCLUDE_PATH"], single_case_text) if "differnt path" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") diff --git a/behavior_tests/src/ngt-level-verbosity/do_test.py b/behavior_tests/src/ngt-level-verbosity/do_test.py index 54b32ef80..d9de80735 100644 --- a/behavior_tests/src/ngt-level-verbosity/do_test.py +++ b/behavior_tests/src/ngt-level-verbosity/do_test.py @@ -22,7 +22,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --usm-level=abc --output-verbositi=abc") + " --usm-level=abc --output-verbositi=abc", single_case_text) return is_sub_string("Unknown command line argument '--output-verbositi=abc'", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-no-db-specified/do_test.py b/behavior_tests/src/ngt-no-db-specified/do_test.py index 192a4aba8..a204682d6 100644 --- a/behavior_tests/src/ngt-no-db-specified/do_test.py +++ b/behavior_tests/src/ngt-no-db-specified/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " -in-root=./ -out-root=out -p=./") + " -in-root=./ -out-root=out -p=./", single_case_text) return is_sub_string("Error: Cannot find compilation database", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py index bda347030..476fbdb6b 100644 --- a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py +++ b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: The option --process-all requires that the", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-no-file-type/do_test.py b/behavior_tests/src/ngt-no-file-type/do_test.py index 4771eeba3..836500b5a 100644 --- a/behavior_tests/src/ngt-no-file-type/do_test.py +++ b/behavior_tests/src/ngt-no-file-type/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " simple_foo --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("File Type not available for input file", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-no-source-name/do_test.py b/behavior_tests/src/ngt-no-source-name/do_test.py index c1c36238f..5b4f2c3f1 100644 --- a/behavior_tests/src/ngt-no-source-name/do_test.py +++ b/behavior_tests/src/ngt-no-source-name/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " vector_add") + " vector_add", single_case_text) return is_sub_string("does not have an extension", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-opt-parsing-err/do_test.py b/behavior_tests/src/ngt-opt-parsing-err/do_test.py index 51346cfbc..235369635 100644 --- a/behavior_tests/src/ngt-opt-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-opt-parsing-err/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-rooooot=/aaa --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-rooooot=/aaa --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Option parsing error", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-out-root-len/do_test.py b/behavior_tests/src/ngt-out-root-len/do_test.py index a99035852..4a32dca08 100644 --- a/behavior_tests/src/ngt-out-root-len/do_test.py +++ b/behavior_tests/src/ngt-out-root-len/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ - long_path) + long_path, single_case_text) return is_sub_string("should be less than", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-access/do_test.py b/behavior_tests/src/ngt-output-access/do_test.py index a9f085c19..f74996adf 100644 --- a/behavior_tests/src/ngt-output-access/do_test.py +++ b/behavior_tests/src/ngt-output-access/do_test.py @@ -19,12 +19,12 @@ def setup_test(single_case_text): def migrate_test(single_case_text): os.mkdir("dpct_output") - call_subprocess("chmod u-r dpct_output") - call_subprocess("dpct vector_add.cu --cuda-include-path=" + test_config.include_path ) + call_subprocess("chmod u-r dpct_output", single_case_text) + call_subprocess("dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Could not access output directory", single_case_text.command_text) def build_test(single_case_text): - call_subprocess("chmod 777 dpct_output") + call_subprocess("chmod 777 dpct_output", single_case_text) return True def run_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-create/do_test.py b/behavior_tests/src/ngt-output-create/do_test.py index e0a66dd85..8fd956e81 100644 --- a/behavior_tests/src/ngt-output-create/do_test.py +++ b/behavior_tests/src/ngt-output-create/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path) - return is_sub_string("Unable to save the output to the specified directory", single_case_text.command_text) + call_subprocess(test_config.CT_TOOL + " vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + return is_sub_string("Unable to save the output to the specified directory", single_case_text.command_text, single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-output-file-len/do_test.py b/behavior_tests/src/ngt-output-file-len/do_test.py index a03fc53a7..73dbbb07b 100644 --- a/behavior_tests/src/ngt-output-file-len/do_test.py +++ b/behavior_tests/src/ngt-output-file-len/do_test.py @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --output-file=" +long_path) + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --output-file=" +long_path, single_case_text) return is_sub_string("should be less than", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-not-empty/do_test.py b/behavior_tests/src/ngt-output-not-empty/do_test.py index ffa47a2d8..364cfa550 100644 --- a/behavior_tests/src/ngt-output-not-empty/do_test.py +++ b/behavior_tests/src/ngt-output-not-empty/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): os.mkdir("dpct_output") with open(os.path.join("dpct_output", "test"), 'w') as f: f.write("2") - call_subprocess(test_config.CT_TOOL + " vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("directory is not empty.", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-verbosity/do_test.py b/behavior_tests/src/ngt-output-verbosity/do_test.py index 0415447c8..507833746 100644 --- a/behavior_tests/src/ngt-output-verbosity/do_test.py +++ b/behavior_tests/src/ngt-output-verbosity/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --output-verbosity=abc") + " --output-verbosity=abc", single_case_text) return is_sub_string("--output-verbosity option: Cannot find option named", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-file-len/do_test.py b/behavior_tests/src/ngt-report-file-len/do_test.py index 3d7be49a7..1f2aeadc8 100644 --- a/behavior_tests/src/ngt-report-file-len/do_test.py +++ b/behavior_tests/src/ngt-report-file-len/do_test.py @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=" +long_path) + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=" +long_path, single_case_text) return is_sub_string("should be less than 128", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-file-prefix/do_test.py b/behavior_tests/src/ngt-report-file-prefix/do_test.py index 040c6e9e7..49056e4f6 100644 --- a/behavior_tests/src/ngt-report-file-prefix/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --report-file-prefix=abc:") + " --report-file-prefix=abc:", single_case_text) return is_sub_string("contains special character ':'", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-file-prefix2/do_test.py b/behavior_tests/src/ngt-report-file-prefix2/do_test.py index 556d29c17..64dfc3f50 100644 --- a/behavior_tests/src/ngt-report-file-prefix2/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix2/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --report-file-prefix=\"/abc\"") + " --report-file-prefix=\"/abc\"", single_case_text) return is_sub_string("contains special character", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-format1/do_test.py b/behavior_tests/src/ngt-report-format1/do_test.py index 29584162b..b1f82eb7d 100644 --- a/behavior_tests/src/ngt-report-format1/do_test.py +++ b/behavior_tests/src/ngt-report-format1/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --report-format=abc") + " --report-format=abc", single_case_text) return is_sub_string("--report-format option: Cannot find option named", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-format2/do_test.py b/behavior_tests/src/ngt-report-format2/do_test.py index c7ea8e2aa..dcc0a0ae2 100644 --- a/behavior_tests/src/ngt-report-format2/do_test.py +++ b/behavior_tests/src/ngt-report-format2/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --report-format=xx vector_add.cu") + " --report-format=xx vector_add.cu", single_case_text) return is_sub_string("--report-format option: Cannot find option named 'xx'!", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-type-diags/do_test.py b/behavior_tests/src/ngt-report-type-diags/do_test.py index a8e4e7bfd..546e389fb 100644 --- a/behavior_tests/src/ngt-report-type-diags/do_test.py +++ b/behavior_tests/src/ngt-report-type-diags/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --report-type=xxx --report-diags-content=transformation vector_add.cu") + " --report-type=xxx --report-diags-content=transformation vector_add.cu", single_case_text) return is_sub_string("--report-type option: Cannot find option named 'xxx'!", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-type/do_test.py b/behavior_tests/src/ngt-report-type/do_test.py index 924c0fb3d..fc1502752 100644 --- a/behavior_tests/src/ngt-report-type/do_test.py +++ b/behavior_tests/src/ngt-report-type/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --report-type=abc") + " --report-type=abc", single_case_text) return is_sub_string("--report-type option: Cannot find option named", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py index 51b535b6a..ecbddd9d8 100644 --- a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py +++ b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu -report-format=csv -report-file-prefix=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ - --cuda-include-path=" + test_config.include_path ) + --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Prefix is too long", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py index 6a875299e..4201cffd0 100644 --- a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py +++ b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py @@ -18,13 +18,13 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess("mkdir ./read_only_folder") - call_subprocess("chmod 0444 ./read_only_folder") - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --out-root=./read_only_folder --cuda-include-path=" + test_config.include_path) + call_subprocess("mkdir ./read_only_folder", single_case_text) + call_subprocess("chmod 0444 ./read_only_folder", single_case_text) + call_subprocess(test_config.CT_TOOL + " simple_foo.cu --out-root=./read_only_folder --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Unable to save the output to the specified directory", single_case_text.command_text) def build_test(single_case_text): - call_subprocess("rm -rf ./read_only_folder") - call_subprocess("chmod 0777 ./read_only_folder") + call_subprocess("rm -rf ./read_only_folder", single_case_text) + call_subprocess("chmod 0777 ./read_only_folder", single_case_text) return True def run_test(single_case_text): diff --git a/behavior_tests/src/ngt-show-help/do_test.py b/behavior_tests/src/ngt-show-help/do_test.py index 9e8c45d56..14c170a5d 100644 --- a/behavior_tests/src/ngt-show-help/do_test.py +++ b/behavior_tests/src/ngt-show-help/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL) + call_subprocess(test_config.CT_TOOL, single_case_text) return is_sub_string("To get help on the tool usage", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py index 69fba4381..476fbdb6b 100644 --- a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py +++ b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path ) + call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Error: The option --process-all requires that the", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py index 500be8d16..cda9da415 100644 --- a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py +++ b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --stop-on-parse-err vector_add.cu") + " --stop-on-parse-err vector_add.cu", single_case_text) return is_sub_string("Cannot parse input", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings1/do_test.py b/behavior_tests/src/ngt-suppress-warnings1/do_test.py index b6f1f0437..12bc5f622 100644 --- a/behavior_tests/src/ngt-suppress-warnings1/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings1/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=100e") + " --suppress-warnings=100e", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings10/do_test.py b/behavior_tests/src/ngt-suppress-warnings10/do_test.py index a2a53e193..7a98811c3 100644 --- a/behavior_tests/src/ngt-suppress-warnings10/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings10/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=1000-1900") + " --suppress-warnings=1000-1900", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings11/do_test.py b/behavior_tests/src/ngt-suppress-warnings11/do_test.py index f284bb16a..68e4fc66c 100644 --- a/behavior_tests/src/ngt-suppress-warnings11/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings11/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=1010-1020-1023") + " --suppress-warnings=1010-1020-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings2/do_test.py b/behavior_tests/src/ngt-suppress-warnings2/do_test.py index 71c54d42b..67ca56480 100644 --- a/behavior_tests/src/ngt-suppress-warnings2/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings2/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess( test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ - " --suppress-warnings=999") + " --suppress-warnings=999", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings3/do_test.py b/behavior_tests/src/ngt-suppress-warnings3/do_test.py index 81d660b00..6af08b97e 100644 --- a/behavior_tests/src/ngt-suppress-warnings3/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings3/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=1900") + " --suppress-warnings=1900", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings4/do_test.py b/behavior_tests/src/ngt-suppress-warnings4/do_test.py index 80e483d90..341aa494e 100644 --- a/behavior_tests/src/ngt-suppress-warnings4/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings4/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=-1000") + " --suppress-warnings=-1000", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings5/do_test.py b/behavior_tests/src/ngt-suppress-warnings5/do_test.py index 3bb00ee6f..9f930f378 100644 --- a/behavior_tests/src/ngt-suppress-warnings5/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings5/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=1000-") + " --suppress-warnings=1000-", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) diff --git a/behavior_tests/src/ngt-suppress-warnings6/do_test.py b/behavior_tests/src/ngt-suppress-warnings6/do_test.py index 930f02591..e864663df 100644 --- a/behavior_tests/src/ngt-suppress-warnings6/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings6/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=999-1023") + " --suppress-warnings=999-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings7/do_test.py b/behavior_tests/src/ngt-suppress-warnings7/do_test.py index da77e1ee5..fff619084 100644 --- a/behavior_tests/src/ngt-suppress-warnings7/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings7/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=100e-1023") + " --suppress-warnings=100e-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings8/do_test.py b/behavior_tests/src/ngt-suppress-warnings8/do_test.py index da77e1ee5..fff619084 100644 --- a/behavior_tests/src/ngt-suppress-warnings8/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings8/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=100e-1023") + " --suppress-warnings=100e-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings9/do_test.py b/behavior_tests/src/ngt-suppress-warnings9/do_test.py index 1bdcf7b95..2fdf2fc12 100644 --- a/behavior_tests/src/ngt-suppress-warnings9/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings9/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --suppress-warnings=1010-1020-1023") + " --suppress-warnings=1010-1020-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py index 147d0339a..4e1cf4eed 100644 --- a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py +++ b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --use-dpcpp-extensions=abc") + " --use-dpcpp-extensions=abc", single_case_text) return is_sub_string("Cannot find option named 'abc'", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-usm-leve/do_test.py b/behavior_tests/src/ngt-usm-leve/do_test.py index 36b551ef4..5471e3ee1 100644 --- a/behavior_tests/src/ngt-usm-leve/do_test.py +++ b/behavior_tests/src/ngt-usm-leve/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " --usm-leve=abc") + " --usm-leve=abc", single_case_text) return is_sub_string("Unknown command line argument '--usm-leve=abc'", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-usm-level/do_test.py b/behavior_tests/src/ngt-usm-level/do_test.py index 4d253ac22..ea4f8a12f 100644 --- a/behavior_tests/src/ngt-usm-level/do_test.py +++ b/behavior_tests/src/ngt-usm-level/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ - " --usm-level=abc") + " --usm-level=abc", single_case_text) return is_sub_string("--usm-level option: Cannot find option named 'abc'", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py index c72dd6b3f..903575147 100644 --- a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --vcxprojfile=aaa.vcxproj --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --vcxprojfile=aaa.vcxproj --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("Cannot Open VcxprojFile", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py index 57d92e087..48746856f 100644 --- a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py @@ -19,12 +19,12 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess("icacls ./source /deny Everyone\:\(WD\)") + call_subprocess("icacls ./source /deny Everyone\:\(WD\)", single_case_text) vcxproj_path = os.path.join(os.getcwd(), "source", "aaa.vcxproj") source_path = os.path.join(os.getcwd(), "source", "simple_foo.cu") - call_subprocess(test_config.CT_TOOL + " " + source_path + " --vcxprojfile=\"" + vcxproj_path + "\" --cuda-include-path=" + test_config.include_path) - call_subprocess("icacls ./source /grant Everyone\:\(WD\)") + call_subprocess(test_config.CT_TOOL + " " + source_path + " --vcxprojfile=\"" + vcxproj_path + "\" --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess("icacls ./source /grant Everyone\:\(WD\)", single_case_text) return is_sub_string("Cannot create CompilationDatabase", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py index 8f6018de9..35dda2b68 100644 --- a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ - os.environ["CUDA_INCLUDE_PATH"]) + os.environ["CUDA_INCLUDE_PATH"], single_case_text) migrated_yaml = os.path.join("out", "hello.h.yaml") with open(migrated_yaml, "r") as f: file_data = f.read() @@ -29,7 +29,7 @@ def migrate_test(single_case_text): f.write(file_data) call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ - os.environ["CUDA_INCLUDE_PATH"]) + os.environ["CUDA_INCLUDE_PATH"], single_case_text) if "differnt path" in single_case_text.command_text: return True print("not catch the error: unkown key constantFla") diff --git a/behavior_tests/src/ngti-cdb-path-len/do_test.py b/behavior_tests/src/ngti-cdb-path-len/do_test.py index 8bb39a56f..1cb221eac 100644 --- a/behavior_tests/src/ngti-cdb-path-len/do_test.py +++ b/behavior_tests/src/ngti-cdb-path-len/do_test.py @@ -27,7 +27,7 @@ def migrate_test(single_case_text): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess("intercept-build --cdb " + - long_path) + long_path, single_case_text) return is_sub_string("File name", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngti-empty-make/do_test.py b/behavior_tests/src/ngti-empty-make/do_test.py index f5587ad06..4054b9f64 100644 --- a/behavior_tests/src/ngti-empty-make/do_test.py +++ b/behavior_tests/src/ngti-empty-make/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess("intercept-build make") + call_subprocess("intercept-build make", single_case_text) return is_sub_string("No targets", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngtn-database-fail/do_test.py b/behavior_tests/src/ngtn-database-fail/do_test.py index 1e7990926..0f45f6c85 100644 --- a/behavior_tests/src/ngtn-database-fail/do_test.py +++ b/behavior_tests/src/ngtn-database-fail/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + - " -p=. -in-root=./ -out-root=out") + " -p=. -in-root=./ -out-root=out", single_case_text) return is_sub_string("Cannot parse compilation database", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/path_validation_0/do_test.py b/behavior_tests/src/path_validation_0/do_test.py index abd66ea0c..ccdfa7c48 100644 --- a/behavior_tests/src/path_validation_0/do_test.py +++ b/behavior_tests/src/path_validation_0/do_test.py @@ -19,10 +19,10 @@ def setup_test(single_case_text): def migrate_test(single_case_text): change_dir("helloworld", single_case_text) - call_subprocess("intercept-build /usr/bin/make") + call_subprocess("intercept-build /usr/bin/make", single_case_text) change_dir("..", single_case_text) - call_subprocess("mv helloworld helloworld_tst") - call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path) + call_subprocess("mv helloworld helloworld_tst", single_case_text) + call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("is not under the specified input root directory", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/path_validation_1/do_test.py b/behavior_tests/src/path_validation_1/do_test.py index 7ee1fb48b..69d4ec280 100644 --- a/behavior_tests/src/path_validation_1/do_test.py +++ b/behavior_tests/src/path_validation_1/do_test.py @@ -19,10 +19,10 @@ def setup_test(single_case_text): def migrate_test(single_case_text): change_dir("helloworld", single_case_text) - call_subprocess("intercept-build /usr/bin/make") + call_subprocess("intercept-build /usr/bin/make", single_case_text) change_dir("..", single_case_text) - call_subprocess("mv helloworld helloworld_tst") - call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/rootdir/../test.cu --cuda-include-path=" + test_config.include_path) + call_subprocess("mv helloworld helloworld_tst", single_case_text) + call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/rootdir/../test.cu --cuda-include-path=" + test_config.include_path, single_case_text) return is_sub_string("is not under the specified input root directory", single_case_text.command_text) def build_test(single_case_text): diff --git a/behavior_tests/src/relative_path_test/do_test.py b/behavior_tests/src/relative_path_test/do_test.py index e915eff48..657ca8fb0 100644 --- a/behavior_tests/src/relative_path_test/do_test.py +++ b/behavior_tests/src/relative_path_test/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): change_dir("build", single_case_text) - call_subprocess(test_config.CT_TOOL + " -in-root ../src -out-root ../sycl -p ./ --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " -in-root ../src -out-root ../sycl -p ./ --cuda-include-path=" + test_config.include_path, single_case_text) change_dir("..", single_case_text) return os.path.exists(os.path.join("sycl", "kernel.dp.cpp")) diff --git a/behavior_tests/src/sh-ct-1306/do_test.py b/behavior_tests/src/sh-ct-1306/do_test.py index 747a714fb..586a96ed0 100644 --- a/behavior_tests/src/sh-ct-1306/do_test.py +++ b/behavior_tests/src/sh-ct-1306/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): os.environ["CUDA_INCLUDE_PATH"] = test_config.include_path - return call_subprocess("/bin/bash sh-ct-1306.sh") + return call_subprocess("/bin/bash sh-ct-1306.sh", single_case_text) def build_test(single_case_text): return True diff --git a/features/feature_case/backprop/do_test.py b/features/feature_case/backprop/do_test.py index 6da89c25a..0c0a45382 100644 --- a/features/feature_case/backprop/do_test.py +++ b/features/feature_case/backprop/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " -out-root=./ backprop.c --cuda-include-path=" + test_config.include_path + " --") + call_subprocess(test_config.CT_TOOL + " -out-root=./ backprop.c --cuda-include-path=" + test_config.include_path + " --", single_case_text) return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.command_text) def build_test(single_case_text): return True diff --git a/features/feature_case/cudnn_multiple_files/do_test.py b/features/feature_case/cudnn_multiple_files/do_test.py index 1650f0bb9..e92fe5fb5 100644 --- a/features/feature_case/cudnn_multiple_files/do_test.py +++ b/features/feature_case/cudnn_multiple_files/do_test.py @@ -23,9 +23,9 @@ def migrate_test(single_case_text): if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") - call_subprocess("sed 's/main/scale_main/' cudnn-scale.cu --in-place") - call_subprocess("sed 's/main/sum_main/' cudnn-sum.cu --in-place") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " multiple_main.cpp cudnn-scale.cu cudnn-sum.cu") + call_subprocess("sed 's/main/scale_main/' cudnn-scale.cu --in-place", single_case_text) + call_subprocess("sed 's/main/sum_main/' cudnn-sum.cu --in-place", single_case_text) + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " multiple_main.cpp cudnn-scale.cu cudnn-sum.cu", single_case_text) return os.path.exists(os.path.join("dpct_output", "cudnn-scale.dp.cpp")) def build_test(single_case_text): @@ -48,4 +48,4 @@ def build_test(single_case_text): return compile_and_link(srcs, single_case_text, cmp_options, objects, linkopt) def run_test(single_case_text): - return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run ')) + return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run '), single_case_text) diff --git a/features/feature_case/kernel_library/do_test.py b/features/feature_case/kernel_library/do_test.py index ea8432561..9ffbf4bf5 100644 --- a/features/feature_case/kernel_library/do_test.py +++ b/features/feature_case/kernel_library/do_test.py @@ -22,14 +22,14 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " kernel_library.cpp jit.cu --extra-arg=--ptx") + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " kernel_library.cpp jit.cu --extra-arg=--ptx", single_case_text) return os.path.exists(os.path.join("dpct_output", "kernel_library.cpp.dp.cpp")) def build_test(single_case_text): # make shared library if (platform.system() == 'Windows'): - ret = call_subprocess("icpx -fsycl dpct_output/jit.dp.cpp -shared -o premade.ptx") + ret = call_subprocess("icpx -fsycl dpct_output/jit.dp.cpp -shared -o premade.ptx", single_case_text) else: - ret = call_subprocess(test_config.DPCXX_COM + " dpct_output/jit.dp.cpp -fPIC -shared -o premade.ptx") + ret = call_subprocess(test_config.DPCXX_COM + " dpct_output/jit.dp.cpp -fPIC -shared -o premade.ptx", single_case_text) if not ret: print("Could not make premade.ptx shared library.") return False @@ -38,4 +38,4 @@ def build_test(single_case_text): srcs.append(os.path.join("dpct_output", "kernel_library.cpp.dp.cpp")) return compile_and_link(srcs, single_case_text, linkopt=["-lstdc++fs"]) def run_test(single_case_text): - return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run ')) + return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run '), single_case_text) diff --git a/features/feature_case/module/do_test.py b/features/feature_case/module/do_test.py index 33fc34b86..408bb9d07 100644 --- a/features/feature_case/module/do_test.py +++ b/features/feature_case/module/do_test.py @@ -22,14 +22,14 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " module-helper.cpp module-main.cu module-kernel.cu --extra-arg=--ptx") + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " module-helper.cpp module-main.cu module-kernel.cu --extra-arg=--ptx", single_case_text) return os.path.exists(os.path.join("dpct_output", "module-kernel.dp.cpp")) def build_test(single_case_text): # make shared library if (platform.system() == 'Windows'): - ret = call_subprocess("icpx -fsycl dpct_output/module-kernel.dp.cpp -shared -o module-kernel.dll") + ret = call_subprocess("icpx -fsycl dpct_output/module-kernel.dp.cpp -shared -o module-kernel.dll", single_case_text) else: - ret = call_subprocess(test_config.DPCXX_COM + " dpct_output/module-kernel.dp.cpp -fPIC -shared -o module-kernel.so") + ret = call_subprocess(test_config.DPCXX_COM + " dpct_output/module-kernel.dp.cpp -fPIC -shared -o module-kernel.so", single_case_text) if not ret: print("Could not make module-kernel.* shared library.") return False @@ -39,4 +39,4 @@ def build_test(single_case_text): srcs.append(os.path.join("dpct_output", "module-main.dp.cpp")) return compile_and_link(srcs, single_case_text) def run_test(single_case_text): - return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run ')) + return call_subprocess(os.path.join(os.path.curdir, single_case_text.name + '.run '), single_case_text) diff --git a/help_function/test_help.py b/help_function/test_help.py index f7be8714c..c3468bfd0 100644 --- a/help_function/test_help.py +++ b/help_function/test_help.py @@ -68,12 +68,12 @@ def build_test(single_case_text): if single_case_text.name == "test_default_queue_2": srcs.append("test_default_queue_1.cpp") if single_case_text.name == "kernel_function_lin": - ret = call_subprocess(test_config.DPCXX_COM + " -shared -fPIC -o module.so kernel_module_lin.cpp") + ret = call_subprocess(test_config.DPCXX_COM + " -shared -fPIC -o module.so kernel_module_lin.cpp", single_case_text) if not ret: print("kernel_function_lin created the shared lib failed.") return False if single_case_text.name == "kernel_function_win": - ret = call_subprocess("icx-cl -fsycl /EHsc /LD kernel_module_win.cpp /link /OUT:module.dll") + ret = call_subprocess("icx-cl -fsycl /EHsc /LD kernel_module_win.cpp /link /OUT:module.dll", single_case_text) if not ret: print("kernel_function_win created the shared lib failed.") return False diff --git a/regressions/test_regression.py b/regressions/test_regression.py index c2b8aa0a1..cc08ce382 100644 --- a/regressions/test_regression.py +++ b/regressions/test_regression.py @@ -23,7 +23,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): if single_case_text.name in ["test-1399", "test-1247"]: os.chdir(single_case_text.name) - return call_subprocess("sh ./run.sh") + return call_subprocess("sh ./run.sh", single_case_text) src = [] extra_args = [] in_root = os.path.join(os.getcwd(), single_case_text.name) diff --git a/user_guide_samples/test_guide.py b/user_guide_samples/test_guide.py index b95de44b3..a9508a57f 100644 --- a/user_guide_samples/test_guide.py +++ b/user_guide_samples/test_guide.py @@ -29,7 +29,7 @@ def run_test(single_case_text): test_driver = single_case_text.name + ".py" options = " \" \"" os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter - call_subprocess("python " + test_driver + options) + call_subprocess("python " + test_driver + options, single_case_text) if "case pass" in single_case_text.command_text: return True return False From 61e86bd05aee1a765334b856bdb91c3954084605 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Mon, 3 Jul 2023 10:05:31 +0800 Subject: [PATCH 03/10] fix output and command record Signed-off-by: Ni, Wenhui --- behavior_tests/src/bad_input_1/do_test.py | 2 +- .../src/bt-analysis-scope-path2/do_test.py | 2 +- behavior_tests/src/bt-autocomplete/do_test.py | 44 ++++++------- .../bt-check-unexpected-message/do_test.py | 2 +- .../do_test.py | 2 +- behavior_tests/src/bt-extra-arg/do_test.py | 6 +- behavior_tests/src/bt-help/do_test.py | 2 +- .../bt-in-root-empty-process-all/do_test.py | 2 +- .../src/bt-invalid-cuda-version/do_test.py | 2 +- .../bt-kernel-function-limitation/do_test.py | 4 +- .../src/bt-language-warning/do_test.py | 2 +- .../src/bt-suppress-warnings-all/do_test.py | 2 +- .../src/bt-suppress-warnings/do_test.py | 2 +- behavior_tests/src/bt-version/do_test.py | 4 +- .../do_test.py | 2 +- .../do_test.py | 6 +- .../do_test.py | 2 +- .../src/bt-yaml-without-ct-version/do_test.py | 4 +- .../src/cannot-acc-dir-in-db/do_test.py | 2 +- .../src/change-filename-extension/do_test.py | 10 +-- .../check-device-unsupport-aspect/do_test.py | 4 +- .../src/check-windows-version/do_test.py | 2 +- .../src/cl_compile_test_1/do_test.py | 2 +- behavior_tests/src/copy_all_files/do_test.py | 2 +- .../src/execute_from_bundle_root/do_test.py | 2 +- .../src/execute_from_cuda_path/do_test.py | 4 +- .../src/integer-overflow/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx1/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx2/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx3/do_test.py | 2 +- behavior_tests/src/ngt-UDR-keyword/do_test.py | 2 +- behavior_tests/src/ngt-UDR-path/do_test.py | 2 +- .../src/ngt-analysis-scope-path1/do_test.py | 2 +- .../src/ngt-assume-nd-range-dim/do_test.py | 2 +- .../ngt-cannot-access-dir-in-db/do_test.py | 2 +- .../src/ngt-cannot-find-db/do_test.py | 2 +- .../src/ngt-check-cannot-parse/do_test.py | 2 +- .../src/ngt-database-notfound/do_test.py | 2 +- .../src/ngt-file-parsing-err/do_test.py | 8 +-- .../src/ngt-format-range/do_test.py | 2 +- .../src/ngt-format-style/do_test.py | 2 +- behavior_tests/src/ngt-in-root-len/do_test.py | 2 +- .../src/ngt-in-root-path/do_test.py | 2 +- .../src/ngt-include-path-len/do_test.py | 2 +- .../ngt-inroot-contain-cuda-path/do_test.py | 2 +- .../ngt-invalid-cuda-include-path/do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../src/ngt-invalid-inroot/do_test.py | 2 +- .../src/ngt-invalid-inroot2/do_test.py | 2 +- .../src/ngt-invalid-inroot3/do_test.py | 2 +- .../src/ngt-invalid-json1/do_test.py | 2 +- .../src/ngt-invalid-json10/do_test.py | 2 +- .../src/ngt-invalid-json2/do_test.py | 2 +- .../src/ngt-invalid-json3/do_test.py | 2 +- .../src/ngt-invalid-json4/do_test.py | 2 +- .../src/ngt-invalid-json5/do_test.py | 2 +- .../src/ngt-invalid-json6/do_test.py | 2 +- .../src/ngt-invalid-json7/do_test.py | 2 +- .../src/ngt-invalid-json8/do_test.py | 2 +- .../src/ngt-invalid-json9/do_test.py | 2 +- .../ngt-invalid-yaml-for-format1/do_test.py | 2 +- .../ngt-invalid-yaml-for-format2/do_test.py | 2 +- .../ngt-invalid-yaml-for-format3/do_test.py | 2 +- .../ngt-invalid-yaml-for-format4/do_test.py | 2 +- .../ngt-invalid-yaml-for-header1/do_test.py | 2 +- .../ngt-invalid-yaml-for-header2/do_test.py | 2 +- .../ngt-invalid-yaml-for-header3/do_test.py | 4 +- .../ngt-invalid-yaml-for-header4/do_test.py | 2 +- .../src/ngt-level-verbosity/do_test.py | 2 +- .../src/ngt-no-db-specified/do_test.py | 2 +- .../src/ngt-no-explicit-inroot/do_test.py | 2 +- .../src/ngt-no-file-type/do_test.py | 2 +- .../src/ngt-no-source-name/do_test.py | 2 +- .../src/ngt-opt-parsing-err/do_test.py | 2 +- .../src/ngt-out-root-len/do_test.py | 2 +- .../src/ngt-output-access/do_test.py | 2 +- .../src/ngt-output-create/do_test.py | 2 +- .../src/ngt-output-file-len/do_test.py | 2 +- .../src/ngt-output-not-empty/do_test.py | 2 +- .../src/ngt-output-verbosity/do_test.py | 2 +- .../src/ngt-report-file-len/do_test.py | 2 +- .../src/ngt-report-file-prefix/do_test.py | 2 +- .../src/ngt-report-file-prefix2/do_test.py | 2 +- .../src/ngt-report-format1/do_test.py | 2 +- .../src/ngt-report-format2/do_test.py | 2 +- .../src/ngt-report-type-diags/do_test.py | 2 +- behavior_tests/src/ngt-report-type/do_test.py | 2 +- .../src/ngt-rpt-prefix-too-long/do_test.py | 2 +- .../src/ngt-save-out-fail-lin/do_test.py | 2 +- behavior_tests/src/ngt-show-help/do_test.py | 2 +- .../src/ngt-skip-for-missing-cmd/do_test.py | 2 +- .../src/ngt-stop-on-parse-err/do_test.py | 2 +- .../src/ngt-suppress-warnings1/do_test.py | 2 +- .../src/ngt-suppress-warnings10/do_test.py | 2 +- .../src/ngt-suppress-warnings11/do_test.py | 2 +- .../src/ngt-suppress-warnings2/do_test.py | 2 +- .../src/ngt-suppress-warnings3/do_test.py | 2 +- .../src/ngt-suppress-warnings4/do_test.py | 2 +- .../src/ngt-suppress-warnings5/do_test.py | 2 +- .../src/ngt-suppress-warnings6/do_test.py | 2 +- .../src/ngt-suppress-warnings7/do_test.py | 2 +- .../src/ngt-suppress-warnings8/do_test.py | 2 +- .../src/ngt-suppress-warnings9/do_test.py | 2 +- .../src/ngt-use-dpcpp-extensions/do_test.py | 2 +- behavior_tests/src/ngt-usm-leve/do_test.py | 2 +- behavior_tests/src/ngt-usm-level/do_test.py | 2 +- .../src/ngt-vcxproj-does-not-exist/do_test.py | 2 +- .../src/ngt-vcxproj-to-db-fail/do_test.py | 2 +- .../do_test.py | 2 +- .../src/ngti-cdb-path-len/do_test.py | 2 +- behavior_tests/src/ngti-empty-make/do_test.py | 2 +- .../src/ngtn-database-fail/do_test.py | 2 +- .../src/path_validation_0/do_test.py | 2 +- .../src/path_validation_1/do_test.py | 2 +- features/feature_case/backprop/do_test.py | 2 +- help_function/test_help.py | 2 +- run_test.py | 65 +++++++++++-------- test_utils.py | 12 ++-- user_guide_samples/test_guide.py | 2 +- 122 files changed, 203 insertions(+), 190 deletions(-) diff --git a/behavior_tests/src/bad_input_1/do_test.py b/behavior_tests/src/bad_input_1/do_test.py index 087f150c7..817fe91ec 100644 --- a/behavior_tests/src/bad_input_1/do_test.py +++ b/behavior_tests/src/bad_input_1/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + os.path.join("cuda", "migrate_nonbuilding_code.cu"), single_case_text) - return is_sub_string("unknown type name", single_case_text.command_text) + return is_sub_string("unknown type name", single_case_text.print_text) def build_test(single_case_text): return True def run_test(single_case_text): diff --git a/behavior_tests/src/bt-analysis-scope-path2/do_test.py b/behavior_tests/src/bt-analysis-scope-path2/do_test.py index bd6581022..fc1b3a709 100644 --- a/behavior_tests/src/bt-analysis-scope-path2/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path2/do_test.py @@ -50,7 +50,7 @@ def migrate_test(single_case_text): os.path.join("cuda", ".."), single_case_text) return is_sub_string( f"use the same option set as in previous migration: \"--analysis-scope-path=", - single_case_text.command_text) + single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-autocomplete/do_test.py b/behavior_tests/src/bt-autocomplete/do_test.py index b3529fa3f..30635a9d9 100644 --- a/behavior_tests/src/bt-autocomplete/do_test.py +++ b/behavior_tests/src/bt-autocomplete/do_test.py @@ -21,64 +21,64 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --autocomplete=--gen-build", single_case_text) reference = '--gen-build-script\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-gen-build", single_case_text) reference = '-gen-build-script\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=foo") reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=#d", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=#d", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar##--enable-c", single_case_text) reference = '--enable-ctad\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar###--format-range=#a", single_case_text) reference = 'all\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file=", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file", single_case_text) reference = '--rule-file\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-p=", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-p", single_case_text) reference = '-p\n' + \ '-process-all\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,", single_case_text) reference = 'cl,sycl,cl\n' + \ @@ -86,28 +86,28 @@ def migrate_test(single_case_text): 'cl,sycl,none\n' + \ 'cl,sycl,sycl\n' + \ 'cl,sycl,sycl-math\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,s", single_case_text) reference = 'cl,sycl,sycl\n' + \ 'cl,sycl,sycl-math\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=,", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete==", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=,,", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=-", single_case_text) opts = ['--always-use-async-handler\n', @@ -152,15 +152,15 @@ def migrate_test(single_case_text): '--version\n', '-p\n'] for opt in opts: - res = res and (opt in single_case_text.command_text) + res = res and (opt in single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=##", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) call_subprocess(test_config.CT_TOOL + " --autocomplete=#", single_case_text) reference = '\n' - res = res and (reference == single_case_text.command_text) + res = res and (reference == single_case_text.print_text) return res diff --git a/behavior_tests/src/bt-check-unexpected-message/do_test.py b/behavior_tests/src/bt-check-unexpected-message/do_test.py index de3e5dea2..75e04c62f 100644 --- a/behavior_tests/src/bt-check-unexpected-message/do_test.py +++ b/behavior_tests/src/bt-check-unexpected-message/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path + " --extra-arg=-xc++", single_case_text) - return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", single_case_text.command_text) + return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", single_case_text.print_text) def build_test(single_case_text): return call_subprocess("icpx -fsycl out/test.dp.cpp", single_case_text) diff --git a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py index 8cb12d54e..a8d576c2d 100644 --- a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " -p=./ --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.command_text) + return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.print_text) def build_test(single_case_text): return True def run_test(single_case_text): diff --git a/behavior_tests/src/bt-extra-arg/do_test.py b/behavior_tests/src/bt-extra-arg/do_test.py index ed6e72850..d236f9195 100644 --- a/behavior_tests/src/bt-extra-arg/do_test.py +++ b/behavior_tests/src/bt-extra-arg/do_test.py @@ -20,9 +20,9 @@ def setup_test(single_case_text): def migrate_test(single_case_text): return (call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=" + test_config.include_path + "\" vector_add.cu", single_case_text) - and is_sub_string("Parsing", single_case_text.command_text) - and is_sub_string("Analyzing", single_case_text.command_text) - and is_sub_string("Migrating", single_case_text.command_text)) + and is_sub_string("Parsing", single_case_text.print_text) + and is_sub_string("Analyzing", single_case_text.print_text) + and is_sub_string("Migrating", single_case_text.print_text)) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-help/do_test.py b/behavior_tests/src/bt-help/do_test.py index 6c12e84e2..2a21d2b2b 100644 --- a/behavior_tests/src/bt-help/do_test.py +++ b/behavior_tests/src/bt-help/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL +" --help", single_case_text) - return is_sub_string("USAGE", single_case_text.command_text) + return is_sub_string("USAGE", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py index 99e1fbfde..7e10b9b10 100644 --- a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py +++ b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --process-all --cuda-include-path=" + test_config.include_path + " --in-root=", single_case_text) - return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", single_case_text.command_text) + return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-invalid-cuda-version/do_test.py b/behavior_tests/src/bt-invalid-cuda-version/do_test.py index a916d5040..d172b7b51 100644 --- a/behavior_tests/src/bt-invalid-cuda-version/do_test.py +++ b/behavior_tests/src/bt-invalid-cuda-version/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): in_root = os.getcwd() test_case_path = os.path.join(in_root, "vector_add.cu") call_subprocess(test_config.CT_TOOL + " " + test_case_path + " --out-root=out --in-root=" + in_root + " --cuda-include-path=" + include_path, single_case_text) - return is_sub_string("Error: The version of CUDA header files specified by --cuda-include-path is not supported. See Release Notes for supported versions.", single_case_text.command_text) + return is_sub_string("Error: The version of CUDA header files specified by --cuda-include-path is not supported. See Release Notes for supported versions.", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-kernel-function-limitation/do_test.py b/behavior_tests/src/bt-kernel-function-limitation/do_test.py index 6482f5986..7c571f56c 100644 --- a/behavior_tests/src/bt-kernel-function-limitation/do_test.py +++ b/behavior_tests/src/bt-kernel-function-limitation/do_test.py @@ -21,8 +21,8 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --optimize-migration --out-root=./out kernel-func.cu --cuda-include-path=" + test_config.include_path, single_case_text) - ret = is_sub_string("Recursive functions cannot be called in SYCL device code", single_case_text.command_text) - ret = is_sub_string("Virtual functions cannot be called in SYCL device code", single_case_text.command_text) and ret + ret = is_sub_string("Recursive functions cannot be called in SYCL device code", single_case_text.print_text) + ret = is_sub_string("Virtual functions cannot be called in SYCL device code", single_case_text.print_text) and ret return ret def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-language-warning/do_test.py b/behavior_tests/src/bt-language-warning/do_test.py index 2f2018927..ee9884ba2 100644 --- a/behavior_tests/src/bt-language-warning/do_test.py +++ b/behavior_tests/src/bt-language-warning/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cpp --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("NOTE: test.cpp is treated as a CUDA file by default. Use the --extra-arg=-xc++ option to treat test.cpp as a C++ file if needed.", single_case_text.command_text) + return is_sub_string("NOTE: test.cpp is treated as a CUDA file by default. Use the --extra-arg=-xc++ option to treat test.cpp as a C++ file if needed.", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-suppress-warnings-all/do_test.py b/behavior_tests/src/bt-suppress-warnings-all/do_test.py index 6739c6228..a7471598f 100644 --- a/behavior_tests/src/bt-suppress-warnings-all/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings-all/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --suppress-warnings-all vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return not is_sub_string("DPCT1015", single_case_text.command_text) + return not is_sub_string("DPCT1015", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-suppress-warnings/do_test.py b/behavior_tests/src/bt-suppress-warnings/do_test.py index fc5c378b6..91d37521d 100644 --- a/behavior_tests/src/bt-suppress-warnings/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.cu --suppress-warnings=1000-1003,1008 --cuda-include-path=" + test_config.include_path, single_case_text) - return not is_sub_string("warning: DPCT10", single_case_text.command_text) + return not is_sub_string("warning: DPCT10", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-version/do_test.py b/behavior_tests/src/bt-version/do_test.py index 7915e997a..520b32f89 100644 --- a/behavior_tests/src/bt-version/do_test.py +++ b/behavior_tests/src/bt-version/do_test.py @@ -22,8 +22,8 @@ def migrate_test(single_case_text): ct_clang_version = get_ct_clang_version() expected_output = "dpct version {0}".format(ct_clang_version) print("expected dpct version output: {0}".format(expected_output)) - print("\n'dpct --version' outputs {0}".format(single_case_text.command_text)) - return is_sub_string(expected_output, single_case_text.command_text) + print("\n'dpct --version' outputs {0}".format(single_case_text.print_text)) + return is_sub_string(expected_output, single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py index 49bfbd1ed..61338e8a5 100644 --- a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", single_case_text.command_text) + return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py index caf76741f..90b39c7b2 100644 --- a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py @@ -20,9 +20,9 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --in-root . --out-root out --always-use-async-handler --assume-nd-range-dim=1 --comments --enable-ctad --no-dpcpp-extensions=enqueued_barriers --no-dry-pattern --process-all -p . --sycl-named-lambda --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --usm-level=none --cuda-include-path=" + test_config.include_path, single_case_text) call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("\"--analysis-scope-path=\"", single_case_text.command_text) and \ - is_sub_string("--always-use-async-handler --comments --compilation-database=\"", single_case_text.command_text) and \ - is_sub_string("--enable-ctad --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --no-dpcpp-extensions=enqueued_barriers --assume-nd-range-dim=1 --no-dry-pattern --process-all --sycl-named-lambda --usm-level=none\".", single_case_text.command_text) + return is_sub_string("\"--analysis-scope-path=\"", single_case_text.print_text) and \ + is_sub_string("--always-use-async-handler --comments --compilation-database=\"", single_case_text.print_text) and \ + is_sub_string("--enable-ctad --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --no-dpcpp-extensions=enqueued_barriers --assume-nd-range-dim=1 --no-dry-pattern --process-all --sycl-named-lambda --usm-level=none\".", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py index 189f020ed..8ff047c5a 100644 --- a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-cl-namespace-inline --cuda-include-path=" + test_config.include_path, single_case_text) call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("--no-cl-namespace-inline\".", single_case_text.command_text) + return is_sub_string("--no-cl-namespace-inline\".", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py index 01a89f89e..b0a961aee 100644 --- a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py @@ -20,8 +20,8 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Failed to load", single_case_text.command_text) and \ - is_sub_string("Migration continues with incremental migration disabled", single_case_text.command_text) + return is_sub_string("Failed to load", single_case_text.print_text) and \ + is_sub_string("Migration continues with incremental migration disabled", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py index b98d6c501..8ff73f9f2 100644 --- a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py +++ b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' -p ./helloworld_tst/compile_commands.json --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) - if 'check if the directory exists and can be accessed by the tool' in single_case_text.command_text: + if 'check if the directory exists and can be accessed by the tool' in single_case_text.print_text: return True print("could not get expected message: check if the directory exists and can be accessed by the tool") return False diff --git a/behavior_tests/src/change-filename-extension/do_test.py b/behavior_tests/src/change-filename-extension/do_test.py index 261113ee1..2d2c7bd3d 100644 --- a/behavior_tests/src/change-filename-extension/do_test.py +++ b/behavior_tests/src/change-filename-extension/do_test.py @@ -22,30 +22,30 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess( test_config.CT_TOOL + " -p=. --change-cuda-files-extension-only --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) - print(single_case_text.command_text) + print(single_case_text.print_text) reference = 'main.dp.cpp' call_subprocess("ls out | grep " + reference, single_case_text) res = True - if reference not in single_case_text.command_text: + if reference not in single_case_text.print_text: res = False print("there should be a file: " + reference) reference = 'test.cpp' call_subprocess("ls out | grep " + reference, single_case_text) - if reference not in single_case_text.command_text: + if reference not in single_case_text.print_text: res = False print("there should be a file: " + reference) reference = 'test.dp.hpp' call_subprocess("ls out | grep " + reference, single_case_text) - if reference not in single_case_text.command_text: + if reference not in single_case_text.print_text: res = False print("there should be a file: " + reference) reference = 'test.h' call_subprocess("ls out | grep " + reference, single_case_text) - if reference not in single_case_text.command_text: + if reference not in single_case_text.print_text: res = False print("there should be a file: " + reference) diff --git a/behavior_tests/src/check-device-unsupport-aspect/do_test.py b/behavior_tests/src/check-device-unsupport-aspect/do_test.py index f4f994216..ea34f50f5 100644 --- a/behavior_tests/src/check-device-unsupport-aspect/do_test.py +++ b/behavior_tests/src/check-device-unsupport-aspect/do_test.py @@ -69,7 +69,7 @@ def run_test(single_case_text): res += 1 print("double.run run pass") print("double.run output:") - print(single_case_text.command_text) + print(single_case_text.print_text) if res != 1: print("case 'double' failed") return False @@ -79,7 +79,7 @@ def run_test(single_case_text): res += 1 print("half.run run pass") print("half.run output:") - print(single_case_text.command_text) + print(single_case_text.print_text) if res != 2: print("case 'half' failed") return False diff --git a/behavior_tests/src/check-windows-version/do_test.py b/behavior_tests/src/check-windows-version/do_test.py index 29a2c9dee..ad32a731d 100644 --- a/behavior_tests/src/check-windows-version/do_test.py +++ b/behavior_tests/src/check-windows-version/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def get_windows_version(arg1, arg2): call_subprocess("powershell \"(Get-Item -path " + arg1 + ").VersionInfo." + arg2 + "\"", single_case_text) - return single_case_text.command_text + return single_case_text.print_text def migrate_test(single_case_text): ct_path = get_ct_path() diff --git a/behavior_tests/src/cl_compile_test_1/do_test.py b/behavior_tests/src/cl_compile_test_1/do_test.py index cefdb3215..cd4a03d3e 100644 --- a/behavior_tests/src/cl_compile_test_1/do_test.py +++ b/behavior_tests/src/cl_compile_test_1/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' helloworld_tst/src/test.cu --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) - if 'check if the directory exists and can be accessed by the tool' in single_case_text.command_text: + if 'check if the directory exists and can be accessed by the tool' in single_case_text.print_text: return True print("could not get expected message: check if the directory exists and can be accessed by the tool") return False diff --git a/behavior_tests/src/copy_all_files/do_test.py b/behavior_tests/src/copy_all_files/do_test.py index e7a3f4dee..e3c7ad846 100644 --- a/behavior_tests/src/copy_all_files/do_test.py +++ b/behavior_tests/src/copy_all_files/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL +" --out-root=out --cuda-include-path=" + test_config.include_path + " t.c t.cpp t.cu", single_case_text) - # return is_sub_string("Migration not necessary", single_case_text.command_text) + # return is_sub_string("Migration not necessary", single_case_text.print_text) if os.path.exists(os.path.join("out", "t.c")) or os.path.exists(os.path.join("out", "t.cpp")) or \ os.path.exists(os.path.join("out", "t.dp.cpp")): diff --git a/behavior_tests/src/execute_from_bundle_root/do_test.py b/behavior_tests/src/execute_from_bundle_root/do_test.py index 073520cad..298919456 100644 --- a/behavior_tests/src/execute_from_bundle_root/do_test.py +++ b/behavior_tests/src/execute_from_bundle_root/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): extra_args = "" call_subprocess(ct_bin + " --cuda-include-path=" + test_config.include_path + " " + "hellocuda.cu", single_case_text) - if ('or the same folder as' in single_case_text.command_text): + if ('or the same folder as' in single_case_text.print_text): return True return False diff --git a/behavior_tests/src/execute_from_cuda_path/do_test.py b/behavior_tests/src/execute_from_cuda_path/do_test.py index a76f1df24..84fd71ea8 100644 --- a/behavior_tests/src/execute_from_cuda_path/do_test.py +++ b/behavior_tests/src/execute_from_cuda_path/do_test.py @@ -28,8 +28,8 @@ def migrate_test(single_case_text): in_root = "" extra_args = "" call_subprocess(test_config.CT_TOOL + " --cuda-include-path=./include " + src) - print("hello" + single_case_text.command_text, single_case_text) - if ('option is in the CUDA_PATH folder' in single_case_text.command_text): + print("hello" + single_case_text.print_text, single_case_text) + if ('option is in the CUDA_PATH folder' in single_case_text.print_text): return True return False diff --git a/behavior_tests/src/integer-overflow/do_test.py b/behavior_tests/src/integer-overflow/do_test.py index ad401b09a..9cbd353c0 100644 --- a/behavior_tests/src/integer-overflow/do_test.py +++ b/behavior_tests/src/integer-overflow/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path + " --suppress-warnings=-1,0,0x100,0x1000,0x3fffffff,0x7ffffffe,0x7fffffff,0x80000000,0xfffffffe,0xffffffff,0x10000,0x100000", single_case_text) - return is_sub_string("Error: Invalid warning ID or range; valid warning IDs range from 1000 to", single_case_text.command_text) + return is_sub_string("Error: Invalid warning ID or range; valid warning IDs range from 1000 to", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-UDR-idx1/do_test.py b/behavior_tests/src/ngt-UDR-idx1/do_test.py index a5bf3fc58..b48e4b24e 100644 --- a/behavior_tests/src/ngt-UDR-idx1/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx1/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: in rule sample_rule, unknown keyword: $abd))", single_case_text.command_text) + return is_sub_string("Error: in rule sample_rule, unknown keyword: $abd))", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-UDR-idx2/do_test.py b/behavior_tests/src/ngt-UDR-idx2/do_test.py index 20ea4c6bf..6486ada8b 100644 --- a/behavior_tests/src/ngt-UDR-idx2/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx2/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: in rule sample_rule, unknown keyword: $-1))", single_case_text.command_text) + return is_sub_string("Error: in rule sample_rule, unknown keyword: $-1))", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-UDR-idx3/do_test.py b/behavior_tests/src/ngt-UDR-idx3/do_test.py index 4937752bb..46ddac4b6 100644 --- a/behavior_tests/src/ngt-UDR-idx3/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx3/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: in rule sample_rule, argument index out of range", single_case_text.command_text) + return is_sub_string("Error: in rule sample_rule, argument index out of range", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-UDR-keyword/do_test.py b/behavior_tests/src/ngt-UDR-keyword/do_test.py index 3bc982587..a902a17da 100644 --- a/behavior_tests/src/ngt-UDR-keyword/do_test.py +++ b/behavior_tests/src/ngt-UDR-keyword/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: in rule sample_rule, '(' is expected after $deref", single_case_text.command_text) + return is_sub_string("Error: in rule sample_rule, '(' is expected after $deref", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-UDR-path/do_test.py b/behavior_tests/src/ngt-UDR-path/do_test.py index 4ed0d36b1..1982b5f63 100644 --- a/behavior_tests/src/ngt-UDR-path/do_test.py +++ b/behavior_tests/src/ngt-UDR-path/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./ruleaaa.yaml --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: failed to read", single_case_text.command_text) + return is_sub_string("Error: failed to read", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py index 48c449428..64c00a92a 100644 --- a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py +++ b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py @@ -34,7 +34,7 @@ def migrate_test(single_case_text): os.path.realpath(analysis_scope), single_case_text) if not is_sub_string( "Error: The path for --analysis-scope-path is not the same as or a parent directory of --in-root", - single_case_text.command_text): + single_case_text.print_text): return False return True diff --git a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py index 7f1f5bf99..e2f92f944 100644 --- a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py +++ b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --assume-nd-range-dim=2 --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Cannot find option named", single_case_text.command_text) + return is_sub_string("Cannot find option named", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py index 9051baeac..03c4e165a 100644 --- a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py @@ -31,7 +31,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: Cannot access directory", single_case_text.command_text) + return is_sub_string("Error: Cannot access directory", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-cannot-find-db/do_test.py b/behavior_tests/src/ngt-cannot-find-db/do_test.py index 908bc7ae8..c4273dd83 100644 --- a/behavior_tests/src/ngt-cannot-find-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-find-db/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " -p ./ --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Cannot find compilation database", single_case_text.command_text) + return is_sub_string("Cannot find compilation database", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-check-cannot-parse/do_test.py b/behavior_tests/src/ngt-check-cannot-parse/do_test.py index 98db63cd3..012ca7dae 100644 --- a/behavior_tests/src/ngt-check-cannot-parse/do_test.py +++ b/behavior_tests/src/ngt-check-cannot-parse/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " vector_add.cu", single_case_text) - return is_sub_string("Migration not necessary", single_case_text.command_text) + return is_sub_string("Migration not necessary", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-database-notfound/do_test.py b/behavior_tests/src/ngt-database-notfound/do_test.py index f2b2b84cc..24f55c2bc 100644 --- a/behavior_tests/src/ngt-database-notfound/do_test.py +++ b/behavior_tests/src/ngt-database-notfound/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " -p=.", single_case_text) - return is_sub_string("No compilation database found", single_case_text.command_text) + return is_sub_string("No compilation database found", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-file-parsing-err/do_test.py b/behavior_tests/src/ngt-file-parsing-err/do_test.py index 5b8446105..2af233d81 100644 --- a/behavior_tests/src/ngt-file-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-file-parsing-err/do_test.py @@ -20,10 +20,10 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu -stop-on-parse-err --cuda-include-path=" + test_config.include_path, single_case_text) - return (is_sub_string("Cannot parse input file", single_case_text.command_text) - and is_sub_string("Parsing", single_case_text.command_text) - and not is_sub_string("Analyzing", single_case_text.command_text) - and not is_sub_string("Migrating", single_case_text.command_text)) + return (is_sub_string("Cannot parse input file", single_case_text.print_text) + and is_sub_string("Parsing", single_case_text.print_text) + and not is_sub_string("Analyzing", single_case_text.print_text) + and not is_sub_string("Migrating", single_case_text.print_text)) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-format-range/do_test.py b/behavior_tests/src/ngt-format-range/do_test.py index ffaa21b6b..0be547aae 100644 --- a/behavior_tests/src/ngt-format-range/do_test.py +++ b/behavior_tests/src/ngt-format-range/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --format-range=aaa", single_case_text) - return is_sub_string("Cannot find option named", single_case_text.command_text) + return is_sub_string("Cannot find option named", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-format-style/do_test.py b/behavior_tests/src/ngt-format-style/do_test.py index 5e6eed581..4c3df7831 100644 --- a/behavior_tests/src/ngt-format-style/do_test.py +++ b/behavior_tests/src/ngt-format-style/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --format-style=aaa", single_case_text) - return is_sub_string("Cannot find option named", single_case_text.command_text) + return is_sub_string("Cannot find option named", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-in-root-len/do_test.py b/behavior_tests/src/ngt-in-root-len/do_test.py index 4a32dca08..2905506f8 100644 --- a/behavior_tests/src/ngt-in-root-len/do_test.py +++ b/behavior_tests/src/ngt-in-root-len/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ long_path, single_case_text) - return is_sub_string("should be less than", single_case_text.command_text) + return is_sub_string("should be less than", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-in-root-path/do_test.py b/behavior_tests/src/ngt-in-root-path/do_test.py index f2f5284f5..b4a0d627d 100644 --- a/behavior_tests/src/ngt-in-root-path/do_test.py +++ b/behavior_tests/src/ngt-in-root-path/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --in-root=./inroot vector_add.cu", single_case_text) - return is_sub_string("is not under the specified input root directory", single_case_text.command_text) + return is_sub_string("is not under the specified input root directory", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-include-path-len/do_test.py b/behavior_tests/src/ngt-include-path-len/do_test.py index 96562d213..500cfc47f 100644 --- a/behavior_tests/src/ngt-include-path-len/do_test.py +++ b/behavior_tests/src/ngt-include-path-len/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + long_path, single_case_text) - return is_sub_string("should be less than", single_case_text.command_text) + return is_sub_string("should be less than", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py index 667ca1813..8b29b9618 100644 --- a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py +++ b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): shutil.copytree(test_config.include_path, "cc") call_subprocess(test_config.CT_TOOL + " --in-root=./ ./simple_foo.cu --cuda-include-path=./cc", single_case_text) - return is_sub_string("Error: Input folder specified by --in-root or --analysis-scope-path is the parent of, or the same folder", single_case_text.command_text) + return is_sub_string("Error: Input folder specified by --in-root or --analysis-scope-path is the parent of, or the same folder", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py index 314da0483..7b0547761 100644 --- a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py +++ b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=/usr/local/folder-does-not-contain-cuda\" vector_add.cu", single_case_text) - return is_sub_string("Could not detect path to CUDA header files", single_case_text.command_text) + return is_sub_string("Could not detect path to CUDA header files", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py index 5f25e249f..68f82bf88 100644 --- a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py +++ b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --use-experimental-features=logical-group,abc", single_case_text) - return is_sub_string("for the --use-experimental-features option: Cannot find option named \'abc\'!", single_case_text.command_text) + return is_sub_string("for the --use-experimental-features option: Cannot find option named \'abc\'!", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py index 4c3786c1b..8e5e6fd6e 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none,dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) + return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py index 11ef2f6d4..69a040d6a 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,cl,dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) + return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py index 37de04964..6454876c6 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,sycl-math vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.command_text) + return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-inroot/do_test.py b/behavior_tests/src/ngt-invalid-inroot/do_test.py index b5ba08ec8..1baeb6064 100644 --- a/behavior_tests/src/ngt-invalid-inroot/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-root=/notavalidfolder --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("The path for --in-root or --out-root is not valid", single_case_text.command_text) + return is_sub_string("The path for --in-root or --out-root is not valid", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-inroot2/do_test.py b/behavior_tests/src/ngt-invalid-inroot2/do_test.py index d4d5cc9c1..4fccb2365 100644 --- a/behavior_tests/src/ngt-invalid-inroot2/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot2/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-root=/usr/local --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("The path for --in-root is not valid", single_case_text.command_text) + return is_sub_string("The path for --in-root is not valid", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-inroot3/do_test.py b/behavior_tests/src/ngt-invalid-inroot3/do_test.py index c1d57725c..d47e7787e 100644 --- a/behavior_tests/src/ngt-invalid-inroot3/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot3/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-root=C:\Windows --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("The path for --in-root is not valid", single_case_text.command_text) + return is_sub_string("The path for --in-root is not valid", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json1/do_test.py b/behavior_tests/src/ngt-invalid-json1/do_test.py index ca83f968d..d1c24287e 100644 --- a/behavior_tests/src/ngt-invalid-json1/do_test.py +++ b/behavior_tests/src/ngt-invalid-json1/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): f.writelines(ret[1:]) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("Expected array", single_case_text.command_text) + return is_sub_string("Expected array", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json10/do_test.py b/behavior_tests/src/ngt-invalid-json10/do_test.py index 95c32b5f3..69ba8781c 100644 --- a/behavior_tests/src/ngt-invalid-json10/do_test.py +++ b/behavior_tests/src/ngt-invalid-json10/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) + return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json2/do_test.py b/behavior_tests/src/ngt-invalid-json2/do_test.py index 6b3de512b..4f41ff9dd 100644 --- a/behavior_tests/src/ngt-invalid-json2/do_test.py +++ b/behavior_tests/src/ngt-invalid-json2/do_test.py @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("Missing key: \"file\"", single_case_text.command_text) + return is_sub_string("Missing key: \"file\"", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json3/do_test.py b/behavior_tests/src/ngt-invalid-json3/do_test.py index 680e39a69..863a01703 100644 --- a/behavior_tests/src/ngt-invalid-json3/do_test.py +++ b/behavior_tests/src/ngt-invalid-json3/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("Expected Key, Flow Entry, or Flow Mapping End", single_case_text.command_text) + return is_sub_string("Expected Key, Flow Entry, or Flow Mapping End", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json4/do_test.py b/behavior_tests/src/ngt-invalid-json4/do_test.py index 1ddcbbe96..73d08f17c 100644 --- a/behavior_tests/src/ngt-invalid-json4/do_test.py +++ b/behavior_tests/src/ngt-invalid-json4/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): ret.pop(6) f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("Could not find closing ]", single_case_text.command_text) + return is_sub_string("Could not find closing ]", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json5/do_test.py b/behavior_tests/src/ngt-invalid-json5/do_test.py index 1a9dbae00..cae23d777 100644 --- a/behavior_tests/src/ngt-invalid-json5/do_test.py +++ b/behavior_tests/src/ngt-invalid-json5/do_test.py @@ -32,7 +32,7 @@ def migrate_test(single_case_text): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) + return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json6/do_test.py b/behavior_tests/src/ngt-invalid-json6/do_test.py index 5504490d8..0a276c834 100644 --- a/behavior_tests/src/ngt-invalid-json6/do_test.py +++ b/behavior_tests/src/ngt-invalid-json6/do_test.py @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.command_text) + return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json7/do_test.py b/behavior_tests/src/ngt-invalid-json7/do_test.py index 8a9e713bd..9da3ea7e7 100644 --- a/behavior_tests/src/ngt-invalid-json7/do_test.py +++ b/behavior_tests/src/ngt-invalid-json7/do_test.py @@ -32,7 +32,7 @@ def migrate_test(single_case_text): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("Unknown key: \"\"output\"\"", single_case_text.command_text) + return is_sub_string("Unknown key: \"\"output\"\"", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-json8/do_test.py b/behavior_tests/src/ngt-invalid-json8/do_test.py index 5dc799d70..757612392 100644 --- a/behavior_tests/src/ngt-invalid-json8/do_test.py +++ b/behavior_tests/src/ngt-invalid-json8/do_test.py @@ -32,7 +32,7 @@ def migrate_test(single_case_text): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("Unknown key: \"\"arguments\"\"", single_case_text.command_text) + return is_sub_string("Unknown key: \"\"arguments\"\"", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json9/do_test.py b/behavior_tests/src/ngt-invalid-json9/do_test.py index ce5360bb4..00dd113e8 100644 --- a/behavior_tests/src/ngt-invalid-json9/do_test.py +++ b/behavior_tests/src/ngt-invalid-json9/do_test.py @@ -35,7 +35,7 @@ def migrate_test(single_case_text): f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) - return is_sub_string("Processed 1 file(s)", single_case_text.command_text) + return is_sub_string("Processed 1 file(s)", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py index 674ebef79..a4d25bfbd 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu", single_case_text) - return is_sub_string("invalid number", single_case_text.command_text) + return is_sub_string("invalid number", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py index d750cbf41..73deb8e95 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu", single_case_text) - return is_sub_string("invalid number", single_case_text.command_text) + return is_sub_string("invalid number", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py index 6d6ec2178..5dbdcafa3 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu", single_case_text) - return is_sub_string("invalid number", single_case_text.command_text) + return is_sub_string("invalid number", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py index 1ed4968ef..6cbbd420c 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " hello.cu", single_case_text) - return is_sub_string("unknown key \'ColumnLimi\'", single_case_text.command_text) + return is_sub_string("unknown key \'ColumnLimi\'", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py index 618aafc48..ae844df8c 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) - if "error: unknown key \'ConstantFla\'" in single_case_text.command_text: + if "error: unknown key \'ConstantFla\'" in single_case_text.print_text: return True print("not catch the error: unkown key constantFla") return False diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py index f0304b904..187438530 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) - if "Unexpected token. Expected Key or Block End" in single_case_text.command_text: + if "Unexpected token. Expected Key or Block End" in single_case_text.print_text: return True print("not catch the error: unkown key constantFla") return False diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py index 229f5b991..99dec196c 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py @@ -32,8 +32,8 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) - print(single_case_text.command_text) - if "Unexpected token. Expected Key or Block End" in single_case_text.command_text: + print(single_case_text.print_text) + if "Unexpected token. Expected Key or Block End" in single_case_text.print_text: return True print("not catch the error: unkown key constantFla") return False diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py index fc3cce179..521188316 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=./out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"], single_case_text) - if "differnt path" in single_case_text.command_text: + if "differnt path" in single_case_text.print_text: return True print("not catch the error: unkown key constantFla") return False diff --git a/behavior_tests/src/ngt-level-verbosity/do_test.py b/behavior_tests/src/ngt-level-verbosity/do_test.py index d9de80735..3fd002b47 100644 --- a/behavior_tests/src/ngt-level-verbosity/do_test.py +++ b/behavior_tests/src/ngt-level-verbosity/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --usm-level=abc --output-verbositi=abc", single_case_text) - return is_sub_string("Unknown command line argument '--output-verbositi=abc'", single_case_text.command_text) + return is_sub_string("Unknown command line argument '--output-verbositi=abc'", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-no-db-specified/do_test.py b/behavior_tests/src/ngt-no-db-specified/do_test.py index a204682d6..a70755672 100644 --- a/behavior_tests/src/ngt-no-db-specified/do_test.py +++ b/behavior_tests/src/ngt-no-db-specified/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " -in-root=./ -out-root=out -p=./", single_case_text) - return is_sub_string("Error: Cannot find compilation database", single_case_text.command_text) + return is_sub_string("Error: Cannot find compilation database", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py index 476fbdb6b..4ae979f92 100644 --- a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py +++ b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: The option --process-all requires that the", single_case_text.command_text) + return is_sub_string("Error: The option --process-all requires that the", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-no-file-type/do_test.py b/behavior_tests/src/ngt-no-file-type/do_test.py index 836500b5a..82ec12a66 100644 --- a/behavior_tests/src/ngt-no-file-type/do_test.py +++ b/behavior_tests/src/ngt-no-file-type/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("File Type not available for input file", single_case_text.command_text) + return is_sub_string("File Type not available for input file", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-no-source-name/do_test.py b/behavior_tests/src/ngt-no-source-name/do_test.py index 5b4f2c3f1..f9186a083 100644 --- a/behavior_tests/src/ngt-no-source-name/do_test.py +++ b/behavior_tests/src/ngt-no-source-name/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " vector_add", single_case_text) - return is_sub_string("does not have an extension", single_case_text.command_text) + return is_sub_string("does not have an extension", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-opt-parsing-err/do_test.py b/behavior_tests/src/ngt-opt-parsing-err/do_test.py index 235369635..cbc94bfa6 100644 --- a/behavior_tests/src/ngt-opt-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-opt-parsing-err/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-rooooot=/aaa --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Option parsing error", single_case_text.command_text) + return is_sub_string("Option parsing error", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-out-root-len/do_test.py b/behavior_tests/src/ngt-out-root-len/do_test.py index 4a32dca08..2905506f8 100644 --- a/behavior_tests/src/ngt-out-root-len/do_test.py +++ b/behavior_tests/src/ngt-out-root-len/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ long_path, single_case_text) - return is_sub_string("should be less than", single_case_text.command_text) + return is_sub_string("should be less than", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-output-access/do_test.py b/behavior_tests/src/ngt-output-access/do_test.py index f74996adf..4aad00b85 100644 --- a/behavior_tests/src/ngt-output-access/do_test.py +++ b/behavior_tests/src/ngt-output-access/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): os.mkdir("dpct_output") call_subprocess("chmod u-r dpct_output", single_case_text) call_subprocess("dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Could not access output directory", single_case_text.command_text) + return is_sub_string("Could not access output directory", single_case_text.print_text) def build_test(single_case_text): call_subprocess("chmod 777 dpct_output", single_case_text) diff --git a/behavior_tests/src/ngt-output-create/do_test.py b/behavior_tests/src/ngt-output-create/do_test.py index 8fd956e81..09953286f 100644 --- a/behavior_tests/src/ngt-output-create/do_test.py +++ b/behavior_tests/src/ngt-output-create/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Unable to save the output to the specified directory", single_case_text.command_text, single_case_text) + return is_sub_string("Unable to save the output to the specified directory", single_case_text.print_text, single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-output-file-len/do_test.py b/behavior_tests/src/ngt-output-file-len/do_test.py index 73dbbb07b..1a3149a81 100644 --- a/behavior_tests/src/ngt-output-file-len/do_test.py +++ b/behavior_tests/src/ngt-output-file-len/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --output-file=" +long_path, single_case_text) - return is_sub_string("should be less than", single_case_text.command_text) + return is_sub_string("should be less than", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-output-not-empty/do_test.py b/behavior_tests/src/ngt-output-not-empty/do_test.py index 364cfa550..4208d405e 100644 --- a/behavior_tests/src/ngt-output-not-empty/do_test.py +++ b/behavior_tests/src/ngt-output-not-empty/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): with open(os.path.join("dpct_output", "test"), 'w') as f: f.write("2") call_subprocess(test_config.CT_TOOL + " vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("directory is not empty.", single_case_text.command_text) + return is_sub_string("directory is not empty.", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-output-verbosity/do_test.py b/behavior_tests/src/ngt-output-verbosity/do_test.py index 507833746..8fb83a812 100644 --- a/behavior_tests/src/ngt-output-verbosity/do_test.py +++ b/behavior_tests/src/ngt-output-verbosity/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --output-verbosity=abc", single_case_text) - return is_sub_string("--output-verbosity option: Cannot find option named", single_case_text.command_text) + return is_sub_string("--output-verbosity option: Cannot find option named", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-report-file-len/do_test.py b/behavior_tests/src/ngt-report-file-len/do_test.py index 1f2aeadc8..1c253e280 100644 --- a/behavior_tests/src/ngt-report-file-len/do_test.py +++ b/behavior_tests/src/ngt-report-file-len/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=" +long_path, single_case_text) - return is_sub_string("should be less than 128", single_case_text.command_text) + return is_sub_string("should be less than 128", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-report-file-prefix/do_test.py b/behavior_tests/src/ngt-report-file-prefix/do_test.py index 49056e4f6..3cf8079e1 100644 --- a/behavior_tests/src/ngt-report-file-prefix/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=abc:", single_case_text) - return is_sub_string("contains special character ':'", single_case_text.command_text) + return is_sub_string("contains special character ':'", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-report-file-prefix2/do_test.py b/behavior_tests/src/ngt-report-file-prefix2/do_test.py index 64dfc3f50..828b9bc02 100644 --- a/behavior_tests/src/ngt-report-file-prefix2/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix2/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=\"/abc\"", single_case_text) - return is_sub_string("contains special character", single_case_text.command_text) + return is_sub_string("contains special character", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-report-format1/do_test.py b/behavior_tests/src/ngt-report-format1/do_test.py index b1f82eb7d..ac3915542 100644 --- a/behavior_tests/src/ngt-report-format1/do_test.py +++ b/behavior_tests/src/ngt-report-format1/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-format=abc", single_case_text) - return is_sub_string("--report-format option: Cannot find option named", single_case_text.command_text) + return is_sub_string("--report-format option: Cannot find option named", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-report-format2/do_test.py b/behavior_tests/src/ngt-report-format2/do_test.py index dcc0a0ae2..b8f59125c 100644 --- a/behavior_tests/src/ngt-report-format2/do_test.py +++ b/behavior_tests/src/ngt-report-format2/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-format=xx vector_add.cu", single_case_text) - return is_sub_string("--report-format option: Cannot find option named 'xx'!", single_case_text.command_text) + return is_sub_string("--report-format option: Cannot find option named 'xx'!", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-report-type-diags/do_test.py b/behavior_tests/src/ngt-report-type-diags/do_test.py index 546e389fb..440065229 100644 --- a/behavior_tests/src/ngt-report-type-diags/do_test.py +++ b/behavior_tests/src/ngt-report-type-diags/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-type=xxx --report-diags-content=transformation vector_add.cu", single_case_text) - return is_sub_string("--report-type option: Cannot find option named 'xxx'!", single_case_text.command_text) + return is_sub_string("--report-type option: Cannot find option named 'xxx'!", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-report-type/do_test.py b/behavior_tests/src/ngt-report-type/do_test.py index fc1502752..5e05d2d5f 100644 --- a/behavior_tests/src/ngt-report-type/do_test.py +++ b/behavior_tests/src/ngt-report-type/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-type=abc", single_case_text) - return is_sub_string("--report-type option: Cannot find option named", single_case_text.command_text) + return is_sub_string("--report-type option: Cannot find option named", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py index ecbddd9d8..8a17d64d0 100644 --- a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py +++ b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu -report-format=csv -report-file-prefix=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Prefix is too long", single_case_text.command_text) + return is_sub_string("Prefix is too long", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py index 4201cffd0..34f69e932 100644 --- a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py +++ b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): call_subprocess("mkdir ./read_only_folder", single_case_text) call_subprocess("chmod 0444 ./read_only_folder", single_case_text) call_subprocess(test_config.CT_TOOL + " simple_foo.cu --out-root=./read_only_folder --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Unable to save the output to the specified directory", single_case_text.command_text) + return is_sub_string("Unable to save the output to the specified directory", single_case_text.print_text) def build_test(single_case_text): call_subprocess("rm -rf ./read_only_folder", single_case_text) call_subprocess("chmod 0777 ./read_only_folder", single_case_text) diff --git a/behavior_tests/src/ngt-show-help/do_test.py b/behavior_tests/src/ngt-show-help/do_test.py index 14c170a5d..dc94102e8 100644 --- a/behavior_tests/src/ngt-show-help/do_test.py +++ b/behavior_tests/src/ngt-show-help/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL, single_case_text) - return is_sub_string("To get help on the tool usage", single_case_text.command_text) + return is_sub_string("To get help on the tool usage", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py index 476fbdb6b..4ae979f92 100644 --- a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py +++ b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Error: The option --process-all requires that the", single_case_text.command_text) + return is_sub_string("Error: The option --process-all requires that the", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py index cda9da415..b253eb40e 100644 --- a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py +++ b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --stop-on-parse-err vector_add.cu", single_case_text) - return is_sub_string("Cannot parse input", single_case_text.command_text) + return is_sub_string("Cannot parse input", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings1/do_test.py b/behavior_tests/src/ngt-suppress-warnings1/do_test.py index 12bc5f622..ea95ef28b 100644 --- a/behavior_tests/src/ngt-suppress-warnings1/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings1/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=100e", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings10/do_test.py b/behavior_tests/src/ngt-suppress-warnings10/do_test.py index 7a98811c3..a46f0aa34 100644 --- a/behavior_tests/src/ngt-suppress-warnings10/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings10/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1000-1900", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings11/do_test.py b/behavior_tests/src/ngt-suppress-warnings11/do_test.py index 68e4fc66c..0e7bb96be 100644 --- a/behavior_tests/src/ngt-suppress-warnings11/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings11/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1010-1020-1023", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings2/do_test.py b/behavior_tests/src/ngt-suppress-warnings2/do_test.py index 67ca56480..37da5aa7e 100644 --- a/behavior_tests/src/ngt-suppress-warnings2/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings2/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess( test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ " --suppress-warnings=999", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings3/do_test.py b/behavior_tests/src/ngt-suppress-warnings3/do_test.py index 6af08b97e..373bedd7e 100644 --- a/behavior_tests/src/ngt-suppress-warnings3/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings3/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1900", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings4/do_test.py b/behavior_tests/src/ngt-suppress-warnings4/do_test.py index 341aa494e..ed996a222 100644 --- a/behavior_tests/src/ngt-suppress-warnings4/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings4/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=-1000", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings5/do_test.py b/behavior_tests/src/ngt-suppress-warnings5/do_test.py index 9f930f378..3fbcea056 100644 --- a/behavior_tests/src/ngt-suppress-warnings5/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings5/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1000-", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-suppress-warnings6/do_test.py b/behavior_tests/src/ngt-suppress-warnings6/do_test.py index e864663df..639055648 100644 --- a/behavior_tests/src/ngt-suppress-warnings6/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings6/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=999-1023", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings7/do_test.py b/behavior_tests/src/ngt-suppress-warnings7/do_test.py index fff619084..bc214a452 100644 --- a/behavior_tests/src/ngt-suppress-warnings7/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings7/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=100e-1023", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings8/do_test.py b/behavior_tests/src/ngt-suppress-warnings8/do_test.py index fff619084..bc214a452 100644 --- a/behavior_tests/src/ngt-suppress-warnings8/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings8/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=100e-1023", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-suppress-warnings9/do_test.py b/behavior_tests/src/ngt-suppress-warnings9/do_test.py index 2fdf2fc12..f6520d4fc 100644 --- a/behavior_tests/src/ngt-suppress-warnings9/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings9/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --suppress-warnings=1010-1020-1023", single_case_text) - return is_sub_string("Invalid warning ID or range:", single_case_text.command_text) + return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py index 4e1cf4eed..af5b95124 100644 --- a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py +++ b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --use-dpcpp-extensions=abc", single_case_text) - return is_sub_string("Cannot find option named 'abc'", single_case_text.command_text) + return is_sub_string("Cannot find option named 'abc'", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-usm-leve/do_test.py b/behavior_tests/src/ngt-usm-leve/do_test.py index 5471e3ee1..0a4ae653e 100644 --- a/behavior_tests/src/ngt-usm-leve/do_test.py +++ b/behavior_tests/src/ngt-usm-leve/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --usm-leve=abc", single_case_text) - return is_sub_string("Unknown command line argument '--usm-leve=abc'", single_case_text.command_text) + return is_sub_string("Unknown command line argument '--usm-leve=abc'", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-usm-level/do_test.py b/behavior_tests/src/ngt-usm-level/do_test.py index ea4f8a12f..9bd4b7de5 100644 --- a/behavior_tests/src/ngt-usm-level/do_test.py +++ b/behavior_tests/src/ngt-usm-level/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ " --usm-level=abc", single_case_text) - return is_sub_string("--usm-level option: Cannot find option named 'abc'", single_case_text.command_text) + return is_sub_string("--usm-level option: Cannot find option named 'abc'", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py index 903575147..b8a96615e 100644 --- a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --vcxprojfile=aaa.vcxproj --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Cannot Open VcxprojFile", single_case_text.command_text) + return is_sub_string("Cannot Open VcxprojFile", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py index 48746856f..2e5b8843f 100644 --- a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): source_path = os.path.join(os.getcwd(), "source", "simple_foo.cu") call_subprocess(test_config.CT_TOOL + " " + source_path + " --vcxprojfile=\"" + vcxproj_path + "\" --cuda-include-path=" + test_config.include_path, single_case_text) call_subprocess("icacls ./source /grant Everyone\:\(WD\)", single_case_text) - return is_sub_string("Cannot create CompilationDatabase", single_case_text.command_text) + return is_sub_string("Cannot create CompilationDatabase", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py index 35dda2b68..6179b8c76 100644 --- a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"], single_case_text) - if "differnt path" in single_case_text.command_text: + if "differnt path" in single_case_text.print_text: return True print("not catch the error: unkown key constantFla") return False diff --git a/behavior_tests/src/ngti-cdb-path-len/do_test.py b/behavior_tests/src/ngti-cdb-path-len/do_test.py index 1cb221eac..46c5ee069 100644 --- a/behavior_tests/src/ngti-cdb-path-len/do_test.py +++ b/behavior_tests/src/ngti-cdb-path-len/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): os.path.join(long_path, "name") call_subprocess("intercept-build --cdb " + long_path, single_case_text) - return is_sub_string("File name", single_case_text.command_text) + return is_sub_string("File name", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngti-empty-make/do_test.py b/behavior_tests/src/ngti-empty-make/do_test.py index 4054b9f64..82bfeffbc 100644 --- a/behavior_tests/src/ngti-empty-make/do_test.py +++ b/behavior_tests/src/ngti-empty-make/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess("intercept-build make", single_case_text) - return is_sub_string("No targets", single_case_text.command_text) + return is_sub_string("No targets", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/ngtn-database-fail/do_test.py b/behavior_tests/src/ngtn-database-fail/do_test.py index 0f45f6c85..9f0d1c690 100644 --- a/behavior_tests/src/ngtn-database-fail/do_test.py +++ b/behavior_tests/src/ngtn-database-fail/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " -p=. -in-root=./ -out-root=out", single_case_text) - return is_sub_string("Cannot parse compilation database", single_case_text.command_text) + return is_sub_string("Cannot parse compilation database", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/path_validation_0/do_test.py b/behavior_tests/src/path_validation_0/do_test.py index ccdfa7c48..792d67779 100644 --- a/behavior_tests/src/path_validation_0/do_test.py +++ b/behavior_tests/src/path_validation_0/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst", single_case_text) call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("is not under the specified input root directory", single_case_text.command_text) + return is_sub_string("is not under the specified input root directory", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/path_validation_1/do_test.py b/behavior_tests/src/path_validation_1/do_test.py index 69d4ec280..732c4eb75 100644 --- a/behavior_tests/src/path_validation_1/do_test.py +++ b/behavior_tests/src/path_validation_1/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst", single_case_text) call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/rootdir/../test.cu --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("is not under the specified input root directory", single_case_text.command_text) + return is_sub_string("is not under the specified input root directory", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/features/feature_case/backprop/do_test.py b/features/feature_case/backprop/do_test.py index 0c0a45382..359e5155d 100644 --- a/features/feature_case/backprop/do_test.py +++ b/features/feature_case/backprop/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " -out-root=./ backprop.c --cuda-include-path=" + test_config.include_path + " --", single_case_text) - return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.command_text) + return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.print_text) def build_test(single_case_text): return True def run_test(single_case_text): diff --git a/help_function/test_help.py b/help_function/test_help.py index c3468bfd0..1be43b0aa 100644 --- a/help_function/test_help.py +++ b/help_function/test_help.py @@ -110,7 +110,7 @@ def run_test(single_case_text): args.append("./module.dll") os.environ['CL_CONFIG_CPU_EXPERIMENTAL_FP16']="1" ret = run_binary_with_args(single_case_text, args) - if single_case_text.name == "async_exception" and "Caught asynchronous SYCL exception" in single_case_text.command_text and "test_dpct_async_handler" in single_case_text.command_text: + if single_case_text.name == "async_exception" and "Caught asynchronous SYCL exception" in single_case_text.print_text and "test_dpct_async_handler" in single_case_text.print_text: return True return ret diff --git a/run_test.py b/run_test.py index 795d5e533..806d1dfca 100644 --- a/run_test.py +++ b/run_test.py @@ -76,6 +76,7 @@ def __init__(self, case_name, command_file = "", command_text = "", log_file = " self.print_text = print_text self.test_status = "BADTEST" self.out_root = "" + self.run_flag = False def parse_suite_cfg(suite_name, root_path): @@ -246,7 +247,7 @@ def run_test_driver(module, single_case_text): single_case_text.result_text += single_case_text.name + " " + single_case_text.test_status + "\n" single_case_text.log_text += "------------------------------------------------------------------------\n\n" + \ "=================== "+ single_case_text.name + " is " + single_case_text.test_status + " ======================\n " - print_result(single_case_text) + print_result(single_case_text, single_case_text.print_text) return ret_val # To do: if the API was enabled in CUDA 9.2 version but deprecated in the CUDA 11.4 version, @@ -290,7 +291,10 @@ def is_option_supported(option_rule_list): return False return True -def test_single_case(current_test, single_case_config, workspace, suite_root_path, single_case_text): +def test_single_case(current_test, single_case_config, workspace, suite_root_path): + single_case_text = case_text(current_test, os.path.join(workspace, "command.tst"),"", + os.path.join(workspace, current_test, current_test + ".lf"), "", + os.path.join(workspace, "result.md"), "", "") module = import_test_driver(suite_root_path) if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list): single_case_text.result_text += current_test + " Skip " + "\n" @@ -309,13 +313,12 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa # test_config.log_file = os.path.join(workspace, current_test + ".lf") copy_source_to_ws(single_case_config.test_dep_files, case_workspace, suite_root_path) - return run_test_driver(module, single_case_text) + single_case_text.run_flag = run_test_driver(module, single_case_text) + return single_case_text def prepare_test_workspace(root_path, suite_name, opt, case = ""): suite_workspace = os.path.join(os.path.abspath(root_path), suite_name, opt) case_workspace = os.path.join(suite_workspace, case) - test_config.command_file = os.path.join(suite_workspace, "command.tst") - test_config.result_text = os.path.join(suite_workspace, "result.md") if os.path.isdir(suite_workspace) and not case: shutil.rmtree(suite_workspace) @@ -339,11 +342,17 @@ def get_gpu_split_test_suite(suite_cfg): return new_test_config_map def record_msg_case(single_case_text): - if single_case_text.test_status is not "BADTEST": - append_msg_to_file(single_case_text.command_file, single_case_text.command_text) - ppend_msg_to_file(single_case_text.log_file, single_case_text.log_text) + # print(single_case_text.result_file) + # print(single_case_text.result_text) append_msg_to_file(single_case_text.result_file, single_case_text.result_text) - print(single_case_text.print_text) + if single_case_text.test_status is "BADTEST": + return + # print(single_case_text.command_file) + # print(single_case_text.command_text) + append_msg_to_file(single_case_text.command_file, single_case_text.command_text) + # print(single_case_text.log_file) + # print(single_case_text.log_text) + append_msg_to_file(single_case_text.log_file, single_case_text.log_text) return def test_suite(suite_root_path, suite_name, opt): @@ -360,22 +369,29 @@ def test_suite(suite_root_path, suite_name, opt): results = [] for current_test, single_case_config in test_config.suite_cfg.test_config_map.items(): - single_case_text = case_text(current_test, os.path.join(test_workspace, "command.tst"),"", - os.path.join(test_workspace, current_test, current_test + ".lf"), "", - os.path.join(test_workspace, "result.md"), "", "") + # print(os.path.join(test_workspace, "command.tst")) + # print(os.path.join(test_workspace, "result.md")) + # single_case_text = case_text(current_test, os.path.join(test_workspace, "command.tst"),"", + # os.path.join(test_workspace, current_test, current_test + ".lf"), "", + # os.path.join(test_workspace, "result.md"), "", "") + # print(single_case_text.command_file) + # print(single_case_text.result_file) + # sys.exit(0) result = pool.apply_async(test_single_case, (current_test, single_case_config, test_workspace, - suite_root_path, single_case_text,)) + suite_root_path,)) # store all msg - results.append([result, current_test, single_case_config, test_workspace, suite_root_path, single_case_text]) - # ret = test_single_case(current_test, single_case_config, test_workspace, module, suite_root_path) - + results.append([result, current_test, single_case_config, test_workspace, suite_root_path]) + + # close process pool and wait all work being flinish + pool.close() + pool.join() for result_iter in results: ret = result_iter[0].get() - record_msg_case(result_iter[5]) - if not ret: + record_msg_case(ret) + if not ret.run_flag: # TODO we can add auto rerun - failed_cases.append(current_test + " " + result_iter[5].test_status) - suite_result = ret & suite_result + failed_cases.append(ret.name + " " + ret.test_status) + suite_result = ret.run_flag & suite_result if failed_cases: print("===============Failed case(s) ==========================") @@ -394,13 +410,10 @@ def test_single_case_in_suite(suite_root_path, suite_name, case, option): exit("The test case " + case + " is not in the " + suite_name + " test suite! Please double check.") single_case_config = suite_cfg.test_config_map[case] # create single_case_text to store result msg - single_case_text = case_text(case, os.path.join(test_workspace, "command.tst"),"", - os.path.join(test_workspace, case, case + ".lf"), "", - os.path.join(test_workspace, "result.md"), "", "") - ret = test_single_case(case, single_case_config, test_workspace, suite_root_path, single_case_text) + single_case_text = test_single_case(case, single_case_config, test_workspace, suite_root_path) # print(single_case_text.name) # print(single_case_text.command_file) - # print(single_case_text.command_text) + # print(single_case_text.print_text) # print(single_case_text.log_file) # print(single_case_text.log_text) # print(single_case_text.result_file) @@ -409,7 +422,7 @@ def test_single_case_in_suite(suite_root_path, suite_name, case, option): # print(single_case_text.test_status) # print(single_case_text.out_root) record_msg_case(single_case_text) - return ret + return single_case_text.run_flag # Before run the test: diff --git a/test_utils.py b/test_utils.py index 460e41e95..e1ebadd56 100644 --- a/test_utils.py +++ b/test_utils.py @@ -37,7 +37,7 @@ def call_subprocess(cmd, single_case_text): complete_process = subprocess.run(cmd, shell=run_on_shell, check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding="utf-8", timeout=test_config.timeout) - single_case_text.command_output = complete_process.stdout + single_case_text.print_text = complete_process.stdout f.write(complete_process.stdout) except subprocess.TimeoutExpired: f.write("========= Execution time out(" + str(test_config.timeout) + "s) Please check. ======") @@ -131,9 +131,9 @@ def prepare_oneDPL_specific_macro(single_case_text): if (platform.system() == 'Windows'): return '' call_subprocess('gcc -dumpversion', single_case_text) - if ('9' in single_case_text.command_output): + if ('9' in single_case_text.print_text): return "-DPSTL_USE_PARALLEL_POLICIES=0" - elif ('10' in single_case_text.command_output): + elif ('10' in single_case_text.print_text): return "-D_GLIBCXX_USE_TBB_PAR_BACKEND=0" return "" @@ -182,14 +182,14 @@ def is_registered_module(test_case_workspace): return False # Print the failed test result and details in the screen. -def print_result(single_case_text): +def print_result(single_case_text, detail_log): print("============= " + single_case_text.name + ": " + single_case_text.test_status + " ==================\n") call_subprocess("sycl-ls", single_case_text) print("========== Device Runtime Info: ===============") - print(single_case_text.command_output) + print(single_case_text.print_text) print("=============================================\n") - print("----------------------------\n" + single_case_text.command_output + print("----------------------------\n" + detail_log + "\n----------------------\n") def is_sub_string(substr, fullstr): diff --git a/user_guide_samples/test_guide.py b/user_guide_samples/test_guide.py index a9508a57f..b10d6057b 100644 --- a/user_guide_samples/test_guide.py +++ b/user_guide_samples/test_guide.py @@ -30,6 +30,6 @@ def run_test(single_case_text): options = " \" \"" os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter call_subprocess("python " + test_driver + options, single_case_text) - if "case pass" in single_case_text.command_text: + if "case pass" in single_case_text.print_text: return True return False From 4d6ff72e2830f93befb6cfe24e208d9cf4172c15 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Mon, 3 Jul 2023 14:27:27 +0800 Subject: [PATCH 04/10] pass feature test Signed-off-by: Ni, Wenhui --- run_test.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/run_test.py b/run_test.py index 806d1dfca..1844cdedd 100644 --- a/run_test.py +++ b/run_test.py @@ -74,7 +74,7 @@ def __init__(self, case_name, command_file = "", command_text = "", log_file = " self.result_file = result_file self.result_text = result_text self.print_text = print_text - self.test_status = "BADTEST" + self.test_status = "SKIPPED" self.out_root = "" self.run_flag = False @@ -299,12 +299,14 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list): single_case_text.result_text += current_test + " Skip " + "\n" # append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") - return True + single_case_text.run_flag = True + return single_case_text if single_case_config.option_rule_list and not is_option_supported(single_case_config.option_rule_list): single_case_text.result_text += current_test + " Skip " + "\n" # append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") - return True + single_case_text.run_flag = True + return single_case_text case_workspace = os.path.join(workspace, current_test) if not os.path.exists(case_workspace): @@ -345,7 +347,7 @@ def record_msg_case(single_case_text): # print(single_case_text.result_file) # print(single_case_text.result_text) append_msg_to_file(single_case_text.result_file, single_case_text.result_text) - if single_case_text.test_status is "BADTEST": + if single_case_text.test_status == "BADTEST" or single_case_text.test_status == "SKIPPED": return # print(single_case_text.command_file) # print(single_case_text.command_text) @@ -381,10 +383,7 @@ def test_suite(suite_root_path, suite_name, opt): suite_root_path,)) # store all msg results.append([result, current_test, single_case_config, test_workspace, suite_root_path]) - - # close process pool and wait all work being flinish - pool.close() - pool.join() + for result_iter in results: ret = result_iter[0].get() record_msg_case(ret) @@ -392,6 +391,8 @@ def test_suite(suite_root_path, suite_name, opt): # TODO we can add auto rerun failed_cases.append(ret.name + " " + ret.test_status) suite_result = ret.run_flag & suite_result + pool.close() + pool.join() if failed_cases: print("===============Failed case(s) ==========================") From 7211a3e06484d5f15adeb59dd40f2892e2fe8b6d Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Mon, 3 Jul 2023 15:35:26 +0800 Subject: [PATCH 05/10] pass all test Signed-off-by: Ni, Wenhui --- behavior_tests/src/bt-autocomplete/do_test.py | 2 +- behavior_tests/src/bt-cdb-default-out-folder/do_test.py | 2 +- behavior_tests/src/bt-format-range/do_test.py | 2 +- behavior_tests/src/execute_from_cuda_path/do_test.py | 2 +- behavior_tests/src/ngt-invalid-json1/do_test.py | 4 ++-- behavior_tests/src/ngt-invalid-json6/do_test.py | 2 +- behavior_tests/src/ngt-invalid-json8/do_test.py | 4 ++-- behavior_tests/src/ngt-output-create/do_test.py | 2 +- run_test.py | 8 +++++--- test_config.py | 2 +- 10 files changed, 16 insertions(+), 14 deletions(-) diff --git a/behavior_tests/src/bt-autocomplete/do_test.py b/behavior_tests/src/bt-autocomplete/do_test.py index 30635a9d9..6ccab6749 100644 --- a/behavior_tests/src/bt-autocomplete/do_test.py +++ b/behavior_tests/src/bt-autocomplete/do_test.py @@ -27,7 +27,7 @@ def migrate_test(single_case_text): reference = '-gen-build-script\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=foo") + call_subprocess(test_config.CT_TOOL + " --autocomplete=foo", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) diff --git a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py index 9a81bd84b..891286b5a 100644 --- a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess("intercept-build /usr/bin/make") + call_subprocess("intercept-build /usr/bin/make", single_case_text) in_root = "" extra_args = "" return call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + diff --git a/behavior_tests/src/bt-format-range/do_test.py b/behavior_tests/src/bt-format-range/do_test.py index 4f920607c..eb63424a5 100644 --- a/behavior_tests/src/bt-format-range/do_test.py +++ b/behavior_tests/src/bt-format-range/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): os.mkdir("out_migrated") os.mkdir("out_all") os.mkdir("out_none") - call_subprocess(test_config.CT_TOOL + " --format-range=migrated --out-root=./out_migrated vector_add.cu --cuda-include-path=" + test_config.include_path) + call_subprocess(test_config.CT_TOOL + " --format-range=migrated --out-root=./out_migrated vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) call_subprocess(test_config.CT_TOOL + " --format-range=all --out-root=./out_all vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) call_subprocess(test_config.CT_TOOL + " -format-range=none --out-root=./out_none vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) diff --git a/behavior_tests/src/execute_from_cuda_path/do_test.py b/behavior_tests/src/execute_from_cuda_path/do_test.py index 84fd71ea8..9bd16d9e5 100644 --- a/behavior_tests/src/execute_from_cuda_path/do_test.py +++ b/behavior_tests/src/execute_from_cuda_path/do_test.py @@ -27,7 +27,7 @@ def migrate_test(single_case_text): src =os.path.join("include", "vector_types.h") in_root = "" extra_args = "" - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=./include " + src) + call_subprocess(test_config.CT_TOOL + " --cuda-include-path=./include " + src, single_case_text) print("hello" + single_case_text.print_text, single_case_text) if ('option is in the CUDA_PATH folder' in single_case_text.print_text): return True diff --git a/behavior_tests/src/ngt-invalid-json1/do_test.py b/behavior_tests/src/ngt-invalid-json1/do_test.py index d1c24287e..47feb565f 100644 --- a/behavior_tests/src/ngt-invalid-json1/do_test.py +++ b/behavior_tests/src/ngt-invalid-json1/do_test.py @@ -21,12 +21,12 @@ def setup_test(single_case_text): def migrate_test(single_case_text): data = [] ret = [] - with open("compile_commands.json", 'r') as f: + with open(os.path.join(single_case_text.case_workspace, "compile_commands.json"), 'r') as f: data = f.readlines() for line in data: line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\")) ret.append(line) - with open("compile_commands.json", 'w') as f: + with open(os.path.join(single_case_text.case_workspace, "compile_commands.json"), 'w') as f: f.writelines(ret[1:]) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) diff --git a/behavior_tests/src/ngt-invalid-json6/do_test.py b/behavior_tests/src/ngt-invalid-json6/do_test.py index 0a276c834..1a1726ad7 100644 --- a/behavior_tests/src/ngt-invalid-json6/do_test.py +++ b/behavior_tests/src/ngt-invalid-json6/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): data = [] ret = [] - with open("compile_commands.json", 'r') as f: + with open(os.path.join(single_case_text.case_workspace, "compile_commands.json"), 'r') as f: data = f.readlines() for line in data: line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\")) diff --git a/behavior_tests/src/ngt-invalid-json8/do_test.py b/behavior_tests/src/ngt-invalid-json8/do_test.py index 757612392..0bad753d7 100644 --- a/behavior_tests/src/ngt-invalid-json8/do_test.py +++ b/behavior_tests/src/ngt-invalid-json8/do_test.py @@ -21,14 +21,14 @@ def setup_test(single_case_text): def migrate_test(single_case_text): data = [] ret = [] - with open("compile_commands.json", 'r') as f: + with open(os.path.join(single_case_text.case_workspace, "compile_commands.json"), 'r') as f: data = f.readlines() for line in data: if "directory_placeholder" in line: ret.append(" \"arguments\": [\"nvcc hello_aaa.c\"],\n") line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\")) ret.append(line) - with open("compile_commands.json", 'w') as f: + with open(os.path.join(single_case_text.case_workspace, "compile_commands.json"), 'w') as f: f.writelines(ret) call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) diff --git a/behavior_tests/src/ngt-output-create/do_test.py b/behavior_tests/src/ngt-output-create/do_test.py index 09953286f..b287d8232 100644 --- a/behavior_tests/src/ngt-output-create/do_test.py +++ b/behavior_tests/src/ngt-output-create/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess(test_config.CT_TOOL + " vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) - return is_sub_string("Unable to save the output to the specified directory", single_case_text.print_text, single_case_text) + return is_sub_string("Unable to save the output to the specified directory", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/run_test.py b/run_test.py index 1844cdedd..8d10dcd9d 100644 --- a/run_test.py +++ b/run_test.py @@ -77,6 +77,7 @@ def __init__(self, case_name, command_file = "", command_text = "", log_file = " self.test_status = "SKIPPED" self.out_root = "" self.run_flag = False + self.case_workspace = "" def parse_suite_cfg(suite_name, root_path): @@ -206,7 +207,8 @@ def run_test_driver(module, single_case_text): # with open(test_config.command_file, "a+") as f: # f.write("================= " + single_case_text.name + " ==================\n") single_case_text.command_text += "================= " + single_case_text.name + " ==================\n" - case_workspace = os.path.join(os.path.dirname(single_case_text.result_text), single_case_text.name) + + case_workspace = single_case_text.case_workspace single_case_text.test_status = "" ret_val = True specific_module = "" @@ -293,7 +295,7 @@ def is_option_supported(option_rule_list): def test_single_case(current_test, single_case_config, workspace, suite_root_path): single_case_text = case_text(current_test, os.path.join(workspace, "command.tst"),"", - os.path.join(workspace, current_test, current_test + ".lf"), "", + os.path.join(workspace, current_test + ".lf"), "", os.path.join(workspace, "result.md"), "", "") module = import_test_driver(suite_root_path) if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list): @@ -309,6 +311,7 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa return single_case_text case_workspace = os.path.join(workspace, current_test) + single_case_text.case_workspace = case_workspace if not os.path.exists(case_workspace): os.makedirs(case_workspace) os.chdir(workspace) @@ -320,7 +323,6 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa def prepare_test_workspace(root_path, suite_name, opt, case = ""): suite_workspace = os.path.join(os.path.abspath(root_path), suite_name, opt) - case_workspace = os.path.join(suite_workspace, case) if os.path.isdir(suite_workspace) and not case: shutil.rmtree(suite_workspace) diff --git a/test_config.py b/test_config.py index 59b1195f0..7dfc1ef68 100644 --- a/test_config.py +++ b/test_config.py @@ -26,7 +26,7 @@ # command_output = "" cuda_ver = 0 # CUDA header file version. # test_status = "" # the test case execution status: MIGFAIL, COMPFAIL, RUNFAIL, SKIPPED or PASS. -# test_option = "" # Ref the option_mapping.json file table. +test_option = "" # Ref the option_mapping.json file table. # failed_message = "" # test_driver = "" # suite_cfg = "" # Parsed from .xml. From cccf90eec5e12bddd0fd18008a49543047d6e070 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Mon, 3 Jul 2023 15:38:12 +0800 Subject: [PATCH 06/10] remove code comments and debug code Signed-off-by: Ni, Wenhui --- run_test.py | 41 ----------------------------------------- test_config.py | 14 -------------- test_utils.py | 5 ----- 3 files changed, 60 deletions(-) diff --git a/run_test.py b/run_test.py index 8d10dcd9d..f7b6811a7 100644 --- a/run_test.py +++ b/run_test.py @@ -204,8 +204,6 @@ def run_migrated_binary_test(test_driver_module, specific_module, single_case_te # Execute the test driver to do the validation. def run_test_driver(module, single_case_text): - # with open(test_config.command_file, "a+") as f: - # f.write("================= " + single_case_text.name + " ==================\n") single_case_text.command_text += "================= " + single_case_text.name + " ==================\n" case_workspace = single_case_text.case_workspace @@ -300,13 +298,11 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa module = import_test_driver(suite_root_path) if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list): single_case_text.result_text += current_test + " Skip " + "\n" - # append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") single_case_text.run_flag = True return single_case_text if single_case_config.option_rule_list and not is_option_supported(single_case_config.option_rule_list): single_case_text.result_text += current_test + " Skip " + "\n" - # append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n") single_case_text.run_flag = True return single_case_text @@ -346,22 +342,15 @@ def get_gpu_split_test_suite(suite_cfg): return new_test_config_map def record_msg_case(single_case_text): - # print(single_case_text.result_file) - # print(single_case_text.result_text) append_msg_to_file(single_case_text.result_file, single_case_text.result_text) if single_case_text.test_status == "BADTEST" or single_case_text.test_status == "SKIPPED": return - # print(single_case_text.command_file) - # print(single_case_text.command_text) append_msg_to_file(single_case_text.command_file, single_case_text.command_text) - # print(single_case_text.log_file) - # print(single_case_text.log_text) append_msg_to_file(single_case_text.log_file, single_case_text.log_text) return def test_suite(suite_root_path, suite_name, opt): test_ws_root = os.path.join(os.path.dirname(suite_root_path), "test_workspace") - # module means the test driver for a test suite. test_config.suite_cfg = parse_suite_cfg(suite_name, suite_root_path) test_workspace = prepare_test_workspace(test_ws_root, suite_name, opt) suite_result = True @@ -373,14 +362,6 @@ def test_suite(suite_root_path, suite_name, opt): results = [] for current_test, single_case_config in test_config.suite_cfg.test_config_map.items(): - # print(os.path.join(test_workspace, "command.tst")) - # print(os.path.join(test_workspace, "result.md")) - # single_case_text = case_text(current_test, os.path.join(test_workspace, "command.tst"),"", - # os.path.join(test_workspace, current_test, current_test + ".lf"), "", - # os.path.join(test_workspace, "result.md"), "", "") - # print(single_case_text.command_file) - # print(single_case_text.result_file) - # sys.exit(0) result = pool.apply_async(test_single_case, (current_test, single_case_config, test_workspace, suite_root_path,)) # store all msg @@ -412,18 +393,7 @@ def test_single_case_in_suite(suite_root_path, suite_name, case, option): if case not in suite_cfg.test_config_map.keys(): exit("The test case " + case + " is not in the " + suite_name + " test suite! Please double check.") single_case_config = suite_cfg.test_config_map[case] - # create single_case_text to store result msg single_case_text = test_single_case(case, single_case_config, test_workspace, suite_root_path) - # print(single_case_text.name) - # print(single_case_text.command_file) - # print(single_case_text.print_text) - # print(single_case_text.log_file) - # print(single_case_text.log_text) - # print(single_case_text.result_file) - # print(single_case_text.result_text) - # print(single_case_text.print_text) - # print(single_case_text.test_status) - # print(single_case_text.out_root) record_msg_case(single_case_text) return single_case_text.run_flag @@ -459,16 +429,6 @@ def import_test_driver(suite_folder): test_config.test_driver = str(test_driver.get("driverID")) return importlib.import_module(test_config.test_driver) -# def clean_global_setting(): -# single_case_text.name = "" -# test_config.command_file = "" # Used to store the executed command. -# test_config.log_file = "" # Used to store the executed log for each case. -# test_config.result_text = "" # Used to store the executed status for each case. -# single_case_text.out_root = "" -# test_config.subprocess_stdout_log = "" -# test_config.test_status = "" # Default: "SKIPPED" -# test_config.test_driver = "" - # Parse the test suite configuration file and get the supported suite list. def get_suite_list(): xml_file = test_config.suite_list_file @@ -506,7 +466,6 @@ def test_suite_with_opts(suite_root_path, suite_name, opts): def test_full_suite_list(suite_list): ret = True for suite_name in suite_list: - # clean_global_setting() os.chdir(test_config.root_path) suite_root_path = suite_list[suite_name][0] if os.path.exists(suite_root_path): diff --git a/test_config.py b/test_config.py index 7dfc1ef68..f45e53c0a 100644 --- a/test_config.py +++ b/test_config.py @@ -13,25 +13,11 @@ CT_TOOL = "dpct" # The migration tool binary name PYTHON_COM = "python3 " suite_list_file = "test_suite_list.xml" # The configuration file lists all the suite to run and corresponding options. - VERBOSE_LEVEL = 0 # Debug verbose level: 0: silent all the debug information. None 0: turn on all the debug information. - -# current_test = "" # The name of current test. The test driver will automatically set a name for current test, if the current test is empty. -# command_file = "" # Used to store the execution command. -# log_file = "" # Default: /[test name].lf -# result_text = "" # Default: /result.md include_path = "" # Specify the CUDA header file path. - -# out_root = "" -# command_output = "" cuda_ver = 0 # CUDA header file version. -# test_status = "" # the test case execution status: MIGFAIL, COMPFAIL, RUNFAIL, SKIPPED or PASS. test_option = "" # Ref the option_mapping.json file table. -# failed_message = "" -# test_driver = "" -# suite_cfg = "" # Parsed from .xml. migrate_option = "" -# workspace = "" option_map = "" # Option mapping table. Ref: option_mapping.json root_path = "" # The root path of test repo. timeout = 1200 # The time limit for each test case. diff --git a/test_utils.py b/test_utils.py index e1ebadd56..237a6bde9 100644 --- a/test_utils.py +++ b/test_utils.py @@ -26,8 +26,6 @@ # Call subprocess to run migration, build and test binary. Store the command and execution result to # command.tst and result.md. def call_subprocess(cmd, single_case_text): - # with open(test_config.command_file, 'a+') as f: - # f.write(cmd + "\n") single_case_text.command_text += cmd + "\n" with open(single_case_text.log_file, 'a+') as f: try: @@ -48,9 +46,6 @@ def call_subprocess(cmd, single_case_text): def change_dir(dir, single_case_text): cmd = "cd " + dir - - # with open(test_config.command_file, 'a+') as f: - # f.write(cmd + "\n") single_case_text.command_text += cmd + "\n" if os.path.exists(dir): os.chdir(dir) From f08c6e0dbcd172dfbd0007c5de6dda1271057173 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Mon, 3 Jul 2023 23:46:27 +0800 Subject: [PATCH 07/10] fix windows Signed-off-by: Ni, Wenhui --- behavior_tests/src/array_size_fold/do_test.py | 2 +- behavior_tests/src/bad_input_1/do_test.py | 2 +- .../src/bt-analysis-scope-path1/do_test.py | 2 +- .../src/bt-analysis-scope-path2/do_test.py | 2 +- .../src/bt-analysis-scope-path3/do_test.py | 2 +- .../src/bt-analysis-scope-path4/do_test.py | 2 +- behavior_tests/src/bt-autocomplete/do_test.py | 44 +++++++++---------- .../src/bt-cdb-default-out-folder/do_test.py | 4 +- .../bt-check-conflict-insertion/do_test.py | 4 +- .../bt-check-unexpected-message/do_test.py | 2 +- .../src/bt-check-warning1083/do_test.py | 2 +- behavior_tests/src/bt-comments/do_test.py | 2 +- .../do_test.py | 4 +- .../bt-extra-arg-comma-separate/do_test.py | 6 +-- behavior_tests/src/bt-extra-arg/do_test.py | 4 +- behavior_tests/src/bt-format-range/do_test.py | 6 +-- behavior_tests/src/bt-format-style/do_test.py | 6 +-- .../src/bt-gen-helper-function/do_test.py | 2 +- behavior_tests/src/bt-help/do_test.py | 2 +- .../bt-in-root-empty-process-all/do_test.py | 2 +- .../src/bt-invalid-cuda-version/do_test.py | 2 +- .../bt-kernel-function-limitation/do_test.py | 2 +- .../src/bt-language-warning/do_test.py | 2 +- .../src/bt-modified-yaml/do_test.py | 4 +- .../src/bt-multi-cuda-inc-path/do_test.py | 4 +- behavior_tests/src/bt-output/do_test.py | 2 +- behavior_tests/src/bt-report-only/do_test.py | 2 +- .../src/bt-stop-on-parse-err/do_test.py | 2 +- .../src/bt-suppress-warnings-all/do_test.py | 2 +- .../src/bt-suppress-warnings/do_test.py | 2 +- behavior_tests/src/bt-tilde-path/do_test.py | 2 +- .../bt-unsupported-type-function/do_test.py | 2 +- .../src/bt-use-explicit-namespace1/do_test.py | 4 +- .../src/bt-use-explicit-namespace2/do_test.py | 4 +- .../src/bt-use-explicit-namespace3/do_test.py | 4 +- .../src/bt-use-explicit-namespace4/do_test.py | 2 +- .../src/bt-use-explicit-namespace5/do_test.py | 4 +- .../src/bt-use-explicit-namespace6/do_test.py | 4 +- behavior_tests/src/bt-version/do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 4 +- .../do_test.py | 4 +- .../do_test.py | 4 +- .../src/bt-yaml-without-ct-version/do_test.py | 2 +- .../src/cannot-acc-dir-in-db/do_test.py | 2 +- .../src/change-filename-extension/do_test.py | 2 +- .../check-device-unsupport-aspect/do_test.py | 10 ++--- .../src/check-windows-version/do_test.py | 1 - .../src/cl_compile_test_1/do_test.py | 2 +- .../src/cmps_cl_compile_test_1/do_test.py | 2 +- .../src/cmps_cl_compile_test_2/do_test.py | 2 +- .../src/cmps_cuda_compile_test_1/do_test.py | 2 +- .../src/cmps_cuda_compile_test_2/do_test.py | 2 +- behavior_tests/src/copy_all_files/do_test.py | 4 +- .../src/execute_from_bundle_root/do_test.py | 6 +-- .../src/execute_from_cuda_path/do_test.py | 6 +-- .../src/integer-overflow/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx1/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx2/do_test.py | 2 +- behavior_tests/src/ngt-UDR-idx3/do_test.py | 2 +- behavior_tests/src/ngt-UDR-keyword/do_test.py | 2 +- behavior_tests/src/ngt-UDR-path/do_test.py | 2 +- .../src/ngt-analysis-scope-path1/do_test.py | 2 +- .../src/ngt-assume-nd-range-dim/do_test.py | 2 +- .../ngt-cannot-access-dir-in-db/do_test.py | 2 +- .../src/ngt-cannot-find-db/do_test.py | 2 +- .../src/ngt-check-cannot-parse/do_test.py | 4 +- .../src/ngt-database-notfound/do_test.py | 4 +- .../src/ngt-file-parsing-err/do_test.py | 2 +- .../src/ngt-format-range/do_test.py | 4 +- .../src/ngt-format-style/do_test.py | 4 +- behavior_tests/src/ngt-in-root-len/do_test.py | 4 +- .../src/ngt-in-root-path/do_test.py | 4 +- .../src/ngt-include-path-len/do_test.py | 4 +- .../ngt-inroot-contain-cuda-path/do_test.py | 4 +- .../ngt-invalid-cuda-include-path/do_test.py | 2 +- .../do_test.py | 4 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../do_test.py | 2 +- .../src/ngt-invalid-inroot/do_test.py | 4 +- .../src/ngt-invalid-inroot2/do_test.py | 4 +- .../src/ngt-invalid-inroot3/do_test.py | 4 +- .../src/ngt-invalid-json1/do_test.py | 4 +- .../src/ngt-invalid-json10/do_test.py | 4 +- .../src/ngt-invalid-json2/do_test.py | 4 +- .../src/ngt-invalid-json3/do_test.py | 4 +- .../src/ngt-invalid-json4/do_test.py | 4 +- .../src/ngt-invalid-json5/do_test.py | 4 +- .../src/ngt-invalid-json6/do_test.py | 4 +- .../src/ngt-invalid-json7/do_test.py | 4 +- .../src/ngt-invalid-json8/do_test.py | 4 +- .../src/ngt-invalid-json9/do_test.py | 4 +- .../ngt-invalid-yaml-for-format1/do_test.py | 4 +- .../ngt-invalid-yaml-for-format2/do_test.py | 4 +- .../ngt-invalid-yaml-for-format3/do_test.py | 4 +- .../ngt-invalid-yaml-for-format4/do_test.py | 4 +- .../ngt-invalid-yaml-for-header1/do_test.py | 4 +- .../ngt-invalid-yaml-for-header2/do_test.py | 4 +- .../ngt-invalid-yaml-for-header3/do_test.py | 4 +- .../ngt-invalid-yaml-for-header4/do_test.py | 4 +- .../src/ngt-level-verbosity/do_test.py | 4 +- .../src/ngt-no-db-specified/do_test.py | 4 +- .../src/ngt-no-explicit-inroot/do_test.py | 2 +- .../src/ngt-no-file-type/do_test.py | 2 +- .../src/ngt-no-source-name/do_test.py | 4 +- .../src/ngt-opt-parsing-err/do_test.py | 2 +- .../src/ngt-out-root-len/do_test.py | 4 +- .../src/ngt-output-access/do_test.py | 2 +- .../src/ngt-output-create/do_test.py | 2 +- .../src/ngt-output-file-len/do_test.py | 4 +- .../src/ngt-output-not-empty/do_test.py | 2 +- .../src/ngt-output-verbosity/do_test.py | 4 +- .../src/ngt-report-file-len/do_test.py | 4 +- .../src/ngt-report-file-prefix/do_test.py | 4 +- .../src/ngt-report-file-prefix2/do_test.py | 4 +- .../src/ngt-report-format1/do_test.py | 4 +- .../src/ngt-report-format2/do_test.py | 4 +- .../src/ngt-report-type-diags/do_test.py | 4 +- behavior_tests/src/ngt-report-type/do_test.py | 4 +- .../src/ngt-rpt-prefix-too-long/do_test.py | 4 +- .../src/ngt-save-out-fail-lin/do_test.py | 2 +- behavior_tests/src/ngt-show-help/do_test.py | 2 +- .../src/ngt-skip-for-missing-cmd/do_test.py | 2 +- .../src/ngt-stop-on-parse-err/do_test.py | 2 +- .../src/ngt-suppress-warnings1/do_test.py | 4 +- .../src/ngt-suppress-warnings10/do_test.py | 4 +- .../src/ngt-suppress-warnings11/do_test.py | 2 +- .../src/ngt-suppress-warnings2/do_test.py | 2 +- .../src/ngt-suppress-warnings3/do_test.py | 2 +- .../src/ngt-suppress-warnings4/do_test.py | 4 +- .../src/ngt-suppress-warnings5/do_test.py | 2 +- .../src/ngt-suppress-warnings6/do_test.py | 4 +- .../src/ngt-suppress-warnings7/do_test.py | 4 +- .../src/ngt-suppress-warnings8/do_test.py | 4 +- .../src/ngt-suppress-warnings9/do_test.py | 4 +- .../src/ngt-use-dpcpp-extensions/do_test.py | 4 +- behavior_tests/src/ngt-usm-leve/do_test.py | 4 +- behavior_tests/src/ngt-usm-level/do_test.py | 4 +- .../src/ngt-vcxproj-does-not-exist/do_test.py | 4 +- .../src/ngt-vcxproj-to-db-fail/do_test.py | 2 +- .../do_test.py | 4 +- .../src/ngtn-database-fail/do_test.py | 4 +- behavior_tests/src/nominmax_bd/do_test.py | 2 +- .../src/path_validation_0/do_test.py | 2 +- .../src/path_validation_1/do_test.py | 2 +- .../src/relative_path_test/do_test.py | 2 +- behavior_tests/src/sh-ct-1306/do_test.py | 2 +- features/feature_case/backprop/do_test.py | 4 +- .../cudnn_multiple_files/do_test.py | 8 ++-- .../feature_case/kernel_library/do_test.py | 6 +-- features/feature_case/module/do_test.py | 6 +-- features/test_feature.py | 6 +-- help_function/test_help.py | 8 ++-- regressions/test_regression.py | 6 +-- run_test.py | 35 ++++++++++++--- samples/test_samples.py | 2 +- test_config.py | 8 ---- test_utils.py | 14 +++--- user_guide_samples/test_guide.py | 2 +- 160 files changed, 314 insertions(+), 300 deletions(-) diff --git a/behavior_tests/src/array_size_fold/do_test.py b/behavior_tests/src/array_size_fold/do_test.py index c798aeff5..9582e46d8 100644 --- a/behavior_tests/src/array_size_fold/do_test.py +++ b/behavior_tests/src/array_size_fold/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess( - test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + single_case_text.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) with open(os.path.join("out", "test.dp.cpp"), 'r') as f: ret_str = f.read() diff --git a/behavior_tests/src/bad_input_1/do_test.py b/behavior_tests/src/bad_input_1/do_test.py index 817fe91ec..807b66b01 100644 --- a/behavior_tests/src/bad_input_1/do_test.py +++ b/behavior_tests/src/bad_input_1/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + os.path.join("cuda", "migrate_nonbuilding_code.cu"), single_case_text) return is_sub_string("unknown type name", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-analysis-scope-path1/do_test.py b/behavior_tests/src/bt-analysis-scope-path1/do_test.py index 0f218e7e5..465635a1b 100644 --- a/behavior_tests/src/bt-analysis-scope-path1/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path1/do_test.py @@ -24,7 +24,7 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") - migrate_cmd = test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + os.path.join( + migrate_cmd = single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + os.path.join( "cuda", "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" # migrate with implicit --analysis-scope-path which defaults to --in-root diff --git a/behavior_tests/src/bt-analysis-scope-path2/do_test.py b/behavior_tests/src/bt-analysis-scope-path2/do_test.py index fc1b3a709..cfb59adb8 100644 --- a/behavior_tests/src/bt-analysis-scope-path2/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path2/do_test.py @@ -30,7 +30,7 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") - migrate_cmd = test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + os.path.join( + migrate_cmd = single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + os.path.join( "cuda", "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" # migrate with implicit --analysis-scope-path which defaults to --in-root diff --git a/behavior_tests/src/bt-analysis-scope-path3/do_test.py b/behavior_tests/src/bt-analysis-scope-path3/do_test.py index 5747255b6..deba98862 100644 --- a/behavior_tests/src/bt-analysis-scope-path3/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path3/do_test.py @@ -25,7 +25,7 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") - migrate_cmd = test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + os.path.join( + migrate_cmd = single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + os.path.join( "cuda", "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" diff --git a/behavior_tests/src/bt-analysis-scope-path4/do_test.py b/behavior_tests/src/bt-analysis-scope-path4/do_test.py index 34c89c145..b1a53f846 100644 --- a/behavior_tests/src/bt-analysis-scope-path4/do_test.py +++ b/behavior_tests/src/bt-analysis-scope-path4/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): if (os.path.exists("out")): shutil.rmtree("out") - migrate_cmd = test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + os.path.join( + migrate_cmd = single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + os.path.join( "cuda", "call_device_func_outside.cu") + " --in-root=cuda" + " --out-root=out" diff --git a/behavior_tests/src/bt-autocomplete/do_test.py b/behavior_tests/src/bt-autocomplete/do_test.py index 6ccab6749..9ca4bf31c 100644 --- a/behavior_tests/src/bt-autocomplete/do_test.py +++ b/behavior_tests/src/bt-autocomplete/do_test.py @@ -19,68 +19,68 @@ def setup_test(single_case_text): def migrate_test(single_case_text): res = True - call_subprocess(test_config.CT_TOOL + " --autocomplete=--gen-build", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=--gen-build", single_case_text) reference = '--gen-build-script\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-gen-build", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=-gen-build", single_case_text) reference = '-gen-build-script\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=foo", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=foo", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=#d", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=--output-verbosity=#d", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=#d", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=-output-verbosity=#d", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=--output-verbosity=", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=-output-verbosity=", single_case_text) reference = 'detailed\n' + \ 'diagnostics\n' + \ 'normal\n' + \ 'silent\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar##--enable-c", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=foo#bar##--enable-c", single_case_text) reference = '--enable-ctad\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar###--format-range=#a", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=foo#bar###--format-range=#a", single_case_text) reference = 'all\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file=", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=--rule-file=", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=--rule-file", single_case_text) reference = '--rule-file\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-p=", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=-p=", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-p", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=-p", single_case_text) reference = '-p\n' + \ '-process-all\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,", single_case_text) reference = 'cl,sycl,cl\n' + \ 'cl,sycl,dpct\n' + \ 'cl,sycl,none\n' + \ @@ -88,28 +88,28 @@ def migrate_test(single_case_text): 'cl,sycl,sycl-math\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,s", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,s", single_case_text) reference = 'cl,sycl,sycl\n' + \ 'cl,sycl,sycl-math\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=,", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=,", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete==", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete==", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=,,", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=,,", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=-", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=-", single_case_text) opts = ['--always-use-async-handler\n', '--analysis-scope-path\n', '--assume-nd-range-dim=\n', @@ -154,11 +154,11 @@ def migrate_test(single_case_text): for opt in opts: res = res and (opt in single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=##", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=##", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) - call_subprocess(test_config.CT_TOOL + " --autocomplete=#", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --autocomplete=#", single_case_text) reference = '\n' res = res and (reference == single_case_text.print_text) diff --git a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py index 891286b5a..a6ff16b22 100644 --- a/behavior_tests/src/bt-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-cdb-default-out-folder/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make", single_case_text) in_root = "" extra_args = "" - return call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + + return call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + "-p .", single_case_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-check-conflict-insertion/do_test.py b/behavior_tests/src/bt-check-conflict-insertion/do_test.py index aea45ef3d..d6dbdb0fd 100644 --- a/behavior_tests/src/bt-check-conflict-insertion/do_test.py +++ b/behavior_tests/src/bt-check-conflict-insertion/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make", single_case_text) in_root = "" extra_args = "" - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + "-p .", single_case_text) return False def build_test(single_case_text): diff --git a/behavior_tests/src/bt-check-unexpected-message/do_test.py b/behavior_tests/src/bt-check-unexpected-message/do_test.py index 75e04c62f..69c374089 100644 --- a/behavior_tests/src/bt-check-unexpected-message/do_test.py +++ b/behavior_tests/src/bt-check-unexpected-message/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path + " --extra-arg=-xc++", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + single_case_text.include_path + " --extra-arg=-xc++", single_case_text) return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-check-warning1083/do_test.py b/behavior_tests/src/bt-check-warning1083/do_test.py index b1e370dbb..f48cc4ac1 100644 --- a/behavior_tests/src/bt-check-warning1083/do_test.py +++ b/behavior_tests/src/bt-check-warning1083/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): ret_file = "" - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) ret = "" with open(os.path.join("out", "test.dp.cpp"), 'r') as f: ret = f.read() diff --git a/behavior_tests/src/bt-comments/do_test.py b/behavior_tests/src/bt-comments/do_test.py index 28fe93bfd..b0dfb5982 100644 --- a/behavior_tests/src/bt-comments/do_test.py +++ b/behavior_tests/src/bt-comments/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): ret_file = "" - call_subprocess(test_config.CT_TOOL + " --comments comments.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --comments comments.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) with open(os.path.join("out", "comments.dp.cpp"), 'r') as f: ret_file = f.read() return is_sub_string("//", ret_file) diff --git a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py index a8d576c2d..865d5e0ef 100644 --- a/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py +++ b/behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " -p=./ --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " -p=./ --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py b/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py index 8fa08c14b..14e9ae4e6 100644 --- a/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py +++ b/behavior_tests/src/bt-extra-arg-comma-separate/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,9 +19,9 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - return call_subprocess(test_config.CT_TOOL + " --extra-arg=-I\"" + os.path.dirname(__file__) + + return call_subprocess(single_case_text.CT_TOOL + " --extra-arg=-I\"" + os.path.dirname(__file__) + "/header1 "+",-I" + os.path.dirname(__file__) + "/header2\"" + - " --cuda-include-path=" + test_config.include_path + " test.cu", single_case_text) + " --cuda-include-path=" + single_case_text.include_path + " test.cu", single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-extra-arg/do_test.py b/behavior_tests/src/bt-extra-arg/do_test.py index d236f9195..9918d68ee 100644 --- a/behavior_tests/src/bt-extra-arg/do_test.py +++ b/behavior_tests/src/bt-extra-arg/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - return (call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=" + test_config.include_path + "\" vector_add.cu", single_case_text) + return (call_subprocess(single_case_text.CT_TOOL + " --extra-arg=\"--cuda-path=" + single_case_text.include_path + "\" vector_add.cu", single_case_text) and is_sub_string("Parsing", single_case_text.print_text) and is_sub_string("Analyzing", single_case_text.print_text) and is_sub_string("Migrating", single_case_text.print_text)) diff --git a/behavior_tests/src/bt-format-range/do_test.py b/behavior_tests/src/bt-format-range/do_test.py index eb63424a5..16d0a6697 100644 --- a/behavior_tests/src/bt-format-range/do_test.py +++ b/behavior_tests/src/bt-format-range/do_test.py @@ -22,9 +22,9 @@ def migrate_test(single_case_text): os.mkdir("out_migrated") os.mkdir("out_all") os.mkdir("out_none") - call_subprocess(test_config.CT_TOOL + " --format-range=migrated --out-root=./out_migrated vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - call_subprocess(test_config.CT_TOOL + " --format-range=all --out-root=./out_all vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - call_subprocess(test_config.CT_TOOL + " -format-range=none --out-root=./out_none vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --format-range=migrated --out-root=./out_migrated vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --format-range=all --out-root=./out_all vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " -format-range=none --out-root=./out_none vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) ret = is_sub_string(";\/\/ variable declearation", "./out_llvm/vector_add.dp.cpp") ret = is_sub_string(";\/\/ allocate device memory", "./out_google/vector_add.dp.cpp") or ret diff --git a/behavior_tests/src/bt-format-style/do_test.py b/behavior_tests/src/bt-format-style/do_test.py index 437d9b96f..a0fb258a9 100644 --- a/behavior_tests/src/bt-format-style/do_test.py +++ b/behavior_tests/src/bt-format-style/do_test.py @@ -21,9 +21,9 @@ def migrate_test(single_case_text): os.mkdir("out_custom") os.mkdir("out_llvm") os.mkdir("out_google") - call_subprocess(test_config.CT_TOOL + " --format-style=custom --out-root=./out_custom vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - call_subprocess(test_config.CT_TOOL + " --format-style=llvm --out-root=./out_llvm vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) - call_subprocess(test_config.CT_TOOL + " --format-style=google --out-root=./out_google vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --format-style=custom --out-root=./out_custom vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --format-style=llvm --out-root=./out_llvm vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --format-style=google --out-root=./out_google vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) ret = False with open(os.path.join("out_llvm", "vector_add.dp.cpp")) as f: file_str = f.read() diff --git a/behavior_tests/src/bt-gen-helper-function/do_test.py b/behavior_tests/src/bt-gen-helper-function/do_test.py index fdc2e8162..eae2118a8 100644 --- a/behavior_tests/src/bt-gen-helper-function/do_test.py +++ b/behavior_tests/src/bt-gen-helper-function/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): ret_file = "" - ret = call_subprocess(test_config.CT_TOOL + " --gen-helper-function --out-root=out", single_case_text) + ret = call_subprocess(single_case_text.CT_TOOL + " --gen-helper-function --out-root=out", single_case_text) installed_header_file_root = os.path.join(os.path.dirname(get_ct_path()), "..", "include", "dpct") generated_header_file_root = os.path.join(os.getcwd(), "out", "include", "dpct") diff --git a/behavior_tests/src/bt-help/do_test.py b/behavior_tests/src/bt-help/do_test.py index 2a21d2b2b..d387960ff 100644 --- a/behavior_tests/src/bt-help/do_test.py +++ b/behavior_tests/src/bt-help/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL +" --help", single_case_text) + call_subprocess(single_case_text.CT_TOOL +" --help", single_case_text) return is_sub_string("USAGE", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py index 7e10b9b10..7404c9bf8 100644 --- a/behavior_tests/src/bt-in-root-empty-process-all/do_test.py +++ b/behavior_tests/src/bt-in-root-empty-process-all/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --process-all --cuda-include-path=" + test_config.include_path + " --in-root=", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --process-all --cuda-include-path=" + single_case_text.include_path + " --in-root=", single_case_text) return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-invalid-cuda-version/do_test.py b/behavior_tests/src/bt-invalid-cuda-version/do_test.py index d172b7b51..11c6c59b1 100644 --- a/behavior_tests/src/bt-invalid-cuda-version/do_test.py +++ b/behavior_tests/src/bt-invalid-cuda-version/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): include_path = os.path.join(os.getcwd(), "include") in_root = os.getcwd() test_case_path = os.path.join(in_root, "vector_add.cu") - call_subprocess(test_config.CT_TOOL + " " + test_case_path + " --out-root=out --in-root=" + in_root + " --cuda-include-path=" + include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " " + test_case_path + " --out-root=out --in-root=" + in_root + " --cuda-include-path=" + include_path, single_case_text) return is_sub_string("Error: The version of CUDA header files specified by --cuda-include-path is not supported. See Release Notes for supported versions.", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-kernel-function-limitation/do_test.py b/behavior_tests/src/bt-kernel-function-limitation/do_test.py index 7c571f56c..94757dda0 100644 --- a/behavior_tests/src/bt-kernel-function-limitation/do_test.py +++ b/behavior_tests/src/bt-kernel-function-limitation/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --optimize-migration --out-root=./out kernel-func.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --optimize-migration --out-root=./out kernel-func.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) ret = is_sub_string("Recursive functions cannot be called in SYCL device code", single_case_text.print_text) ret = is_sub_string("Virtual functions cannot be called in SYCL device code", single_case_text.print_text) and ret diff --git a/behavior_tests/src/bt-language-warning/do_test.py b/behavior_tests/src/bt-language-warning/do_test.py index ee9884ba2..c1f55c5b0 100644 --- a/behavior_tests/src/bt-language-warning/do_test.py +++ b/behavior_tests/src/bt-language-warning/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cpp --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cpp --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("NOTE: test.cpp is treated as a CUDA file by default. Use the --extra-arg=-xc++ option to treat test.cpp as a C++ file if needed.", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-modified-yaml/do_test.py b/behavior_tests/src/bt-modified-yaml/do_test.py index d974c1c44..d7d825700 100644 --- a/behavior_tests/src/bt-modified-yaml/do_test.py +++ b/behavior_tests/src/bt-modified-yaml/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): test_file = os.path.join("out", "test.h") ret_str = "" ret = [] - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xc\" --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xc\" --cuda-include-path=" + single_case_text.include_path, single_case_text) if not os.path.exists(yml_file): return False with open(yml_file, 'r') as f: @@ -32,7 +32,7 @@ def migrate_test(single_case_text): ret.append(line) with open(yml_file, 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xcuda\" --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root=out --extra-arg=\"-xcuda\" --cuda-include-path=" + single_case_text.include_path, single_case_text) with open(test_file, 'r') as f: ret_str = f.read() if ret_str.count("DPCT1056") == 1: diff --git a/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py b/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py index 02392c56b..ef223c995 100644 --- a/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py +++ b/behavior_tests/src/bt-multi-cuda-inc-path/do_test.py @@ -14,12 +14,12 @@ def setup_test(single_case_text): change_dir(single_case_text.name, single_case_text) - call_subprocess("cp -r --dereference " + test_config.include_path + " + .", single_case_text) + call_subprocess("cp -r --dereference " + single_case_text.include_path + " + .", single_case_text) change_dir("src", single_case_text) return True def migrate_test(single_case_text): - command = test_config.CT_TOOL + " --out-root out test.cu --cuda-include-path ../include --extra-arg=\"-I" + test_config.include_path + "\"" + command = single_case_text.CT_TOOL + " --out-root out test.cu --cuda-include-path ../include --extra-arg=\"-I" + single_case_text.include_path + "\"" print(command) return call_subprocess(command, single_case_text) diff --git a/behavior_tests/src/bt-output/do_test.py b/behavior_tests/src/bt-output/do_test.py index 17b84e70b..cb3d8747b 100644 --- a/behavior_tests/src/bt-output/do_test.py +++ b/behavior_tests/src/bt-output/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - return call_subprocess(test_config.CT_TOOL + " hello.cu hello2.cu --cuda-include-path=" + test_config.include_path + " > output.txt", single_case_text) + return call_subprocess(single_case_text.CT_TOOL + " hello.cu hello2.cu --cuda-include-path=" + single_case_text.include_path + " > output.txt", single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-report-only/do_test.py b/behavior_tests/src/bt-report-only/do_test.py index 1f3e58447..6c51323b6 100644 --- a/behavior_tests/src/bt-report-only/do_test.py +++ b/behavior_tests/src/bt-report-only/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --report-only vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --report-only vector_add.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) if os.path.exists("out"): return False return True diff --git a/behavior_tests/src/bt-stop-on-parse-err/do_test.py b/behavior_tests/src/bt-stop-on-parse-err/do_test.py index 2df039bc3..5b314bc6f 100644 --- a/behavior_tests/src/bt-stop-on-parse-err/do_test.py +++ b/behavior_tests/src/bt-stop-on-parse-err/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --stop-on-parse-err vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --stop-on-parse-err vector_add.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) if os.path.exists(os.path.join("out", "vector_add.dp.cpp")): return False return True diff --git a/behavior_tests/src/bt-suppress-warnings-all/do_test.py b/behavior_tests/src/bt-suppress-warnings-all/do_test.py index a7471598f..1fee42b0d 100644 --- a/behavior_tests/src/bt-suppress-warnings-all/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings-all/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --suppress-warnings-all vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --suppress-warnings-all vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return not is_sub_string("DPCT1015", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-suppress-warnings/do_test.py b/behavior_tests/src/bt-suppress-warnings/do_test.py index 91d37521d..8145f9267 100644 --- a/behavior_tests/src/bt-suppress-warnings/do_test.py +++ b/behavior_tests/src/bt-suppress-warnings/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " hello.cu --suppress-warnings=1000-1003,1008 --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " hello.cu --suppress-warnings=1000-1003,1008 --cuda-include-path=" + single_case_text.include_path, single_case_text) return not is_sub_string("warning: DPCT10", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-tilde-path/do_test.py b/behavior_tests/src/bt-tilde-path/do_test.py index fa5f24c2c..a6ec1a0b4 100644 --- a/behavior_tests/src/bt-tilde-path/do_test.py +++ b/behavior_tests/src/bt-tilde-path/do_test.py @@ -28,7 +28,7 @@ def migrate_test(single_case_text): if os.path.exists(user_root_path): shutil.rmtree(user_root_path) os.makedirs(user_root_path) - distutils.dir_util.copy_tree(test_config.include_path + "/..", user_root_path) + distutils.dir_util.copy_tree(single_case_text.include_path + "/..", user_root_path) return call_subprocess("dpct vector_add.cu --cuda-include-path=" + "~/workspace/include", single_case_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-unsupported-type-function/do_test.py b/behavior_tests/src/bt-unsupported-type-function/do_test.py index 95b1d7dae..c578f65e5 100644 --- a/behavior_tests/src/bt-unsupported-type-function/do_test.py +++ b/behavior_tests/src/bt-unsupported-type-function/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): migrated_file = os.path.join("out_nvml", "test.dp.cpp") - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=./out_nvml --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root=./out_nvml --cuda-include-path=" + single_case_text.include_path, single_case_text) warn_1007_count = 0 warn_1082_count = 0 with open(migrated_file, "r") as f: diff --git a/behavior_tests/src/bt-use-explicit-namespace1/do_test.py b/behavior_tests/src/bt-use-explicit-namespace1/do_test.py index 450be4446..c8dede324 100644 --- a/behavior_tests/src/bt-use-explicit-namespace1/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace1/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=none --out-root=./sycl vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return True def build_test(single_case_text): srcs = [] @@ -27,6 +27,6 @@ def build_test(single_case_text): def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/bt-use-explicit-namespace2/do_test.py b/behavior_tests/src/bt-use-explicit-namespace2/do_test.py index 132117721..c3094fbce 100644 --- a/behavior_tests/src/bt-use-explicit-namespace2/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + ret = call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] @@ -27,5 +27,5 @@ def build_test(single_case_text): def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/bt-use-explicit-namespace3/do_test.py b/behavior_tests/src/bt-use-explicit-namespace3/do_test.py index 41c46c945..cdc503532 100644 --- a/behavior_tests/src/bt-use-explicit-namespace3/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace3/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + ret = call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=sycl-math --out-root=./sycl vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] @@ -27,5 +27,5 @@ def build_test(single_case_text): def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/bt-use-explicit-namespace4/do_test.py b/behavior_tests/src/bt-use-explicit-namespace4/do_test.py index 24feef615..eb7698931 100644 --- a/behavior_tests/src/bt-use-explicit-namespace4/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace4/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=cl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + ret = call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=cl --out-root=./sycl vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return ret def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-use-explicit-namespace5/do_test.py b/behavior_tests/src/bt-use-explicit-namespace5/do_test.py index a1e1ffa7c..74a5c4b56 100644 --- a/behavior_tests/src/bt-use-explicit-namespace5/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace5/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + ret = call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=sycl --out-root=./sycl vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] @@ -27,5 +27,5 @@ def build_test(single_case_text): def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter return run_binary_with_args(single_case_text) diff --git a/behavior_tests/src/bt-use-explicit-namespace6/do_test.py b/behavior_tests/src/bt-use-explicit-namespace6/do_test.py index e30cbbb01..5f76f5ed1 100644 --- a/behavior_tests/src/bt-use-explicit-namespace6/do_test.py +++ b/behavior_tests/src/bt-use-explicit-namespace6/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - ret = call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl-math,dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + ret = call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=sycl-math,dpct --out-root=./sycl vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return ret def build_test(single_case_text): srcs = [] @@ -26,5 +26,5 @@ def build_test(single_case_text): return compile_and_link(srcs, single_case_text) def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter return run_binary_with_args(single_case_text) diff --git a/behavior_tests/src/bt-version/do_test.py b/behavior_tests/src/bt-version/do_test.py index 520b32f89..53583317d 100644 --- a/behavior_tests/src/bt-version/do_test.py +++ b/behavior_tests/src/bt-version/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --version", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --version", single_case_text) ct_clang_version = get_ct_clang_version() expected_output = "dpct version {0}".format(ct_clang_version) print("expected dpct version output: {0}".format(expected_output)) diff --git a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py index 61338e8a5..985dc3683 100644 --- a/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py index 90b39c7b2..500bd1481 100644 --- a/behavior_tests/src/bt-yaml-with-different-options1/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options1/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --in-root . --out-root out --always-use-async-handler --assume-nd-range-dim=1 --comments --enable-ctad --no-dpcpp-extensions=enqueued_barriers --no-dry-pattern --process-all -p . --sycl-named-lambda --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --usm-level=none --cuda-include-path=" + test_config.include_path, single_case_text) - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --in-root . --out-root out --always-use-async-handler --assume-nd-range-dim=1 --comments --enable-ctad --no-dpcpp-extensions=enqueued_barriers --no-dry-pattern --process-all -p . --sycl-named-lambda --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --usm-level=none --cuda-include-path=" + single_case_text.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("\"--analysis-scope-path=\"", single_case_text.print_text) and \ is_sub_string("--always-use-async-handler --comments --compilation-database=\"", single_case_text.print_text) and \ is_sub_string("--enable-ctad --use-experimental-features=free-function-queries,nd_range_barrier --use-explicit-namespace=cl,dpct --no-dpcpp-extensions=enqueued_barriers --assume-nd-range-dim=1 --no-dry-pattern --process-all --sycl-named-lambda --usm-level=none\".", single_case_text.print_text) diff --git a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py index 8ff047c5a..780b629fb 100644 --- a/behavior_tests/src/bt-yaml-with-different-options2/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options2/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-cl-namespace-inline --cuda-include-path=" + test_config.include_path, single_case_text) - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root out --no-cl-namespace-inline --cuda-include-path=" + single_case_text.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("--no-cl-namespace-inline\".", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/bt-yaml-with-different-options3/do_test.py b/behavior_tests/src/bt-yaml-with-different-options3/do_test.py index 965d6b0aa..96a2a0624 100644 --- a/behavior_tests/src/bt-yaml-with-different-options3/do_test.py +++ b/behavior_tests/src/bt-yaml-with-different-options3/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --usm-level=none --cuda-include-path=" + test_config.include_path, single_case_text) - return call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --no-incremental-migration --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root out --usm-level=none --cuda-include-path=" + single_case_text.include_path, single_case_text) + return call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root out --no-incremental-migration --cuda-include-path=" + single_case_text.include_path, single_case_text) def build_test(single_case_text): return True diff --git a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py index b0a961aee..1efaa781b 100644 --- a/behavior_tests/src/bt-yaml-without-ct-version/do_test.py +++ b/behavior_tests/src/bt-yaml-without-ct-version/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Failed to load", single_case_text.print_text) and \ is_sub_string("Migration continues with incremental migration disabled", single_case_text.print_text) diff --git a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py index 8ff73f9f2..55a55828d 100644 --- a/behavior_tests/src/cannot-acc-dir-in-db/do_test.py +++ b/behavior_tests/src/cannot-acc-dir-in-db/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): change_dir('..', single_case_text) call_subprocess('mv helloworld helloworld_tst', single_case_text) - call_subprocess(test_config.CT_TOOL + ' -p ./helloworld_tst/compile_commands.json --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' -p ./helloworld_tst/compile_commands.json --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) if 'check if the directory exists and can be accessed by the tool' in single_case_text.print_text: diff --git a/behavior_tests/src/change-filename-extension/do_test.py b/behavior_tests/src/change-filename-extension/do_test.py index 2d2c7bd3d..dc461ff87 100644 --- a/behavior_tests/src/change-filename-extension/do_test.py +++ b/behavior_tests/src/change-filename-extension/do_test.py @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess( - test_config.CT_TOOL + " -p=. --change-cuda-files-extension-only --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + single_case_text.CT_TOOL + " -p=. --change-cuda-files-extension-only --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) print(single_case_text.print_text) reference = 'main.dp.cpp' diff --git a/behavior_tests/src/check-device-unsupport-aspect/do_test.py b/behavior_tests/src/check-device-unsupport-aspect/do_test.py index ea34f50f5..0d73ccbac 100644 --- a/behavior_tests/src/check-device-unsupport-aspect/do_test.py +++ b/behavior_tests/src/check-device-unsupport-aspect/do_test.py @@ -18,13 +18,13 @@ def setup_test(single_case_text): def migrate_test(single_case_text): res = True - cmd = test_config.CT_TOOL + " --out-root=out double.cu --cuda-include-path=" + test_config.include_path + cmd = single_case_text.CT_TOOL + " --out-root=out double.cu --cuda-include-path=" + single_case_text.include_path if not call_subprocess(cmd, single_case_text): res = False print("double.cu migrate failed") else: print("double.cu migrate pass") - cmd = test_config.CT_TOOL + " --out-root=out half.cu --cuda-include-path=" + test_config.include_path + cmd = single_case_text.CT_TOOL + " --out-root=out half.cu --cuda-include-path=" + single_case_text.include_path if not call_subprocess(cmd, single_case_text): res = False print("half.cu migrate failed") @@ -40,7 +40,7 @@ def build_test(single_case_text): print("double.dp.cpp compile failed") else: print("double.dp.cpp compile pass") - cmd = test_config.DPCXX_COM + ' ' + prepare_obj_name(os.path.join("out", "double.dp.cpp")) + " -o double.run" + cmd = single_case_text.DPCXX_COM + ' ' + prepare_obj_name(os.path.join("out", "double.dp.cpp")) + " -o double.run" if not call_subprocess(cmd, single_case_text): res = False print("double.dp.cpp link failed") @@ -51,7 +51,7 @@ def build_test(single_case_text): print("half.dp.cpp compile failed") else: print("half.dp.cpp compile pass") - cmd = test_config.DPCXX_COM + ' ' + prepare_obj_name(os.path.join("out", "half.dp.cpp")) + " -o half.run" + cmd = single_case_text.DPCXX_COM + ' ' + prepare_obj_name(os.path.join("out", "half.dp.cpp")) + " -o half.run" if not call_subprocess(cmd, single_case_text): res = False print("half.dp.cpp link failed") @@ -61,7 +61,7 @@ def build_test(single_case_text): def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter res = 0 cmd = os.path.join(os.path.curdir, 'double.run') diff --git a/behavior_tests/src/check-windows-version/do_test.py b/behavior_tests/src/check-windows-version/do_test.py index ad32a731d..d3dcf19c2 100644 --- a/behavior_tests/src/check-windows-version/do_test.py +++ b/behavior_tests/src/check-windows-version/do_test.py @@ -10,7 +10,6 @@ import platform import os import sys -import test_config from test_utils import * diff --git a/behavior_tests/src/cl_compile_test_1/do_test.py b/behavior_tests/src/cl_compile_test_1/do_test.py index cd4a03d3e..f4bbcc168 100644 --- a/behavior_tests/src/cl_compile_test_1/do_test.py +++ b/behavior_tests/src/cl_compile_test_1/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): change_dir('..', single_case_text) call_subprocess('mv helloworld helloworld_tst', single_case_text) - call_subprocess(test_config.CT_TOOL + ' helloworld_tst/src/test.cu --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' helloworld_tst/src/test.cu --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) if 'check if the directory exists and can be accessed by the tool' in single_case_text.print_text: diff --git a/behavior_tests/src/cmps_cl_compile_test_1/do_test.py b/behavior_tests/src/cmps_cl_compile_test_1/do_test.py index c814f3403..70ba616bc 100644 --- a/behavior_tests/src/cmps_cl_compile_test_1/do_test.py +++ b/behavior_tests/src/cmps_cl_compile_test_1/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): migrated_file = os.path.join(os.getcwd(), "cuda", "file.c") expected_str = "" migrated_str = "" - call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ + call_subprocess(single_case_text.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: diff --git a/behavior_tests/src/cmps_cl_compile_test_2/do_test.py b/behavior_tests/src/cmps_cl_compile_test_2/do_test.py index 09726c9f7..c46f4c0fb 100644 --- a/behavior_tests/src/cmps_cl_compile_test_2/do_test.py +++ b/behavior_tests/src/cmps_cl_compile_test_2/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): migrated_file = os.path.join(os.getcwd(), "cuda", "file.cu") expected_str = "" migrated_str = "" - call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ + call_subprocess(single_case_text.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: diff --git a/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py b/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py index 50915fbb1..90d6dad44 100644 --- a/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py +++ b/behavior_tests/src/cmps_cuda_compile_test_1/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): migrated_file = os.path.join(os.getcwd(), "cuda", "file.c") expected_str = "" migrated_str = "" - call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ + call_subprocess(single_case_text.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: diff --git a/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py b/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py index 50915fbb1..90d6dad44 100644 --- a/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py +++ b/behavior_tests/src/cmps_cuda_compile_test_2/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): migrated_file = os.path.join(os.getcwd(), "cuda", "file.c") expected_str = "" migrated_str = "" - call_subprocess(test_config.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ + call_subprocess(single_case_text.CT_TOOL + " --report-file-prefix=report --out-root=out --vcxprojfile=\"" + \ file_vcxproj + "\" \"" + migrated_file + "\" --cuda-include-path=" + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open("expected.cpp", 'r') as f: diff --git a/behavior_tests/src/copy_all_files/do_test.py b/behavior_tests/src/copy_all_files/do_test.py index e3c7ad846..ff6ae57f9 100644 --- a/behavior_tests/src/copy_all_files/do_test.py +++ b/behavior_tests/src/copy_all_files/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL +" --out-root=out --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL +" --out-root=out --cuda-include-path=" + single_case_text.include_path + " t.c t.cpp t.cu", single_case_text) # return is_sub_string("Migration not necessary", single_case_text.print_text) diff --git a/behavior_tests/src/execute_from_bundle_root/do_test.py b/behavior_tests/src/execute_from_bundle_root/do_test.py index 298919456..4e19f24cd 100644 --- a/behavior_tests/src/execute_from_bundle_root/do_test.py +++ b/behavior_tests/src/execute_from_bundle_root/do_test.py @@ -21,14 +21,14 @@ def setup_test(single_case_text): def prepare_execution_folder(): - copy_ct_bin = os.path.dirname(str(shutil.which(test_config.CT_TOOL))) + copy_ct_bin = os.path.dirname(str(shutil.which(single_case_text.CT_TOOL))) distutils.dir_util.copy_tree(copy_ct_bin, "bin") def migrate_test(single_case_text): - ct_bin = os.path.join("bin", test_config.CT_TOOL) + ct_bin = os.path.join("bin", single_case_text.CT_TOOL) in_root = "" extra_args = "" - call_subprocess(ct_bin + " --cuda-include-path=" + test_config.include_path + + call_subprocess(ct_bin + " --cuda-include-path=" + single_case_text.include_path + " " + "hellocuda.cu", single_case_text) if ('or the same folder as' in single_case_text.print_text): return True diff --git a/behavior_tests/src/execute_from_cuda_path/do_test.py b/behavior_tests/src/execute_from_cuda_path/do_test.py index 9bd16d9e5..c0ee4a8cb 100644 --- a/behavior_tests/src/execute_from_cuda_path/do_test.py +++ b/behavior_tests/src/execute_from_cuda_path/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -21,13 +21,13 @@ def setup_test(single_case_text): def prepare_execution_folder(): - distutils.dir_util.copy_tree(test_config.include_path, "include") + distutils.dir_util.copy_tree(single_case_text.include_path, "include") def migrate_test(single_case_text): src =os.path.join("include", "vector_types.h") in_root = "" extra_args = "" - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=./include " + src, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=./include " + src, single_case_text) print("hello" + single_case_text.print_text, single_case_text) if ('option is in the CUDA_PATH folder' in single_case_text.print_text): return True diff --git a/behavior_tests/src/integer-overflow/do_test.py b/behavior_tests/src/integer-overflow/do_test.py index 9cbd353c0..0a736f0d4 100644 --- a/behavior_tests/src/integer-overflow/do_test.py +++ b/behavior_tests/src/integer-overflow/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make", single_case_text) change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst", single_case_text) - call_subprocess(test_config.CT_TOOL + " helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " helloworld_tst/src/test.cu --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=-1,0,0x100,0x1000,0x3fffffff,0x7ffffffe,0x7fffffff,0x80000000,0xfffffffe,0xffffffff,0x10000,0x100000", single_case_text) return is_sub_string("Error: Invalid warning ID or range; valid warning IDs range from 1000 to", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-UDR-idx1/do_test.py b/behavior_tests/src/ngt-UDR-idx1/do_test.py index b48e4b24e..48b69aa57 100644 --- a/behavior_tests/src/ngt-UDR-idx1/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx1/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, unknown keyword: $abd))", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-idx2/do_test.py b/behavior_tests/src/ngt-UDR-idx2/do_test.py index 6486ada8b..db02e4b32 100644 --- a/behavior_tests/src/ngt-UDR-idx2/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, unknown keyword: $-1))", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-idx3/do_test.py b/behavior_tests/src/ngt-UDR-idx3/do_test.py index 46ddac4b6..f02001066 100644 --- a/behavior_tests/src/ngt-UDR-idx3/do_test.py +++ b/behavior_tests/src/ngt-UDR-idx3/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, argument index out of range", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-keyword/do_test.py b/behavior_tests/src/ngt-UDR-keyword/do_test.py index a902a17da..6c0a3a09b 100644 --- a/behavior_tests/src/ngt-UDR-keyword/do_test.py +++ b/behavior_tests/src/ngt-UDR-keyword/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " a.cu -rule-file=./rule.yaml --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: in rule sample_rule, '(' is expected after $deref", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-UDR-path/do_test.py b/behavior_tests/src/ngt-UDR-path/do_test.py index 1982b5f63..88222861a 100644 --- a/behavior_tests/src/ngt-UDR-path/do_test.py +++ b/behavior_tests/src/ngt-UDR-path/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " a.cu -rule-file=./ruleaaa.yaml --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " a.cu -rule-file=./ruleaaa.yaml --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: failed to read", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py index 64c00a92a..953e59528 100644 --- a/behavior_tests/src/ngt-analysis-scope-path1/do_test.py +++ b/behavior_tests/src/ngt-analysis-scope-path1/do_test.py @@ -24,7 +24,7 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("out")): shutil.rmtree("out") - migrate_cmd = test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " + os.path.join( + migrate_cmd = single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " " + os.path.join( "cuda", "call_device_func_outside.cu") + " --in-root=" + os.path.realpath( ".") + " --out-root=" + os.path.realpath("out") diff --git a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py index e2f92f944..e4306e5a3 100644 --- a/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py +++ b/behavior_tests/src/ngt-assume-nd-range-dim/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --assume-nd-range-dim=2 --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --assume-nd-range-dim=2 --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Cannot find option named", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py index 03c4e165a..5a7b6fc88 100644 --- a/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-access-dir-in-db/do_test.py @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.write(ret) - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: Cannot access directory", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-cannot-find-db/do_test.py b/behavior_tests/src/ngt-cannot-find-db/do_test.py index c4273dd83..5af244a49 100644 --- a/behavior_tests/src/ngt-cannot-find-db/do_test.py +++ b/behavior_tests/src/ngt-cannot-find-db/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " -p ./ --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " -p ./ --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Cannot find compilation database", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-check-cannot-parse/do_test.py b/behavior_tests/src/ngt-check-cannot-parse/do_test.py index 012ca7dae..ea8bae9f1 100644 --- a/behavior_tests/src/ngt-check-cannot-parse/do_test.py +++ b/behavior_tests/src/ngt-check-cannot-parse/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " vector_add.cu", single_case_text) return is_sub_string("Migration not necessary", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-database-notfound/do_test.py b/behavior_tests/src/ngt-database-notfound/do_test.py index 24f55c2bc..27a4ac901 100644 --- a/behavior_tests/src/ngt-database-notfound/do_test.py +++ b/behavior_tests/src/ngt-database-notfound/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " -p=.", single_case_text) return is_sub_string("No compilation database found", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-file-parsing-err/do_test.py b/behavior_tests/src/ngt-file-parsing-err/do_test.py index 2af233d81..4ee703f16 100644 --- a/behavior_tests/src/ngt-file-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-file-parsing-err/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu -stop-on-parse-err --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo.cu -stop-on-parse-err --cuda-include-path=" + single_case_text.include_path, single_case_text) return (is_sub_string("Cannot parse input file", single_case_text.print_text) and is_sub_string("Parsing", single_case_text.print_text) and not is_sub_string("Analyzing", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-format-range/do_test.py b/behavior_tests/src/ngt-format-range/do_test.py index 0be547aae..7c9ecd7f4 100644 --- a/behavior_tests/src/ngt-format-range/do_test.py +++ b/behavior_tests/src/ngt-format-range/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --format-range=aaa", single_case_text) return is_sub_string("Cannot find option named", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-format-style/do_test.py b/behavior_tests/src/ngt-format-style/do_test.py index 4c3df7831..269a6a481 100644 --- a/behavior_tests/src/ngt-format-style/do_test.py +++ b/behavior_tests/src/ngt-format-style/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --format-style=aaa", single_case_text) return is_sub_string("Cannot find option named", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-in-root-len/do_test.py b/behavior_tests/src/ngt-in-root-len/do_test.py index 2905506f8..160725234 100644 --- a/behavior_tests/src/ngt-in-root-len/do_test.py +++ b/behavior_tests/src/ngt-in-root-len/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path +" --out-root="+ long_path, single_case_text) return is_sub_string("should be less than", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-in-root-path/do_test.py b/behavior_tests/src/ngt-in-root-path/do_test.py index b4a0d627d..70675f4d0 100644 --- a/behavior_tests/src/ngt-in-root-path/do_test.py +++ b/behavior_tests/src/ngt-in-root-path/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --in-root=./inroot vector_add.cu", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path +" --in-root=./inroot vector_add.cu", single_case_text) return is_sub_string("is not under the specified input root directory", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-include-path-len/do_test.py b/behavior_tests/src/ngt-include-path-len/do_test.py index 500cfc47f..4671d23cc 100644 --- a/behavior_tests/src/ngt-include-path-len/do_test.py +++ b/behavior_tests/src/ngt-include-path-len/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + long_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + long_path, single_case_text) return is_sub_string("should be less than", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py index 8b29b9618..95fb96b5c 100644 --- a/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py +++ b/behavior_tests/src/ngt-inroot-contain-cuda-path/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - shutil.copytree(test_config.include_path, "cc") - call_subprocess(test_config.CT_TOOL + " --in-root=./ ./simple_foo.cu --cuda-include-path=./cc", single_case_text) + shutil.copytree(single_case_text.include_path, "cc") + call_subprocess(single_case_text.CT_TOOL + " --in-root=./ ./simple_foo.cu --cuda-include-path=./cc", single_case_text) return is_sub_string("Error: Input folder specified by --in-root or --analysis-scope-path is the parent of, or the same folder", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py index 7b0547761..9ea6b53ea 100644 --- a/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py +++ b/behavior_tests/src/ngt-invalid-cuda-include-path/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + + call_subprocess(single_case_text.CT_TOOL + " --extra-arg=\"--cuda-path=/usr/local/folder-does-not-contain-cuda\" vector_add.cu", single_case_text) return is_sub_string("Could not detect path to CUDA header files", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py index 68f82bf88..199c68f2f 100644 --- a/behavior_tests/src/ngt-invalid-experimental-features/do_test.py +++ b/behavior_tests/src/ngt-invalid-experimental-features/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --use-experimental-features=logical-group,abc", single_case_text) return is_sub_string("for the --use-experimental-features option: Cannot find option named \'abc\'!", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py index 8e5e6fd6e..b3fa32847 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace1/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=none,dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=none,dpct vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py index 69a040d6a..597609c7d 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,cl,dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=sycl,cl,dpct vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py index 6454876c6..e13ced1bf 100644 --- a/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py +++ b/behavior_tests/src/ngt-invalid-explicit-namespace3/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --use-explicit-namespace=sycl,sycl-math vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --use-explicit-namespace=sycl,sycl-math vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: The input for option --use-explicit-namespace is not valid.", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-inroot/do_test.py b/behavior_tests/src/ngt-invalid-inroot/do_test.py index 1baeb6064..f7b02b61d 100644 --- a/behavior_tests/src/ngt-invalid-inroot/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + - " simple_foo.cu --in-root=/notavalidfolder --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + + " simple_foo.cu --in-root=/notavalidfolder --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("The path for --in-root or --out-root is not valid", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-inroot2/do_test.py b/behavior_tests/src/ngt-invalid-inroot2/do_test.py index 4fccb2365..4023e0d9e 100644 --- a/behavior_tests/src/ngt-invalid-inroot2/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot2/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + - " simple_foo.cu --in-root=/usr/local --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + + " simple_foo.cu --in-root=/usr/local --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("The path for --in-root is not valid", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-inroot3/do_test.py b/behavior_tests/src/ngt-invalid-inroot3/do_test.py index d47e7787e..19dade642 100644 --- a/behavior_tests/src/ngt-invalid-inroot3/do_test.py +++ b/behavior_tests/src/ngt-invalid-inroot3/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + - " simple_foo.cu --in-root=C:\Windows --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + + " simple_foo.cu --in-root=C:\Windows --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("The path for --in-root is not valid", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-json1/do_test.py b/behavior_tests/src/ngt-invalid-json1/do_test.py index 47feb565f..f2c6ae2e8 100644 --- a/behavior_tests/src/ngt-invalid-json1/do_test.py +++ b/behavior_tests/src/ngt-invalid-json1/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open(os.path.join(single_case_text.case_workspace, "compile_commands.json"), 'w') as f: f.writelines(ret[1:]) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("Expected array", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json10/do_test.py b/behavior_tests/src/ngt-invalid-json10/do_test.py index 69ba8781c..d300ff720 100644 --- a/behavior_tests/src/ngt-invalid-json10/do_test.py +++ b/behavior_tests/src/ngt-invalid-json10/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-json2/do_test.py b/behavior_tests/src/ngt-invalid-json2/do_test.py index 4f41ff9dd..7ebb38bfa 100644 --- a/behavior_tests/src/ngt-invalid-json2/do_test.py +++ b/behavior_tests/src/ngt-invalid-json2/do_test.py @@ -11,7 +11,7 @@ import os import sys from unittest import TestCase -from test_config import CT_TOOL + from test_utils import * @@ -30,7 +30,7 @@ def migrate_test(single_case_text): ret.pop(1) with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("Missing key: \"file\"", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json3/do_test.py b/behavior_tests/src/ngt-invalid-json3/do_test.py index 863a01703..9cc3f5dc8 100644 --- a/behavior_tests/src/ngt-invalid-json3/do_test.py +++ b/behavior_tests/src/ngt-invalid-json3/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -29,7 +29,7 @@ def migrate_test(single_case_text): ret.pop(5) with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("Expected Key, Flow Entry, or Flow Mapping End", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json4/do_test.py b/behavior_tests/src/ngt-invalid-json4/do_test.py index 73d08f17c..dbb334b4c 100644 --- a/behavior_tests/src/ngt-invalid-json4/do_test.py +++ b/behavior_tests/src/ngt-invalid-json4/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -29,7 +29,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: ret.pop(6) f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("Could not find closing ]", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json5/do_test.py b/behavior_tests/src/ngt-invalid-json5/do_test.py index cae23d777..5aa2f16fb 100644 --- a/behavior_tests/src/ngt-invalid-json5/do_test.py +++ b/behavior_tests/src/ngt-invalid-json5/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json6/do_test.py b/behavior_tests/src/ngt-invalid-json6/do_test.py index 1a1726ad7..f9b7b2313 100644 --- a/behavior_tests/src/ngt-invalid-json6/do_test.py +++ b/behavior_tests/src/ngt-invalid-json6/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -30,7 +30,7 @@ def migrate_test(single_case_text): ret.append(line) with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json7/do_test.py b/behavior_tests/src/ngt-invalid-json7/do_test.py index 9da3ea7e7..7bcdab6e5 100644 --- a/behavior_tests/src/ngt-invalid-json7/do_test.py +++ b/behavior_tests/src/ngt-invalid-json7/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("Unknown key: \"\"output\"\"", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-invalid-json8/do_test.py b/behavior_tests/src/ngt-invalid-json8/do_test.py index 0bad753d7..4b813b131 100644 --- a/behavior_tests/src/ngt-invalid-json8/do_test.py +++ b/behavior_tests/src/ngt-invalid-json8/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -31,7 +31,7 @@ def migrate_test(single_case_text): with open(os.path.join(single_case_text.case_workspace, "compile_commands.json"), 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("Unknown key: \"\"arguments\"\"", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-json9/do_test.py b/behavior_tests/src/ngt-invalid-json9/do_test.py index 00dd113e8..f670dc3f2 100644 --- a/behavior_tests/src/ngt-invalid-json9/do_test.py +++ b/behavior_tests/src/ngt-invalid-json9/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -34,7 +34,7 @@ def migrate_test(single_case_text): with open("compile_commands.json", 'w') as f: f.writelines(ret) - call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + ' -p=./ --cuda-include-path=' + single_case_text.include_path, single_case_text) return is_sub_string("Processed 1 file(s)", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py index a4d25bfbd..a04052150 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format1/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " hello.cu", single_case_text) return is_sub_string("invalid number", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py index 73deb8e95..99dbdc060 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format2/do_test.py @@ -11,7 +11,7 @@ import os import sys from unittest import TestCase -from test_config import CT_TOOL + from test_utils import * @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " hello.cu", single_case_text) return is_sub_string("invalid number", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py index 5dbdcafa3..4ec4dade5 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format3/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " hello.cu", single_case_text) return is_sub_string("invalid number", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py index 6cbbd420c..50585e4a9 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-format4/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " hello.cu", single_case_text) return is_sub_string("unknown key \'ColumnLimi\'", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py index ae844df8c..6071b7762 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header1/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open('out/hello.h.yaml', 'r') as f: @@ -28,7 +28,7 @@ def migrate_test(single_case_text): with open('out/hello.h.yaml', 'w') as f: f.write(file_data) - call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) if "error: unknown key \'ConstantFla\'" in single_case_text.print_text: return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py index 187438530..8e326ce8f 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) with open('out/hello.h.yaml', 'r') as f: @@ -28,7 +28,7 @@ def migrate_test(single_case_text): with open('out/hello.h.yaml', 'w') as f: f.write(file_data) - call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) if "Unexpected token. Expected Key or Block End" in single_case_text.print_text: return True diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py index 99dec196c..55c3b41a8 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header3/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): print("test-----------------") - call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' hello.h --out-root=out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) file_data="" with open('out/hello.h.yaml', 'r') as f: @@ -30,7 +30,7 @@ def migrate_test(single_case_text): with open('out/hello.h.yaml', 'w') as f: f.write(file_data) - call_subprocess(test_config.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ + call_subprocess(single_case_text.CT_TOOL + ' hello.h --out-root=./out --cuda-include-path=' + \ os.environ['CUDA_INCLUDE_PATH'], single_case_text) print(single_case_text.print_text) if "Unexpected token. Expected Key or Block End" in single_case_text.print_text: diff --git a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py index 521188316..813d47c08 100644 --- a/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-invalid-yaml-for-header4/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ + call_subprocess(single_case_text.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"], single_case_text) migrated_yaml = os.path.join("out", "hello.h.yaml") with open(migrated_yaml, "r") as f: @@ -28,7 +28,7 @@ def migrate_test(single_case_text): with open(migrated_yaml, "w") as f: f.write(file_data) - call_subprocess(test_config.CT_TOOL + " hello.h --out-root=./out --cuda-include-path=" + \ + call_subprocess(single_case_text.CT_TOOL + " hello.h --out-root=./out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"], single_case_text) if "differnt path" in single_case_text.print_text: return True diff --git a/behavior_tests/src/ngt-level-verbosity/do_test.py b/behavior_tests/src/ngt-level-verbosity/do_test.py index 3fd002b47..b5a9c31cd 100644 --- a/behavior_tests/src/ngt-level-verbosity/do_test.py +++ b/behavior_tests/src/ngt-level-verbosity/do_test.py @@ -11,7 +11,7 @@ import os import sys from unittest import TestCase -from test_config import CT_TOOL + from test_utils import * @@ -21,7 +21,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --usm-level=abc --output-verbositi=abc", single_case_text) return is_sub_string("Unknown command line argument '--output-verbositi=abc'", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-no-db-specified/do_test.py b/behavior_tests/src/ngt-no-db-specified/do_test.py index a70755672..79a259c8c 100644 --- a/behavior_tests/src/ngt-no-db-specified/do_test.py +++ b/behavior_tests/src/ngt-no-db-specified/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " -in-root=./ -out-root=out -p=./", single_case_text) return is_sub_string("Error: Cannot find compilation database", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py index 4ae979f92..7da739be7 100644 --- a/behavior_tests/src/ngt-no-explicit-inroot/do_test.py +++ b/behavior_tests/src/ngt-no-explicit-inroot/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: The option --process-all requires that the", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-no-file-type/do_test.py b/behavior_tests/src/ngt-no-file-type/do_test.py index 82ec12a66..7f8536101 100644 --- a/behavior_tests/src/ngt-no-file-type/do_test.py +++ b/behavior_tests/src/ngt-no-file-type/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("File Type not available for input file", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-no-source-name/do_test.py b/behavior_tests/src/ngt-no-source-name/do_test.py index f9186a083..61dadd8dd 100644 --- a/behavior_tests/src/ngt-no-source-name/do_test.py +++ b/behavior_tests/src/ngt-no-source-name/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " vector_add", single_case_text) return is_sub_string("does not have an extension", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-opt-parsing-err/do_test.py b/behavior_tests/src/ngt-opt-parsing-err/do_test.py index cbc94bfa6..7c7a14331 100644 --- a/behavior_tests/src/ngt-opt-parsing-err/do_test.py +++ b/behavior_tests/src/ngt-opt-parsing-err/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --in-rooooot=/aaa --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo.cu --in-rooooot=/aaa --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Option parsing error", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-out-root-len/do_test.py b/behavior_tests/src/ngt-out-root-len/do_test.py index 2905506f8..160725234 100644 --- a/behavior_tests/src/ngt-out-root-len/do_test.py +++ b/behavior_tests/src/ngt-out-root-len/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path +" --out-root="+ + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path +" --out-root="+ long_path, single_case_text) return is_sub_string("should be less than", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-output-access/do_test.py b/behavior_tests/src/ngt-output-access/do_test.py index 4aad00b85..3c9ab96b7 100644 --- a/behavior_tests/src/ngt-output-access/do_test.py +++ b/behavior_tests/src/ngt-output-access/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): os.mkdir("dpct_output") call_subprocess("chmod u-r dpct_output", single_case_text) - call_subprocess("dpct vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess("dpct vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Could not access output directory", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-create/do_test.py b/behavior_tests/src/ngt-output-create/do_test.py index b287d8232..fceb643f9 100644 --- a/behavior_tests/src/ngt-output-create/do_test.py +++ b/behavior_tests/src/ngt-output-create/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " vector_add.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " vector_add.cu --out-root=out --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Unable to save the output to the specified directory", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-file-len/do_test.py b/behavior_tests/src/ngt-output-file-len/do_test.py index 1a3149a81..31af5ead0 100644 --- a/behavior_tests/src/ngt-output-file-len/do_test.py +++ b/behavior_tests/src/ngt-output-file-len/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --output-file=" +long_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --output-file=" +long_path, single_case_text) return is_sub_string("should be less than", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-not-empty/do_test.py b/behavior_tests/src/ngt-output-not-empty/do_test.py index 4208d405e..779211806 100644 --- a/behavior_tests/src/ngt-output-not-empty/do_test.py +++ b/behavior_tests/src/ngt-output-not-empty/do_test.py @@ -21,7 +21,7 @@ def migrate_test(single_case_text): os.mkdir("dpct_output") with open(os.path.join("dpct_output", "test"), 'w') as f: f.write("2") - call_subprocess(test_config.CT_TOOL + " vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " vector_add.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("directory is not empty.", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-output-verbosity/do_test.py b/behavior_tests/src/ngt-output-verbosity/do_test.py index 8fb83a812..219b7a490 100644 --- a/behavior_tests/src/ngt-output-verbosity/do_test.py +++ b/behavior_tests/src/ngt-output-verbosity/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --output-verbosity=abc", single_case_text) return is_sub_string("--output-verbosity option: Cannot find option named", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-report-file-len/do_test.py b/behavior_tests/src/ngt-report-file-len/do_test.py index 1c253e280..659e7d006 100644 --- a/behavior_tests/src/ngt-report-file-len/do_test.py +++ b/behavior_tests/src/ngt-report-file-len/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -27,7 +27,7 @@ def migrate_test(single_case_text): for num in range(0, max_len): long_path = os.path.join(long_path, "test_path") os.path.join(long_path, "name") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " --report-file-prefix=" +long_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --report-file-prefix=" +long_path, single_case_text) return is_sub_string("should be less than 128", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-report-file-prefix/do_test.py b/behavior_tests/src/ngt-report-file-prefix/do_test.py index 3cf8079e1..474f25f26 100644 --- a/behavior_tests/src/ngt-report-file-prefix/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --report-file-prefix=abc:", single_case_text) return is_sub_string("contains special character ':'", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-report-file-prefix2/do_test.py b/behavior_tests/src/ngt-report-file-prefix2/do_test.py index 828b9bc02..4e1bca92f 100644 --- a/behavior_tests/src/ngt-report-file-prefix2/do_test.py +++ b/behavior_tests/src/ngt-report-file-prefix2/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --report-file-prefix=\"/abc\"", single_case_text) return is_sub_string("contains special character", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-report-format1/do_test.py b/behavior_tests/src/ngt-report-format1/do_test.py index ac3915542..d34773813 100644 --- a/behavior_tests/src/ngt-report-format1/do_test.py +++ b/behavior_tests/src/ngt-report-format1/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --report-format=abc", single_case_text) return is_sub_string("--report-format option: Cannot find option named", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-report-format2/do_test.py b/behavior_tests/src/ngt-report-format2/do_test.py index b8f59125c..3216be2a8 100644 --- a/behavior_tests/src/ngt-report-format2/do_test.py +++ b/behavior_tests/src/ngt-report-format2/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --report-format=xx vector_add.cu", single_case_text) return is_sub_string("--report-format option: Cannot find option named 'xx'!", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-report-type-diags/do_test.py b/behavior_tests/src/ngt-report-type-diags/do_test.py index 440065229..7d8d0f017 100644 --- a/behavior_tests/src/ngt-report-type-diags/do_test.py +++ b/behavior_tests/src/ngt-report-type-diags/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --report-type=xxx --report-diags-content=transformation vector_add.cu", single_case_text) return is_sub_string("--report-type option: Cannot find option named 'xxx'!", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-report-type/do_test.py b/behavior_tests/src/ngt-report-type/do_test.py index 5e05d2d5f..ca6e31b62 100644 --- a/behavior_tests/src/ngt-report-type/do_test.py +++ b/behavior_tests/src/ngt-report-type/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --report-type=abc", single_case_text) return is_sub_string("--report-type option: Cannot find option named", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py index 8a17d64d0..253c16c1b 100644 --- a/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py +++ b/behavior_tests/src/ngt-rpt-prefix-too-long/do_test.py @@ -18,8 +18,8 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu -report-format=csv -report-file-prefix=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ - --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo.cu -report-format=csv -report-file-prefix=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ + --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Prefix is too long", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py index 34f69e932..18701b463 100644 --- a/behavior_tests/src/ngt-save-out-fail-lin/do_test.py +++ b/behavior_tests/src/ngt-save-out-fail-lin/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): call_subprocess("mkdir ./read_only_folder", single_case_text) call_subprocess("chmod 0444 ./read_only_folder", single_case_text) - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --out-root=./read_only_folder --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo.cu --out-root=./read_only_folder --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Unable to save the output to the specified directory", single_case_text.print_text) def build_test(single_case_text): call_subprocess("rm -rf ./read_only_folder", single_case_text) diff --git a/behavior_tests/src/ngt-show-help/do_test.py b/behavior_tests/src/ngt-show-help/do_test.py index dc94102e8..796e72771 100644 --- a/behavior_tests/src/ngt-show-help/do_test.py +++ b/behavior_tests/src/ngt-show-help/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL, single_case_text) + call_subprocess(single_case_text.CT_TOOL, single_case_text) return is_sub_string("To get help on the tool usage", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py index 4ae979f92..7da739be7 100644 --- a/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py +++ b/behavior_tests/src/ngt-skip-for-missing-cmd/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " simple_foo.cu --process-all --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Error: The option --process-all requires that the", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py index b253eb40e..bcbca1521 100644 --- a/behavior_tests/src/ngt-stop-on-parse-err/do_test.py +++ b/behavior_tests/src/ngt-stop-on-parse-err/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --stop-on-parse-err vector_add.cu", single_case_text) return is_sub_string("Cannot parse input", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings1/do_test.py b/behavior_tests/src/ngt-suppress-warnings1/do_test.py index ea95ef28b..e9a9aa679 100644 --- a/behavior_tests/src/ngt-suppress-warnings1/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings1/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=100e", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings10/do_test.py b/behavior_tests/src/ngt-suppress-warnings10/do_test.py index a46f0aa34..784786916 100644 --- a/behavior_tests/src/ngt-suppress-warnings10/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings10/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=1000-1900", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings11/do_test.py b/behavior_tests/src/ngt-suppress-warnings11/do_test.py index 0e7bb96be..e48050bf7 100644 --- a/behavior_tests/src/ngt-suppress-warnings11/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings11/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=1010-1020-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings2/do_test.py b/behavior_tests/src/ngt-suppress-warnings2/do_test.py index 37da5aa7e..51e02c51e 100644 --- a/behavior_tests/src/ngt-suppress-warnings2/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings2/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess( test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ + call_subprocess( single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + \ " --suppress-warnings=999", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings3/do_test.py b/behavior_tests/src/ngt-suppress-warnings3/do_test.py index 373bedd7e..ec0b4532a 100644 --- a/behavior_tests/src/ngt-suppress-warnings3/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings3/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=1900", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings4/do_test.py b/behavior_tests/src/ngt-suppress-warnings4/do_test.py index ed996a222..e7c3e7771 100644 --- a/behavior_tests/src/ngt-suppress-warnings4/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings4/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=-1000", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings5/do_test.py b/behavior_tests/src/ngt-suppress-warnings5/do_test.py index 3fbcea056..76a085896 100644 --- a/behavior_tests/src/ngt-suppress-warnings5/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings5/do_test.py @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=1000-", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings6/do_test.py b/behavior_tests/src/ngt-suppress-warnings6/do_test.py index 639055648..2af671b9e 100644 --- a/behavior_tests/src/ngt-suppress-warnings6/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings6/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=999-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings7/do_test.py b/behavior_tests/src/ngt-suppress-warnings7/do_test.py index bc214a452..9fd137908 100644 --- a/behavior_tests/src/ngt-suppress-warnings7/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings7/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=100e-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings8/do_test.py b/behavior_tests/src/ngt-suppress-warnings8/do_test.py index bc214a452..9fd137908 100644 --- a/behavior_tests/src/ngt-suppress-warnings8/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings8/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=100e-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-suppress-warnings9/do_test.py b/behavior_tests/src/ngt-suppress-warnings9/do_test.py index f6520d4fc..9e27d9302 100644 --- a/behavior_tests/src/ngt-suppress-warnings9/do_test.py +++ b/behavior_tests/src/ngt-suppress-warnings9/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --suppress-warnings=1010-1020-1023", single_case_text) return is_sub_string("Invalid warning ID or range:", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py index af5b95124..cb48e1063 100644 --- a/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py +++ b/behavior_tests/src/ngt-use-dpcpp-extensions/do_test.py @@ -9,7 +9,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --use-dpcpp-extensions=abc", single_case_text) return is_sub_string("Cannot find option named 'abc'", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-usm-leve/do_test.py b/behavior_tests/src/ngt-usm-leve/do_test.py index 0a4ae653e..1817aab94 100644 --- a/behavior_tests/src/ngt-usm-leve/do_test.py +++ b/behavior_tests/src/ngt-usm-leve/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " --usm-leve=abc", single_case_text) return is_sub_string("Unknown command line argument '--usm-leve=abc'", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-usm-level/do_test.py b/behavior_tests/src/ngt-usm-level/do_test.py index 9bd4b7de5..e7abb120f 100644 --- a/behavior_tests/src/ngt-usm-level/do_test.py +++ b/behavior_tests/src/ngt-usm-level/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + \ " --usm-level=abc", single_case_text) return is_sub_string("--usm-level option: Cannot find option named 'abc'", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py index b8a96615e..b26fe76c4 100644 --- a/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-does-not-exist/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --vcxprojfile=aaa.vcxproj --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --vcxprojfile=aaa.vcxproj --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("Cannot Open VcxprojFile", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py index 2e5b8843f..6610e371d 100644 --- a/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py +++ b/behavior_tests/src/ngt-vcxproj-to-db-fail/do_test.py @@ -23,7 +23,7 @@ def migrate_test(single_case_text): vcxproj_path = os.path.join(os.getcwd(), "source", "aaa.vcxproj") source_path = os.path.join(os.getcwd(), "source", "simple_foo.cu") - call_subprocess(test_config.CT_TOOL + " " + source_path + " --vcxprojfile=\"" + vcxproj_path + "\" --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " " + source_path + " --vcxprojfile=\"" + vcxproj_path + "\" --cuda-include-path=" + single_case_text.include_path, single_case_text) call_subprocess("icacls ./source /grant Everyone\:\(WD\)", single_case_text) return is_sub_string("Cannot create CompilationDatabase", single_case_text.print_text) diff --git a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py index 6179b8c76..91c463f1b 100644 --- a/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py +++ b/behavior_tests/src/ngt-win-invalid-yaml-for-header4/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ + call_subprocess(single_case_text.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"], single_case_text) migrated_yaml = os.path.join("out", "hello.h.yaml") with open(migrated_yaml, "r") as f: @@ -28,7 +28,7 @@ def migrate_test(single_case_text): with open(migrated_yaml, "w") as f: f.write(file_data) - call_subprocess(test_config.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ + call_subprocess(single_case_text.CT_TOOL + " hello.h --out-root=out --cuda-include-path=" + \ os.environ["CUDA_INCLUDE_PATH"], single_case_text) if "differnt path" in single_case_text.print_text: return True diff --git a/behavior_tests/src/ngtn-database-fail/do_test.py b/behavior_tests/src/ngtn-database-fail/do_test.py index 9f0d1c690..04d31a3cb 100644 --- a/behavior_tests/src/ngtn-database-fail/do_test.py +++ b/behavior_tests/src/ngtn-database-fail/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -20,7 +20,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " -p=. -in-root=./ -out-root=out", single_case_text) return is_sub_string("Cannot parse compilation database", single_case_text.print_text) diff --git a/behavior_tests/src/nominmax_bd/do_test.py b/behavior_tests/src/nominmax_bd/do_test.py index 7159ca6b7..64950708e 100644 --- a/behavior_tests/src/nominmax_bd/do_test.py +++ b/behavior_tests/src/nominmax_bd/do_test.py @@ -25,5 +25,5 @@ def build_test(single_case_text): return compile_and_link(srcs, single_case_text) def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter return run_binary_with_args(single_case_text) \ No newline at end of file diff --git a/behavior_tests/src/path_validation_0/do_test.py b/behavior_tests/src/path_validation_0/do_test.py index 792d67779..134139097 100644 --- a/behavior_tests/src/path_validation_0/do_test.py +++ b/behavior_tests/src/path_validation_0/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make", single_case_text) change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst", single_case_text) - call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/test.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/test.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("is not under the specified input root directory", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/path_validation_1/do_test.py b/behavior_tests/src/path_validation_1/do_test.py index 732c4eb75..12e52ed02 100644 --- a/behavior_tests/src/path_validation_1/do_test.py +++ b/behavior_tests/src/path_validation_1/do_test.py @@ -22,7 +22,7 @@ def migrate_test(single_case_text): call_subprocess("intercept-build /usr/bin/make", single_case_text) change_dir("..", single_case_text) call_subprocess("mv helloworld helloworld_tst", single_case_text) - call_subprocess(test_config.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/rootdir/../test.cu --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " -in-root=helloworld_tst/src/rootdir helloworld_tst/src/rootdir/../test.cu --cuda-include-path=" + single_case_text.include_path, single_case_text) return is_sub_string("is not under the specified input root directory", single_case_text.print_text) def build_test(single_case_text): diff --git a/behavior_tests/src/relative_path_test/do_test.py b/behavior_tests/src/relative_path_test/do_test.py index 657ca8fb0..c4b384024 100644 --- a/behavior_tests/src/relative_path_test/do_test.py +++ b/behavior_tests/src/relative_path_test/do_test.py @@ -19,7 +19,7 @@ def setup_test(single_case_text): def migrate_test(single_case_text): change_dir("build", single_case_text) - call_subprocess(test_config.CT_TOOL + " -in-root ../src -out-root ../sycl -p ./ --cuda-include-path=" + test_config.include_path, single_case_text) + call_subprocess(single_case_text.CT_TOOL + " -in-root ../src -out-root ../sycl -p ./ --cuda-include-path=" + single_case_text.include_path, single_case_text) change_dir("..", single_case_text) return os.path.exists(os.path.join("sycl", "kernel.dp.cpp")) diff --git a/behavior_tests/src/sh-ct-1306/do_test.py b/behavior_tests/src/sh-ct-1306/do_test.py index 586a96ed0..2b0777d4b 100644 --- a/behavior_tests/src/sh-ct-1306/do_test.py +++ b/behavior_tests/src/sh-ct-1306/do_test.py @@ -18,7 +18,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - os.environ["CUDA_INCLUDE_PATH"] = test_config.include_path + os.environ["CUDA_INCLUDE_PATH"] = single_case_text.include_path return call_subprocess("/bin/bash sh-ct-1306.sh", single_case_text) def build_test(single_case_text): diff --git a/features/feature_case/backprop/do_test.py b/features/feature_case/backprop/do_test.py index 359e5155d..deff15757 100644 --- a/features/feature_case/backprop/do_test.py +++ b/features/feature_case/backprop/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -19,7 +19,7 @@ def setup_test(single_case_text): return True def migrate_test(single_case_text): - call_subprocess(test_config.CT_TOOL + " -out-root=./ backprop.c --cuda-include-path=" + test_config.include_path + " --", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " -out-root=./ backprop.c --cuda-include-path=" + single_case_text.include_path + " --", single_case_text) return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.print_text) def build_test(single_case_text): return True diff --git a/features/feature_case/cudnn_multiple_files/do_test.py b/features/feature_case/cudnn_multiple_files/do_test.py index e92fe5fb5..ad04b8cd1 100644 --- a/features/feature_case/cudnn_multiple_files/do_test.py +++ b/features/feature_case/cudnn_multiple_files/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -25,7 +25,7 @@ def migrate_test(single_case_text): call_subprocess("sed 's/main/scale_main/' cudnn-scale.cu --in-place", single_case_text) call_subprocess("sed 's/main/sum_main/' cudnn-sum.cu --in-place", single_case_text) - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " multiple_main.cpp cudnn-scale.cu cudnn-sum.cu", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " multiple_main.cpp cudnn-scale.cu cudnn-sum.cu", single_case_text) return os.path.exists(os.path.join("dpct_output", "cudnn-scale.dp.cpp")) def build_test(single_case_text): @@ -36,10 +36,10 @@ def build_test(single_case_text): cmp_options.append("-DMKL_ILP64") if platform.system() == 'Linux': - linkopt = test_config.mkl_link_opt_lin + linkopt = single_case_text.mkl_link_opt_lin linkopt.append(" -ldnnl") else: - linkopt = test_config.mkl_link_opt_win + linkopt = single_case_text.mkl_link_opt_win linkopt.append(" dnnl.lib") srcs.append(os.path.join("dpct_output", "multiple_main.cpp")) diff --git a/features/feature_case/kernel_library/do_test.py b/features/feature_case/kernel_library/do_test.py index 9ffbf4bf5..3f7c0abd7 100644 --- a/features/feature_case/kernel_library/do_test.py +++ b/features/feature_case/kernel_library/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -22,14 +22,14 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " kernel_library.cpp jit.cu --extra-arg=--ptx", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " kernel_library.cpp jit.cu --extra-arg=--ptx", single_case_text) return os.path.exists(os.path.join("dpct_output", "kernel_library.cpp.dp.cpp")) def build_test(single_case_text): # make shared library if (platform.system() == 'Windows'): ret = call_subprocess("icpx -fsycl dpct_output/jit.dp.cpp -shared -o premade.ptx", single_case_text) else: - ret = call_subprocess(test_config.DPCXX_COM + " dpct_output/jit.dp.cpp -fPIC -shared -o premade.ptx", single_case_text) + ret = call_subprocess(single_case_text.DPCXX_COM + " dpct_output/jit.dp.cpp -fPIC -shared -o premade.ptx", single_case_text) if not ret: print("Could not make premade.ptx shared library.") return False diff --git a/features/feature_case/module/do_test.py b/features/feature_case/module/do_test.py index 408bb9d07..e06fccfd2 100644 --- a/features/feature_case/module/do_test.py +++ b/features/feature_case/module/do_test.py @@ -10,7 +10,7 @@ import platform import os import sys -from test_config import CT_TOOL + from test_utils import * @@ -22,14 +22,14 @@ def migrate_test(single_case_text): # clean previous migration output if (os.path.exists("dpct_output")): shutil.rmtree("dpct_output") - call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " module-helper.cpp module-main.cu module-kernel.cu --extra-arg=--ptx", single_case_text) + call_subprocess(single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + " module-helper.cpp module-main.cu module-kernel.cu --extra-arg=--ptx", single_case_text) return os.path.exists(os.path.join("dpct_output", "module-kernel.dp.cpp")) def build_test(single_case_text): # make shared library if (platform.system() == 'Windows'): ret = call_subprocess("icpx -fsycl dpct_output/module-kernel.dp.cpp -shared -o module-kernel.dll", single_case_text) else: - ret = call_subprocess(test_config.DPCXX_COM + " dpct_output/module-kernel.dp.cpp -fPIC -shared -o module-kernel.so", single_case_text) + ret = call_subprocess(single_case_text.DPCXX_COM + " dpct_output/module-kernel.dp.cpp -fPIC -shared -o module-kernel.so", single_case_text) if not ret: print("Could not make module-kernel.* shared library.") return False diff --git a/features/test_feature.py b/features/test_feature.py index 6d8055bc6..ea2f8e31b 100644 --- a/features/test_feature.py +++ b/features/test_feature.py @@ -144,9 +144,9 @@ def build_test(single_case_text): if re.match('^cu.*', single_case_text.name): if platform.system() == 'Linux': - link_opts = test_config.mkl_link_opt_lin + link_opts = single_case_text.mkl_link_opt_lin else: - link_opts = test_config.mkl_link_opt_win + link_opts = single_case_text.mkl_link_opt_win cmp_options.append("-DMKL_ILP64") if single_case_text.name.startswith('ccl-test'): @@ -183,7 +183,7 @@ def build_test(single_case_text): def run_test(single_case_text): if single_case_text.name not in exec_tests: return True - os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter + os.environ['ONEAPI_DEVICE_SELECTOR'] = single_case_text.device_filter os.environ['CL_CONFIG_CPU_EXPERIMENTAL_FP16']="1" if single_case_text.name.startswith('ccl-test'): return call_subprocess('mpirun -n 2 ' + os.path.join(os.path.curdir, single_case_text.name + '.run '),single_case_text) diff --git a/help_function/test_help.py b/help_function/test_help.py index 1be43b0aa..c1f0c83a9 100644 --- a/help_function/test_help.py +++ b/help_function/test_help.py @@ -68,7 +68,7 @@ def build_test(single_case_text): if single_case_text.name == "test_default_queue_2": srcs.append("test_default_queue_1.cpp") if single_case_text.name == "kernel_function_lin": - ret = call_subprocess(test_config.DPCXX_COM + " -shared -fPIC -o module.so kernel_module_lin.cpp", single_case_text) + ret = call_subprocess(single_case_text.DPCXX_COM + " -shared -fPIC -o module.so kernel_module_lin.cpp", single_case_text) if not ret: print("kernel_function_lin created the shared lib failed.") return False @@ -88,9 +88,9 @@ def build_test(single_case_text): single_case_text.name in oneDNN_related) or (single_case_text.name in sparse_cases): mkl_opts = [] if platform.system() == "Linux": - mkl_opts = test_config.mkl_link_opt_lin + mkl_opts = single_case_text.mkl_link_opt_lin else: - mkl_opts = test_config.mkl_link_opt_win + mkl_opts = single_case_text.mkl_link_opt_win link_opts += mkl_opts cmp_opts.append("-DMKL_ILP64") @@ -102,7 +102,7 @@ def build_test(single_case_text): def run_test(single_case_text): - os.environ["ONEAPI_DEVICE_SELECTOR"] = test_config.device_filter + os.environ["ONEAPI_DEVICE_SELECTOR"] = single_case_text.device_filter args = [] if single_case_text.name == "kernel_function_lin": args.append("./module.so") diff --git a/regressions/test_regression.py b/regressions/test_regression.py index cc08ce382..5ad8b4194 100644 --- a/regressions/test_regression.py +++ b/regressions/test_regression.py @@ -55,9 +55,9 @@ def build_test(single_case_text): if single_case_text.name in mkl_related_cases: if platform.system() == 'Linux': - link_opts = test_config.mkl_link_opt_lin + link_opts = single_case_text.mkl_link_opt_lin else: - link_opts = test_config.mkl_link_opt_win + link_opts = single_case_text.mkl_link_opt_win ret = False ret = compile_and_link(srcs, single_case_text, cmp_opts, objects, link_opts) return ret @@ -68,5 +68,5 @@ def run_test(single_case_text): return True if single_case_text.name == "test-1601": args.append("12 12 12") - os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter + os.environ['ONEAPI_DEVICE_SELECTOR'] = single_case_text.device_filter return run_binary_with_args(single_case_text, args) diff --git a/run_test.py b/run_test.py index f7b6811a7..8a106bc25 100644 --- a/run_test.py +++ b/run_test.py @@ -64,7 +64,7 @@ def __init__(self, case_name, test_dep_files, option_rule_list, platform_rule_li self.split_group = split_group class case_text: - def __init__(self, case_name, command_file = "", command_text = "", log_file = "", log_text = "", + def __init__(self, single_run_config, case_name, command_file = "", command_text = "", log_file = "", log_text = "", result_file = "", result_text = "", print_text = ""): self.name = case_name self.command_file = command_file @@ -78,6 +78,25 @@ def __init__(self, case_name, command_file = "", command_text = "", log_file = " self.out_root = "" self.run_flag = False self.case_workspace = "" + self.mkl_link_opt_lin = ["-lmkl_intel_ilp64", "-lmkl_sequential", "-lmkl_core", + "-lOpenCL", "-lmkl_sycl", "-lpthread", "-ldl"] + self.mkl_link_opt_win = ["mkl_sycl_dll.lib", "mkl_intel_ilp64_dll.lib", + "mkl_sequential_dll.lib", "mkl_core_dll.lib", "OpenCL.lib"] + self.DPCXX_COM = single_run_config.DPCXX_COM + self.CT_TOOL = single_run_config.CT_TOOL + self.include_path = single_run_config.include_path + self.migrate_option = single_run_config.migrate_option + self.timeout = single_run_config.timeout + self.device_filter = single_run_config.device_filter + +class case_run_config: + def __init__(self, DPCXX_COM, CT_TOOL, include_path, migrate_option, timeout, device_filter): + self.DPCXX_COM = DPCXX_COM + self.CT_TOOL = CT_TOOL + self.include_path = include_path + self.migrate_option = migrate_option + self.timeout = timeout + self.device_filter = device_filter def parse_suite_cfg(suite_name, root_path): @@ -291,8 +310,8 @@ def is_option_supported(option_rule_list): return False return True -def test_single_case(current_test, single_case_config, workspace, suite_root_path): - single_case_text = case_text(current_test, os.path.join(workspace, "command.tst"),"", +def test_single_case(current_test, single_case_config, workspace, suite_root_path, single_run_config): + single_case_text = case_text(single_run_config, current_test, os.path.join(workspace, "command.tst"),"", os.path.join(workspace, current_test + ".lf"), "", os.path.join(workspace, "result.md"), "", "") module = import_test_driver(suite_root_path) @@ -362,10 +381,12 @@ def test_suite(suite_root_path, suite_name, opt): results = [] for current_test, single_case_config in test_config.suite_cfg.test_config_map.items(): + single_run_config = case_run_config(test_config.DPCXX_COM, test_config.CT_TOOL, test_config.include_path, + test_config.migrate_option, test_config.timeout, test_config.device_filter) result = pool.apply_async(test_single_case, (current_test, single_case_config, test_workspace, - suite_root_path,)) + suite_root_path, single_run_config,)) # store all msg - results.append([result, current_test, single_case_config, test_workspace, suite_root_path]) + results.append([result, current_test, single_case_config, test_workspace, suite_root_path, single_run_config]) for result_iter in results: ret = result_iter[0].get() @@ -393,7 +414,9 @@ def test_single_case_in_suite(suite_root_path, suite_name, case, option): if case not in suite_cfg.test_config_map.keys(): exit("The test case " + case + " is not in the " + suite_name + " test suite! Please double check.") single_case_config = suite_cfg.test_config_map[case] - single_case_text = test_single_case(case, single_case_config, test_workspace, suite_root_path) + single_run_config = case_run_config(test_config.DPCXX_COM, test_config.CT_TOOL, test_config.include_path, + test_config.migrate_option, test_config.timeout, test_config.device_filter) + single_case_text = test_single_case(case, single_case_config, test_workspace, suite_root_path, single_run_config) record_msg_case(single_case_text) return single_case_text.run_flag diff --git a/samples/test_samples.py b/samples/test_samples.py index b9d3f3faa..b1c1c02cf 100644 --- a/samples/test_samples.py +++ b/samples/test_samples.py @@ -47,5 +47,5 @@ def build_test(single_case_text): return ret def run_test(single_case_text): - os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter + os.environ['ONEAPI_DEVICE_SELECTOR'] = single_case_text.device_filter return run_binary_with_args(single_case_text) diff --git a/test_config.py b/test_config.py index f45e53c0a..1a6df9c3b 100644 --- a/test_config.py +++ b/test_config.py @@ -21,19 +21,11 @@ option_map = "" # Option mapping table. Ref: option_mapping.json root_path = "" # The root path of test repo. timeout = 1200 # The time limit for each test case. -back_end_device = "" # The default device for the test. Device can be "opencl:cpu", "opencl:gpu" and "level_zero:gpu". # For all the devices: https://intel.github.io/llvm-docs/EnvironmentVariables.html#sycl_device_filter device_filter = "level_zero:gpu" -# Depended libraries -mkl_link_opt_lin = ["-lmkl_intel_ilp64", "-lmkl_sequential", "-lmkl_core", - "-lOpenCL", "-lmkl_sycl", "-lpthread", "-ldl"] - -mkl_link_opt_win = ["mkl_sycl_dll.lib", "mkl_intel_ilp64_dll.lib", "mkl_sequential_dll.lib", "mkl_core_dll.lib", "OpenCL.lib"] - -mkl_comp_opt = ["-DMKL_ILP64"] gpu_device = ["Gen9", "Gen12"] diff --git a/test_utils.py b/test_utils.py index 237a6bde9..b7e02e6f3 100644 --- a/test_utils.py +++ b/test_utils.py @@ -34,11 +34,11 @@ def call_subprocess(cmd, single_case_text): run_on_shell = True complete_process = subprocess.run(cmd, shell=run_on_shell, check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - encoding="utf-8", timeout=test_config.timeout) + encoding="utf-8", timeout=single_case_text.timeout) single_case_text.print_text = complete_process.stdout f.write(complete_process.stdout) except subprocess.TimeoutExpired: - f.write("========= Execution time out(" + str(test_config.timeout) + "s) Please check. ======") + f.write("========= Execution time out(" + str(single_case_text.timeout) + "s) Please check. ======") return False if complete_process.returncode != 0: return False @@ -69,7 +69,7 @@ def print_debug_log(desc, *args): def compile_files(srcs, single_case_text,cmpopts = []): ret = True - base_cmd = test_config.DPCXX_COM + " -c " + base_cmd = single_case_text.DPCXX_COM + " -c " if (platform.system() == 'Windows'): base_cmd += " /EHsc -DNOMINMAX " for src in srcs: @@ -93,7 +93,7 @@ def compile_and_link(srcs, single_case_text,cmpopts = [], objects = [], linkopt new_obj = prepare_obj_name(src) if new_obj not in obj_files: obj_files.append(new_obj) - cmd = test_config.DPCXX_COM + ' ' + ' '.join(obj_files) + ' ' + \ + cmd = single_case_text.DPCXX_COM + ' ' + ' '.join(obj_files) + ' ' + \ ' '.join(linkopt) + ' ' + ' '.join(objects) + ' -o ' + single_case_text.name + '.run' return call_subprocess(cmd, single_case_text) @@ -148,7 +148,7 @@ def append_msg_to_file(file_path, msg): def do_migrate(src, in_root, out_root, single_case_text, extra_args = []): - cmd = test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + \ + cmd = single_case_text.CT_TOOL + " --cuda-include-path=" + single_case_text.include_path + \ ' ' + ' '.join(src) if in_root: cmd += ' --in-root ' + os.path.abspath(in_root) @@ -157,8 +157,8 @@ def do_migrate(src, in_root, out_root, single_case_text, extra_args = []): if extra_args: for arg in extra_args: cmd += ' --extra-arg=\" ' + arg + '\"' - if test_config.migrate_option: - cmd += ' ' + test_config.migrate_option + if single_case_text.migrate_option: + cmd += ' ' + single_case_text.migrate_option return call_subprocess(cmd, single_case_text) def check_migration_result(msg, single_case_text): diff --git a/user_guide_samples/test_guide.py b/user_guide_samples/test_guide.py index b10d6057b..5ba97ad4f 100644 --- a/user_guide_samples/test_guide.py +++ b/user_guide_samples/test_guide.py @@ -28,7 +28,7 @@ def run_test(single_case_text): change_dir(single_case_text.name, single_case_text) test_driver = single_case_text.name + ".py" options = " \" \"" - os.environ['ONEAPI_DEVICE_SELECTOR'] = test_config.device_filter + os.environ['ONEAPI_DEVICE_SELECTOR'] = single_case_text.device_filter call_subprocess("python " + test_driver + options, single_case_text) if "case pass" in single_case_text.print_text: return True From 10246317e3186b3c3c6ee4c742cbd67998aa2242 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Mon, 3 Jul 2023 23:58:04 +0800 Subject: [PATCH 08/10] fix bug Signed-off-by: Ni, Wenhui --- behavior_tests/src/check-windows-version/do_test.py | 12 ++++++------ .../src/execute_from_bundle_root/do_test.py | 4 ++-- behavior_tests/src/execute_from_cuda_path/do_test.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/behavior_tests/src/check-windows-version/do_test.py b/behavior_tests/src/check-windows-version/do_test.py index d3dcf19c2..cf0807108 100644 --- a/behavior_tests/src/check-windows-version/do_test.py +++ b/behavior_tests/src/check-windows-version/do_test.py @@ -17,7 +17,7 @@ def setup_test(single_case_text): change_dir(single_case_text.name, single_case_text) return True -def get_windows_version(arg1, arg2): +def get_windows_version(arg1, arg2, single_case_text): call_subprocess("powershell \"(Get-Item -path " + arg1 + ").VersionInfo." + arg2 + "\"", single_case_text) return single_case_text.print_text @@ -32,11 +32,11 @@ def migrate_test(single_case_text): return False print("dpct's bundled clang version is: {}".format(ct_clang_version)) - file_version = get_windows_version(ct_path, 'FileVersion').strip() - product_version = get_windows_version(ct_path, 'ProductVersion').strip() - product_name = get_windows_version(ct_path, 'ProductName').strip() - file_description = get_windows_version(ct_path, 'FileDescription').strip() - legal_copyright = get_windows_version(ct_path, 'LegalCopyright').strip() + file_version = get_windows_version(ct_path, 'FileVersion', single_case_text).strip() + product_version = get_windows_version(ct_path, 'ProductVersion', single_case_text).strip() + product_name = get_windows_version(ct_path, 'ProductName', single_case_text).strip() + file_description = get_windows_version(ct_path, 'FileDescription', single_case_text).strip() + legal_copyright = get_windows_version(ct_path, 'LegalCopyright', single_case_text).strip() print("====={}'s VersionInfo properties=====".format(ct_path)) print("FileVersion: {}".format(file_version)) diff --git a/behavior_tests/src/execute_from_bundle_root/do_test.py b/behavior_tests/src/execute_from_bundle_root/do_test.py index 4e19f24cd..481f80a6a 100644 --- a/behavior_tests/src/execute_from_bundle_root/do_test.py +++ b/behavior_tests/src/execute_from_bundle_root/do_test.py @@ -16,11 +16,11 @@ def setup_test(single_case_text): change_dir(single_case_text.name, single_case_text) - prepare_execution_folder() + prepare_execution_folder(single_case_text) return True -def prepare_execution_folder(): +def prepare_execution_folder(single_case_text): copy_ct_bin = os.path.dirname(str(shutil.which(single_case_text.CT_TOOL))) distutils.dir_util.copy_tree(copy_ct_bin, "bin") diff --git a/behavior_tests/src/execute_from_cuda_path/do_test.py b/behavior_tests/src/execute_from_cuda_path/do_test.py index c0ee4a8cb..7e9849c27 100644 --- a/behavior_tests/src/execute_from_cuda_path/do_test.py +++ b/behavior_tests/src/execute_from_cuda_path/do_test.py @@ -16,11 +16,11 @@ def setup_test(single_case_text): change_dir(single_case_text.name, single_case_text) - prepare_execution_folder() + prepare_execution_folder(single_case_text) return True -def prepare_execution_folder(): +def prepare_execution_folder(single_case_text): distutils.dir_util.copy_tree(single_case_text.include_path, "include") def migrate_test(single_case_text): From c732b007bc084616de6c3c9655967c92ccd55270 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Sun, 9 Jul 2023 14:04:56 +0800 Subject: [PATCH 09/10] fix win fail --- run_test.py | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/run_test.py b/run_test.py index 8a106bc25..cab203cc7 100644 --- a/run_test.py +++ b/run_test.py @@ -88,15 +88,21 @@ def __init__(self, single_run_config, case_name, command_file = "", command_text self.migrate_option = single_run_config.migrate_option self.timeout = single_run_config.timeout self.device_filter = single_run_config.device_filter + self.cuda_ver = single_run_config.cuda_ver + self.test_option = single_run_config.test_option + self.device = single_run_config.device class case_run_config: - def __init__(self, DPCXX_COM, CT_TOOL, include_path, migrate_option, timeout, device_filter): + def __init__(self, DPCXX_COM, CT_TOOL, include_path, migrate_option, timeout, device_filter, cuda_ver, test_option, backend_device): self.DPCXX_COM = DPCXX_COM self.CT_TOOL = CT_TOOL self.include_path = include_path self.migrate_option = migrate_option self.timeout = timeout self.device_filter = device_filter + self.cuda_ver = cuda_ver + self.test_option = test_option + self.device = backend_device def parse_suite_cfg(suite_name, root_path): @@ -276,37 +282,37 @@ def run_test_driver(module, single_case_text): # Rule1:skip < CUDA 9.2 # Rule2:skip > CUDA 11.4 # Not supported -def is_platform_supported(platform_rule_list): +def is_platform_supported(platform_rule_list, single_case_text): for platform_rule in platform_rule_list: if platform_rule.os_family != platform.system(): continue if platform_rule.cuda_version: version = int(float(re.findall("\d+\.?\d*", platform_rule.cuda_version)[0])) * 1000 print_debug_log("CUDA version is ", version) - print_debug_log("default CUDA version is ", test_config.cuda_ver) + print_debug_log("default CUDA version is ", single_case_text.cuda_ver) print_debug_log("default CUDA range is ", platform_rule.cuda_range) - if platform_rule.cuda_range == "LATER_OR_EQUAL" and test_config.cuda_ver >= version and platform_rule.run_on_this_platform.upper() == "FALSE": + if platform_rule.cuda_range == "LATER_OR_EQUAL" and single_case_text.cuda_ver >= version and platform_rule.run_on_this_platform.upper() == "FALSE": return False - elif platform_rule.cuda_range == "OLDER" and test_config.cuda_ver < version and platform_rule.run_on_this_platform.upper() == "FALSE": + elif platform_rule.cuda_range == "OLDER" and single_case_text.cuda_ver < version and platform_rule.run_on_this_platform.upper() == "FALSE": return False - elif platform_rule.cuda_range == "LATER" and test_config.cuda_ver > version and platform_rule.run_on_this_platform.upper() == "FALSE": + elif platform_rule.cuda_range == "LATER" and single_case_text.cuda_ver > version and platform_rule.run_on_this_platform.upper() == "FALSE": return False - elif platform_rule.cuda_range == "OLDER_OR_EQUAL" and test_config.cuda_ver <= version and platform_rule.run_on_this_platform.upper() == "FALSE": + elif platform_rule.cuda_range == "OLDER_OR_EQUAL" and single_case_text.cuda_ver <= version and platform_rule.run_on_this_platform.upper() == "FALSE": return False - elif platform_rule.cuda_range == "EQUAL" and test_config.cuda_ver == version and platform_rule.run_on_this_platform.upper() == "FALSE": + elif platform_rule.cuda_range == "EQUAL" and single_case_text.cuda_ver == version and platform_rule.run_on_this_platform.upper() == "FALSE": return False else: return platform_rule.run_on_this_platform.upper() == "TRUE" return True -def is_option_supported(option_rule_list): +def is_option_supported(option_rule_list, single_case_text): for option_rule in option_rule_list: - if option_rule.exclude_option != "" and option_rule.exclude_option in test_config.test_option and not option_rule.not_double_type_feature: + if option_rule.exclude_option != "" and option_rule.exclude_option in single_case_text.test_option and not option_rule.not_double_type_feature: return False - elif option_rule.only_option not in test_config.test_option: + elif option_rule.only_option not in single_case_text.test_option: return False - elif option_rule.exclude_option in test_config.test_option and option_rule.not_double_type_feature == "NOT double": - if test_config.backend_device not in test_config.support_double_gpu: + elif option_rule.exclude_option in single_case_text.test_option and option_rule.not_double_type_feature == "NOT double": + if single_case_text.device not in test_config.support_double_gpu: return False return True @@ -315,12 +321,12 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa os.path.join(workspace, current_test + ".lf"), "", os.path.join(workspace, "result.md"), "", "") module = import_test_driver(suite_root_path) - if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list): + if single_case_config.platform_rule_list and not is_platform_supported(single_case_config.platform_rule_list, single_case_text): single_case_text.result_text += current_test + " Skip " + "\n" single_case_text.run_flag = True return single_case_text - if single_case_config.option_rule_list and not is_option_supported(single_case_config.option_rule_list): + if single_case_config.option_rule_list and not is_option_supported(single_case_config.option_rule_list, single_case_text): single_case_text.result_text += current_test + " Skip " + "\n" single_case_text.run_flag = True return single_case_text @@ -382,7 +388,8 @@ def test_suite(suite_root_path, suite_name, opt): for current_test, single_case_config in test_config.suite_cfg.test_config_map.items(): single_run_config = case_run_config(test_config.DPCXX_COM, test_config.CT_TOOL, test_config.include_path, - test_config.migrate_option, test_config.timeout, test_config.device_filter) + test_config.migrate_option, test_config.timeout, test_config.device_filter, + test_config.cuda_ver, test_config.test_option, test_config.backend_device) result = pool.apply_async(test_single_case, (current_test, single_case_config, test_workspace, suite_root_path, single_run_config,)) # store all msg @@ -415,7 +422,8 @@ def test_single_case_in_suite(suite_root_path, suite_name, case, option): exit("The test case " + case + " is not in the " + suite_name + " test suite! Please double check.") single_case_config = suite_cfg.test_config_map[case] single_run_config = case_run_config(test_config.DPCXX_COM, test_config.CT_TOOL, test_config.include_path, - test_config.migrate_option, test_config.timeout, test_config.device_filter) + test_config.migrate_option, test_config.timeout, test_config.device_filter, + test_config.cuda_ver, test_config.test_option, test_config.backend_device) single_case_text = test_single_case(case, single_case_config, test_workspace, suite_root_path, single_run_config) record_msg_case(single_case_text) return single_case_text.run_flag From f615385cfc00640236dc74c585e70278bbf647d0 Mon Sep 17 00:00:00 2001 From: "Ni, Wenhui" Date: Sun, 9 Jul 2023 18:51:43 +0800 Subject: [PATCH 10/10] rerun CI Signed-off-by: Ni, Wenhui --- run_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run_test.py b/run_test.py index cab203cc7..e1ba9fe73 100644 --- a/run_test.py +++ b/run_test.py @@ -376,17 +376,17 @@ def record_msg_case(single_case_text): def test_suite(suite_root_path, suite_name, opt): test_ws_root = os.path.join(os.path.dirname(suite_root_path), "test_workspace") - test_config.suite_cfg = parse_suite_cfg(suite_name, suite_root_path) + cfg_suite = parse_suite_cfg(suite_name, suite_root_path) test_workspace = prepare_test_workspace(test_ws_root, suite_name, opt) suite_result = True failed_cases = [] command_data = "" - test_config.suite_cfg.test_config_map = get_gpu_split_test_suite(test_config.suite_cfg) + cfg_suite.test_config_map = get_gpu_split_test_suite(cfg_suite) # Enable multi process with multiprocessing.Pool(processes= int(multiprocessing.cpu_count() * 0.8)) as pool: results = [] - for current_test, single_case_config in test_config.suite_cfg.test_config_map.items(): + for current_test, single_case_config in cfg_suite.test_config_map.items(): single_run_config = case_run_config(test_config.DPCXX_COM, test_config.CT_TOOL, test_config.include_path, test_config.migrate_option, test_config.timeout, test_config.device_filter, test_config.cuda_ver, test_config.test_option, test_config.backend_device)