Skip to content

Commit 7c376c5

Browse files
[SYCLomatic] Remove invalid json test for standard compilation db fields
Signed-off-by: Ahmed, Daiyaan <[email protected]>
1 parent b7fe107 commit 7c376c5

File tree

12 files changed

+14
-137
lines changed

12 files changed

+14
-137
lines changed

behavior_tests/behavior_tests.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@
8080
<test testName="ngt-invalid-json6" configFile="config/TEMPLATE_behavior_tests.xml" />
8181
<test testName="ngt-invalid-json7" configFile="config/TEMPLATE_behavior_tests.xml" />
8282
<test testName="ngt-invalid-json8" configFile="config/TEMPLATE_behavior_tests.xml" />
83-
<test testName="ngt-invalid-json9" configFile="config/TEMPLATE_behavior_tests.xml" />
84-
<test testName="ngt-invalid-json10" configFile="config/TEMPLATE_behavior_tests.xml" />
8583
<test testName="integer-overflow" configFile="config/TEMPLATE_behavior_tests_lin.xml" />
8684
<test testName="bt-suppress-warnings" configFile="config/TEMPLATE_behavior_tests.xml" />
8785
<test testName="bt-report-only" configFile="config/TEMPLATE_behavior_tests.xml" />

behavior_tests/src/ngt-invalid-json10/compile_commands.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

behavior_tests/src/ngt-invalid-json10/do_test.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

behavior_tests/src/ngt-invalid-json10/hello1.c

Lines changed: 0 additions & 11 deletions
This file was deleted.

behavior_tests/src/ngt-invalid-json7/compile_commands.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
{
33
"command": "nvcc hello1.c",
44
"directory": "directory_placeholder",
5-
"file": "hello1.c"
5+
"file": "hello1.c",
6+
"command": "nvcc hello2.c",
7+
"directory": "directory_placeholder",
8+
"file": "hello2.c"
69
}
710
]

behavior_tests/src/ngt-invalid-json7/do_test.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,27 @@ def setup_test():
2121
def migrate_test():
2222
data = []
2323
ret = []
24+
iter = 0
2425
with open("compile_commands.json", 'r') as f:
2526
data = f.readlines()
2627
for line in data:
28+
if iter == 1:
29+
line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\"))
2730
if "directory_placeholder" in line:
28-
ret.append(" \"output\": \"aaaaa\",\n")
29-
line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\"))
31+
iter += 1
32+
3033
ret.append(line)
3134
with open("compile_commands.json", 'w') as f:
3235
f.writelines(ret)
3336

3437
call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path)
35-
return is_sub_string("Unknown key: \"\"output\"\"", test_config.command_output)
38+
return is_sub_string("Processed 1 file(s)", test_config.command_output)
39+
3640

3741
def build_test():
3842
return True
3943

4044
def run_test():
4145
return True
4246

47+

behavior_tests/src/ngt-invalid-json8/compile_commands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{
33
"command": "nvcc hello1.c",
44
"directory": "directory_placeholder",
5-
"file": "hello1.c"
5+
"file": ""
66
}
77
]

behavior_tests/src/ngt-invalid-json8/do_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ def migrate_test():
2424
with open("compile_commands.json", 'r') as f:
2525
data = f.readlines()
2626
for line in data:
27-
if "directory_placeholder" in line:
28-
ret.append(" \"arguments\": [\"nvcc hello_aaa.c\"],\n")
2927
line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\"))
3028
ret.append(line)
3129
with open("compile_commands.json", 'w') as f:
3230
f.writelines(ret)
3331

3432
call_subprocess(test_config.CT_TOOL + ' -p=./ --cuda-include-path=' + test_config.include_path)
35-
return is_sub_string("Unknown key: \"\"arguments\"\"", test_config.command_output)
33+
return is_sub_string("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", test_config.command_output)
3634

3735

3836
def build_test():

behavior_tests/src/ngt-invalid-json9/compile_commands.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)