catch_discover_tests doesn't use the same environment to discover tests through TEST_EXECUTABLE #1810
Labels
Extras
Touches utility scripts outside of Catch2 proper, e.g. CMake integration.
Help wanted
Issue outside of the maintainers expertise
Describe the bug
Using
cmake
to build my application andcatch_discover_tests
to find all thecatch
tests defined, I came across the following issue.While it's possible to set
PROPERTIES
incatch_discover_tests
that will be used to run the tests with, those same properties are not passed to theprocess
that runs the test executable to parse the various tests defined in the application.Expected behavior
I would expect that the same environment would be used to run the test executable to find out which tests to run and to actually run the tests.
Reproduction steps
catch_discover_tests(${test_name} TEST_PREFIX "${test_name}/" PROPERTIES ENVIRONMENT "TEST_ENV_VAR=MY_VAR")
Platform information:
Supplementary information:
I would like to be able to set one or more environment variables to a specific value for the tests only, without having to manually set it through the command line before compiling the application to run every invocation of the application executable with the same environment.
The text was updated successfully, but these errors were encountered: