Skip to content

Commit 3e6ef0e

Browse files
committed
fix output and command record
Signed-off-by: Ni, Wenhui <[email protected]>
1 parent 999916c commit 3e6ef0e

File tree

122 files changed

+168
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+168
-168
lines changed

behavior_tests/src/bad_input_1/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def migrate_test(single_case_text):
2121

2222
call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " " +
2323
os.path.join("cuda", "migrate_nonbuilding_code.cu"), single_case_text)
24-
return is_sub_string("unknown type name", single_case_text.command_text)
24+
return is_sub_string("unknown type name", single_case_text.print_text)
2525
def build_test(single_case_text):
2626
return True
2727
def run_test(single_case_text):

behavior_tests/src/bt-analysis-scope-path2/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def migrate_test(single_case_text):
5050
os.path.join("cuda", ".."), single_case_text)
5151
return is_sub_string(
5252
f"use the same option set as in previous migration: \"--analysis-scope-path=",
53-
single_case_text.command_text)
53+
single_case_text.print_text)
5454

5555

5656
def build_test(single_case_text):

behavior_tests/src/bt-autocomplete/do_test.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -21,93 +21,93 @@ def migrate_test(single_case_text):
2121

2222
call_subprocess(test_config.CT_TOOL + " --autocomplete=--gen-build", single_case_text)
2323
reference = '--gen-build-script\n'
24-
res = res and (reference == single_case_text.command_text)
24+
res = res and (reference == single_case_text.print_text)
2525

2626
call_subprocess(test_config.CT_TOOL + " --autocomplete=-gen-build", single_case_text)
2727
reference = '-gen-build-script\n'
28-
res = res and (reference == single_case_text.command_text)
28+
res = res and (reference == single_case_text.print_text)
2929

3030
call_subprocess(test_config.CT_TOOL + " --autocomplete=foo")
3131
reference = '\n'
32-
res = res and (reference == single_case_text.command_text)
32+
res = res and (reference == single_case_text.print_text)
3333

3434
call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=#d", single_case_text)
3535
reference = 'detailed\n' + \
3636
'diagnostics\n'
37-
res = res and (reference == single_case_text.command_text)
37+
res = res and (reference == single_case_text.print_text)
3838

3939
call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=#d", single_case_text)
4040
reference = 'detailed\n' + \
4141
'diagnostics\n'
42-
res = res and (reference == single_case_text.command_text)
42+
res = res and (reference == single_case_text.print_text)
4343

4444
call_subprocess(test_config.CT_TOOL + " --autocomplete=--output-verbosity=", single_case_text)
4545
reference = 'detailed\n' + \
4646
'diagnostics\n' + \
4747
'normal\n' + \
4848
'silent\n'
49-
res = res and (reference == single_case_text.command_text)
49+
res = res and (reference == single_case_text.print_text)
5050

5151
call_subprocess(test_config.CT_TOOL + " --autocomplete=-output-verbosity=", single_case_text)
5252
reference = 'detailed\n' + \
5353
'diagnostics\n' + \
5454
'normal\n' + \
5555
'silent\n'
56-
res = res and (reference == single_case_text.command_text)
56+
res = res and (reference == single_case_text.print_text)
5757

5858
call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar##--enable-c", single_case_text)
5959
reference = '--enable-ctad\n'
60-
res = res and (reference == single_case_text.command_text)
60+
res = res and (reference == single_case_text.print_text)
6161

6262
call_subprocess(test_config.CT_TOOL + " --autocomplete=foo#bar###--format-range=#a", single_case_text)
6363
reference = 'all\n'
64-
res = res and (reference == single_case_text.command_text)
64+
res = res and (reference == single_case_text.print_text)
6565

6666
call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file=", single_case_text)
6767
reference = '\n'
68-
res = res and (reference == single_case_text.command_text)
68+
res = res and (reference == single_case_text.print_text)
6969

7070
call_subprocess(test_config.CT_TOOL + " --autocomplete=--rule-file", single_case_text)
7171
reference = '--rule-file\n'
72-
res = res and (reference == single_case_text.command_text)
72+
res = res and (reference == single_case_text.print_text)
7373

7474
call_subprocess(test_config.CT_TOOL + " --autocomplete=-p=", single_case_text)
7575
reference = '\n'
76-
res = res and (reference == single_case_text.command_text)
76+
res = res and (reference == single_case_text.print_text)
7777

7878
call_subprocess(test_config.CT_TOOL + " --autocomplete=-p", single_case_text)
7979
reference = '-p\n' + \
8080
'-process-all\n'
81-
res = res and (reference == single_case_text.command_text)
81+
res = res and (reference == single_case_text.print_text)
8282

8383
call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,", single_case_text)
8484
reference = 'cl,sycl,cl\n' + \
8585
'cl,sycl,dpct\n' + \
8686
'cl,sycl,none\n' + \
8787
'cl,sycl,sycl\n' + \
8888
'cl,sycl,sycl-math\n'
89-
res = res and (reference == single_case_text.command_text)
89+
res = res and (reference == single_case_text.print_text)
9090

9191
call_subprocess(test_config.CT_TOOL + " --autocomplete=--usm-level=#none,restricted#--use-explicit-namespace=#cl,sycl,s", single_case_text)
9292
reference = 'cl,sycl,sycl\n' + \
9393
'cl,sycl,sycl-math\n'
94-
res = res and (reference == single_case_text.command_text)
94+
res = res and (reference == single_case_text.print_text)
9595

9696
call_subprocess(test_config.CT_TOOL + " --autocomplete=", single_case_text)
9797
reference = '\n'
98-
res = res and (reference == single_case_text.command_text)
98+
res = res and (reference == single_case_text.print_text)
9999

100100
call_subprocess(test_config.CT_TOOL + " --autocomplete=,", single_case_text)
101101
reference = '\n'
102-
res = res and (reference == single_case_text.command_text)
102+
res = res and (reference == single_case_text.print_text)
103103

104104
call_subprocess(test_config.CT_TOOL + " --autocomplete==", single_case_text)
105105
reference = '\n'
106-
res = res and (reference == single_case_text.command_text)
106+
res = res and (reference == single_case_text.print_text)
107107

108108
call_subprocess(test_config.CT_TOOL + " --autocomplete=,,", single_case_text)
109109
reference = '\n'
110-
res = res and (reference == single_case_text.command_text)
110+
res = res and (reference == single_case_text.print_text)
111111

112112
call_subprocess(test_config.CT_TOOL + " --autocomplete=-", single_case_text)
113113
opts = ['--always-use-async-handler\n',
@@ -152,15 +152,15 @@ def migrate_test(single_case_text):
152152
'--version\n',
153153
'-p\n']
154154
for opt in opts:
155-
res = res and (opt in single_case_text.command_text)
155+
res = res and (opt in single_case_text.print_text)
156156

157157
call_subprocess(test_config.CT_TOOL + " --autocomplete=##", single_case_text)
158158
reference = '\n'
159-
res = res and (reference == single_case_text.command_text)
159+
res = res and (reference == single_case_text.print_text)
160160

161161
call_subprocess(test_config.CT_TOOL + " --autocomplete=#", single_case_text)
162162
reference = '\n'
163-
res = res and (reference == single_case_text.command_text)
163+
res = res and (reference == single_case_text.print_text)
164164

165165
return res
166166

behavior_tests/src/bt-check-unexpected-message/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setup_test(single_case_text):
1919

2020
def migrate_test(single_case_text):
2121
call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path + " --extra-arg=-xc++", single_case_text)
22-
return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", single_case_text.command_text)
22+
return not is_sub_string("warning: '-x c' after last input file has no effect [-Wunused-command-line-argument]", single_case_text.print_text)
2323

2424
def build_test(single_case_text):
2525
return call_subprocess("icpx -fsycl out/test.dp.cpp", single_case_text)

behavior_tests/src/bt-empty-cdb-default-out-folder/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup_test(single_case_text):
2020

2121
def migrate_test(single_case_text):
2222
call_subprocess(test_config.CT_TOOL + " -p=./ --cuda-include-path=" + test_config.include_path, single_case_text)
23-
return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.command_text)
23+
return is_sub_string("Migration not necessary; no CUDA code detected", single_case_text.print_text)
2424
def build_test(single_case_text):
2525
return True
2626
def run_test(single_case_text):

behavior_tests/src/bt-extra-arg/do_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def setup_test(single_case_text):
2020

2121
def migrate_test(single_case_text):
2222
return (call_subprocess(test_config.CT_TOOL + " --extra-arg=\"--cuda-path=" + test_config.include_path + "\" vector_add.cu", single_case_text)
23-
and is_sub_string("Parsing", single_case_text.command_text)
24-
and is_sub_string("Analyzing", single_case_text.command_text)
25-
and is_sub_string("Migrating", single_case_text.command_text))
23+
and is_sub_string("Parsing", single_case_text.print_text)
24+
and is_sub_string("Analyzing", single_case_text.print_text)
25+
and is_sub_string("Migrating", single_case_text.print_text))
2626

2727
def build_test(single_case_text):
2828
return True

behavior_tests/src/bt-help/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup_test(single_case_text):
2020
def migrate_test(single_case_text):
2121

2222
call_subprocess(test_config.CT_TOOL +" --help", single_case_text)
23-
return is_sub_string("USAGE", single_case_text.command_text)
23+
return is_sub_string("USAGE", single_case_text.print_text)
2424

2525
def build_test(single_case_text):
2626
return True

behavior_tests/src/bt-in-root-empty-process-all/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup_test(single_case_text):
2020
def migrate_test(single_case_text):
2121

2222
call_subprocess(test_config.CT_TOOL + " --process-all --cuda-include-path=" + test_config.include_path + " --in-root=", single_case_text)
23-
return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", single_case_text.command_text)
23+
return is_sub_string("Error: The option --process-all requires that the --in-root be specified explicitly", single_case_text.print_text)
2424

2525
def build_test(single_case_text):
2626
return True

behavior_tests/src/bt-invalid-cuda-version/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def migrate_test(single_case_text):
2222
in_root = os.getcwd()
2323
test_case_path = os.path.join(in_root, "vector_add.cu")
2424
call_subprocess(test_config.CT_TOOL + " " + test_case_path + " --out-root=out --in-root=" + in_root + " --cuda-include-path=" + include_path, single_case_text)
25-
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)
25+
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)
2626

2727
def build_test(single_case_text):
2828
return True

behavior_tests/src/bt-kernel-function-limitation/do_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def migrate_test(single_case_text):
2121

2222
call_subprocess(test_config.CT_TOOL + " --optimize-migration --out-root=./out kernel-func.cu --cuda-include-path=" + test_config.include_path, single_case_text)
2323

24-
ret = is_sub_string("Recursive functions cannot be called in SYCL device code", single_case_text.command_text)
25-
ret = is_sub_string("Virtual functions cannot be called in SYCL device code", single_case_text.command_text) and ret
24+
ret = is_sub_string("Recursive functions cannot be called in SYCL device code", single_case_text.print_text)
25+
ret = is_sub_string("Virtual functions cannot be called in SYCL device code", single_case_text.print_text) and ret
2626
return ret
2727
def build_test(single_case_text):
2828
return True

behavior_tests/src/bt-language-warning/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setup_test(single_case_text):
1919

2020
def migrate_test(single_case_text):
2121
call_subprocess(test_config.CT_TOOL + " test.cpp --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text)
22-
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)
22+
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)
2323

2424
def build_test(single_case_text):
2525
return True

behavior_tests/src/bt-suppress-warnings-all/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setup_test(single_case_text):
1919

2020
def migrate_test(single_case_text):
2121
call_subprocess(test_config.CT_TOOL + " --suppress-warnings-all vector_add.cu --cuda-include-path=" + test_config.include_path, single_case_text)
22-
return not is_sub_string("DPCT1015", single_case_text.command_text)
22+
return not is_sub_string("DPCT1015", single_case_text.print_text)
2323
def build_test(single_case_text):
2424
return True
2525

behavior_tests/src/bt-suppress-warnings/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setup_test(single_case_text):
1919

2020
def migrate_test(single_case_text):
2121
call_subprocess(test_config.CT_TOOL + " hello.cu --suppress-warnings=1000-1003,1008 --cuda-include-path=" + test_config.include_path, single_case_text)
22-
return not is_sub_string("warning: DPCT10", single_case_text.command_text)
22+
return not is_sub_string("warning: DPCT10", single_case_text.print_text)
2323
def build_test(single_case_text):
2424
return True
2525

behavior_tests/src/bt-version/do_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def migrate_test(single_case_text):
2222
ct_clang_version = get_ct_clang_version()
2323
expected_output = "dpct version {0}".format(ct_clang_version)
2424
print("expected dpct version output: {0}".format(expected_output))
25-
print("\n'dpct --version' outputs {0}".format(single_case_text.command_text))
26-
return is_sub_string(expected_output, single_case_text.command_text)
25+
print("\n'dpct --version' outputs {0}".format(single_case_text.print_text))
26+
return is_sub_string(expected_output, single_case_text.print_text)
2727

2828
def build_test(single_case_text):
2929
return True

behavior_tests/src/bt-yaml-with-different-ct-version/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setup_test(single_case_text):
1919

2020
def migrate_test(single_case_text):
2121
call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text)
22-
return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", single_case_text.command_text)
22+
return is_sub_string("Incremental migration requires the same version of dpct. Migration continues with incremental migration disabled", single_case_text.print_text)
2323

2424
def build_test(single_case_text):
2525
return True

behavior_tests/src/bt-yaml-with-different-options1/do_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def setup_test(single_case_text):
2020
def migrate_test(single_case_text):
2121
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)
2222
call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text)
23-
return is_sub_string("\"--analysis-scope-path=\"", single_case_text.command_text) and \
24-
is_sub_string("--always-use-async-handler --comments --compilation-database=\"", single_case_text.command_text) and \
25-
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)
23+
return is_sub_string("\"--analysis-scope-path=\"", single_case_text.print_text) and \
24+
is_sub_string("--always-use-async-handler --comments --compilation-database=\"", single_case_text.print_text) and \
25+
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)
2626

2727
def build_test(single_case_text):
2828
return True

behavior_tests/src/bt-yaml-with-different-options2/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup_test(single_case_text):
2020
def migrate_test(single_case_text):
2121
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)
2222
call_subprocess(test_config.CT_TOOL + " test.cu --out-root out --cuda-include-path=" + test_config.include_path, single_case_text)
23-
return is_sub_string("--no-cl-namespace-inline\".", single_case_text.command_text)
23+
return is_sub_string("--no-cl-namespace-inline\".", single_case_text.print_text)
2424

2525
def build_test(single_case_text):
2626
return True

behavior_tests/src/bt-yaml-without-ct-version/do_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def setup_test(single_case_text):
2020
def migrate_test(single_case_text):
2121

2222
call_subprocess(test_config.CT_TOOL + " test.cu --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text)
23-
return is_sub_string("Failed to load", single_case_text.command_text) and \
24-
is_sub_string("Migration continues with incremental migration disabled", single_case_text.command_text)
23+
return is_sub_string("Failed to load", single_case_text.print_text) and \
24+
is_sub_string("Migration continues with incremental migration disabled", single_case_text.print_text)
2525

2626
def build_test(single_case_text):
2727
return True

behavior_tests/src/cannot-acc-dir-in-db/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def migrate_test(single_case_text):
2525
call_subprocess(test_config.CT_TOOL + ' -p ./helloworld_tst/compile_commands.json --cuda-include-path=' + \
2626
os.environ['CUDA_INCLUDE_PATH'], single_case_text)
2727

28-
if 'check if the directory exists and can be accessed by the tool' in single_case_text.command_text:
28+
if 'check if the directory exists and can be accessed by the tool' in single_case_text.print_text:
2929
return True
3030
print("could not get expected message: check if the directory exists and can be accessed by the tool")
3131
return False

behavior_tests/src/change-filename-extension/do_test.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,30 @@ def setup_test(single_case_text):
2222
def migrate_test(single_case_text):
2323
call_subprocess(
2424
test_config.CT_TOOL + " -p=. --change-cuda-files-extension-only --out-root=out --cuda-include-path=" + test_config.include_path, single_case_text)
25-
print(single_case_text.command_text)
25+
print(single_case_text.print_text)
2626

2727
reference = 'main.dp.cpp'
2828
call_subprocess("ls out | grep " + reference, single_case_text)
2929
res = True
30-
if reference not in single_case_text.command_text:
30+
if reference not in single_case_text.print_text:
3131
res = False
3232
print("there should be a file: " + reference)
3333

3434
reference = 'test.cpp'
3535
call_subprocess("ls out | grep " + reference, single_case_text)
36-
if reference not in single_case_text.command_text:
36+
if reference not in single_case_text.print_text:
3737
res = False
3838
print("there should be a file: " + reference)
3939

4040
reference = 'test.dp.hpp'
4141
call_subprocess("ls out | grep " + reference, single_case_text)
42-
if reference not in single_case_text.command_text:
42+
if reference not in single_case_text.print_text:
4343
res = False
4444
print("there should be a file: " + reference)
4545

4646
reference = 'test.h'
4747
call_subprocess("ls out | grep " + reference, single_case_text)
48-
if reference not in single_case_text.command_text:
48+
if reference not in single_case_text.print_text:
4949
res = False
5050
print("there should be a file: " + reference)
5151

behavior_tests/src/check-device-unsupport-aspect/do_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def run_test(single_case_text):
6969
res += 1
7070
print("double.run run pass")
7171
print("double.run output:")
72-
print(single_case_text.command_text)
72+
print(single_case_text.print_text)
7373
if res != 1:
7474
print("case 'double' failed")
7575
return False
@@ -79,7 +79,7 @@ def run_test(single_case_text):
7979
res += 1
8080
print("half.run run pass")
8181
print("half.run output:")
82-
print(single_case_text.command_text)
82+
print(single_case_text.print_text)
8383
if res != 2:
8484
print("case 'half' failed")
8585
return False

behavior_tests/src/check-windows-version/do_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup_test(single_case_text):
2020

2121
def get_windows_version(arg1, arg2):
2222
call_subprocess("powershell \"(Get-Item -path " + arg1 + ").VersionInfo." + arg2 + "\"", single_case_text)
23-
return single_case_text.command_text
23+
return single_case_text.print_text
2424

2525
def migrate_test(single_case_text):
2626
ct_path = get_ct_path()

0 commit comments

Comments
 (0)