Skip to content

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

@ben-briant

Description

@ben-briant

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions