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

Explore test_suite.hpp command line arguments #883

Open
alandefreitas opened this issue Nov 11, 2024 · 2 comments
Open

Explore test_suite.hpp command line arguments #883

alandefreitas opened this issue Nov 11, 2024 · 2 comments

Comments

@alandefreitas
Copy link
Member

The inability to pass command line arguments through test_suite.hpp is a problem.

We need to change the tool to support the existing features and also allow passing params.

run(std::ostream& out,

Currently, every command line argument is interpreted as the name of a suite to run. As if all params are values for the "inputs" parameter.

Although including more options is relatively easy, the problem you want to solve is a little more complex. Because we want to pass information to the tests rather than the test suite. It's contextual. So we need to agree on a convention to forward these parameters to the test suite.

We should make a short list of choices, and then decide. Some options are:

  • User overrides main and works on the command line arguments to store important values in some global variables before calling return ::test_suite::detail::run(log, argc, argv);
  • test -1 path/to/file.txt puts the string in some global array at position 1
@alandefreitas
Copy link
Member Author

@anarthal any ideas?

@anarthal
Copy link

Boost.Test (and other tooks like git) do this by having a separator argument --. Anything before the separator is parsed by the framework, anything after it, by the user.

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

2 participants