-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Passing arguments to a test #622
Comments
I've found this here
So what is the status of it? Maybe it is kind of more ready now? What I need to do is to pass different connection strings corresponding to different databases to check that all tests are passing with all supported databases. Now I do this with environment variables but it is... mmm... dirty?.. I would definitely prefer CATCH handling the situation with its argument parser, giving the values to the tests that require them. |
Take a look at https://github.com/mapnik/mapnik/blob/master/test/unit/run.cpp (adds options edit: with flag (value-less) option |
This is the command line parser https://github.com/philsquared/Clara. |
I'm also interested in this, or at least int a way to get the list of unprocessed parameters back from Catch/Clara. |
Any news on this, even if preliminary? |
See #793. The short version is that Catch2 makes it fairly easy to add arguments. |
I'd like to write a test that takes some arguments on the command line and based on those performs some action. A simple example would be some of the
vector
tests from the documentation that take the initial vector size on the command-line.The only way I see how to do this is to create a fixture that has the arguments as static members, then to provide my own
main
that parses the command-line arguments, initializes the fixture member variables, and passes control tosession.run()
. That seems a little verbose. Is there no simpler way to do this?The text was updated successfully, but these errors were encountered: