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

--generate_expected_output adds quotation marks around -DFOO instances in compiler_args #35

Open
ben-briant opened this issue Apr 19, 2023 · 0 comments

Comments

@ben-briant
Copy link

When a test defines macros as part of compiler_args (e.g to replace a main function) and --generate_expected_output is used, it surrounds the -DFOO with single quotes. This is treated as a syntax error in autotest.

❯ cat autotest/tests.txt
files=test.c
command=./test

compiler_args=-DFOO=1 test.c -o test

1
❯ autotest -g -a autotest
files=test.c
command=./test

compiler_args='-DFOO=1' test.c -o test

1
### generated by: autotest --generate_expected_output - see https://github.com/COMP1511UNSW/autotest
1 expected_stdout='Hello, world!\n'
❯ autotest -g update -a autotest
❯ autotest -a autotest
autotest: /tmp/tmp.ihUpssD2nV/autotest/tests.txt:4: syntax error in assignment

Test specification documentation & source at: https://github.com/COMP1511UNSW/autotest - issues welcome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant