Skip to content

Commit

Permalink
[SYCLomatic] Remove invalid json test for standard compilation db fields
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed, Daiyaan <[email protected]>
  • Loading branch information
daiyaan-ahmed6 committed Jan 5, 2024
1 parent b7fe107 commit 7c376c5
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 137 deletions.
2 changes: 0 additions & 2 deletions behavior_tests/behavior_tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
<test testName="ngt-invalid-json6" configFile="config/TEMPLATE_behavior_tests.xml" />
<test testName="ngt-invalid-json7" configFile="config/TEMPLATE_behavior_tests.xml" />
<test testName="ngt-invalid-json8" configFile="config/TEMPLATE_behavior_tests.xml" />
<test testName="ngt-invalid-json9" configFile="config/TEMPLATE_behavior_tests.xml" />
<test testName="ngt-invalid-json10" configFile="config/TEMPLATE_behavior_tests.xml" />
<test testName="integer-overflow" configFile="config/TEMPLATE_behavior_tests_lin.xml" />
<test testName="bt-suppress-warnings" configFile="config/TEMPLATE_behavior_tests.xml" />
<test testName="bt-report-only" configFile="config/TEMPLATE_behavior_tests.xml" />
Expand Down
7 changes: 0 additions & 7 deletions behavior_tests/src/ngt-invalid-json10/compile_commands.json

This file was deleted.

41 changes: 0 additions & 41 deletions behavior_tests/src/ngt-invalid-json10/do_test.py

This file was deleted.

11 changes: 0 additions & 11 deletions behavior_tests/src/ngt-invalid-json10/hello1.c

This file was deleted.

5 changes: 4 additions & 1 deletion behavior_tests/src/ngt-invalid-json7/compile_commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
"command": "nvcc hello1.c",
"directory": "directory_placeholder",
"file": "hello1.c"
"file": "hello1.c",
"command": "nvcc hello2.c",
"directory": "directory_placeholder",
"file": "hello2.c"
}
]
11 changes: 8 additions & 3 deletions behavior_tests/src/ngt-invalid-json7/do_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@ def setup_test():
def migrate_test():
data = []
ret = []
iter = 0
with open("compile_commands.json", 'r') as f:
data = f.readlines()
for line in data:
if iter == 1:
line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\"))
if "directory_placeholder" in line:
ret.append(" \"output\": \"aaaaa\",\n")
line = line.replace("directory_placeholder", os.getcwd().replace("\\", "\\\\"))
iter += 1

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)
return is_sub_string("Unknown key: \"\"output\"\"", test_config.command_output)
return is_sub_string("Processed 1 file(s)", test_config.command_output)


def build_test():
return True

def run_test():
return True


2 changes: 1 addition & 1 deletion behavior_tests/src/ngt-invalid-json8/compile_commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
"command": "nvcc hello1.c",
"directory": "directory_placeholder",
"file": "hello1.c"
"file": ""
}
]
4 changes: 1 addition & 3 deletions behavior_tests/src/ngt-invalid-json8/do_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ def migrate_test():
with open("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:
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("The file name(s) in the \"command\" and \"file\" fields of the compilation database are inconsistent", test_config.command_output)


def build_test():
Expand Down
10 changes: 0 additions & 10 deletions behavior_tests/src/ngt-invalid-json9/compile_commands.json

This file was deleted.

47 changes: 0 additions & 47 deletions behavior_tests/src/ngt-invalid-json9/do_test.py

This file was deleted.

11 changes: 0 additions & 11 deletions behavior_tests/src/ngt-invalid-json9/hello1.c

This file was deleted.

0 comments on commit 7c376c5

Please sign in to comment.