Open hdamron17 opened 4 years ago
Rust has ui-tests which let you add additional arguments at the top:
// compile-flags: -Coverflow-checks=off
fn main() {
let x = 0 - 1;
}
Maybe we could do something similar for runner tests?
I think unit tests would be preferred where possible (and I think they would be since parse_args
is its own function). But having some runner tests of that sort would also be helpful to check that the functionality of the command line args is used properly and not just that the flag is read in right. (e.g. the include directory is actually included).
Also, a lot of the flags require external files which may be complicated for the runner tests (not sure).
That part shouldn't be too bad - see for example https://github.com/jyn514/saltwater/tree/master/tests/runner-tests/cpp/include which keeps the external files in the same directory.
Currently there are no tests to ensure command line arguments work as expected. It may also be good to check that the help message stays up to date with the accepted flags. Tests could either be runner tests or unit tests of
parse_args
(or both!).