Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCLomatic] Remove invalid json test for standard compilation db fields #583

Open
wants to merge 1 commit into
base: SYCLomatic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

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
Copy link
Contributor

@tomflinda tomflinda Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sine 'Output' and 'Arguments' in compile_commands.json could be consumed by SYCLomatic, the test case should keep 'output' in compile_commands.json and also added 'Arguments' to verify this feature, instead of remove them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the new PR for this, I have changed the name of these tests to 'standard_compilation_db_json' and I am keeping 'Arguments' and 'Output' in compilation db to verify that dpct consumes these arguments.


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


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.

Loading