Skip to content

Passing custom argument during test run #83

@Denec32

Description

@Denec32

All of my tests are contained within the app itself, so to run them I pass a custom argument to an executable like this:

my_app_name.exe --run-unit-tests

Then the argument is cut out, and all proceeding arguments are passed to catch2' main function.
My issue is that I can't make test adapter to run tests with this flag passed. I've configured discover command line in .runsettings:

<DiscoverCommandLine>--run-unit-tests --verbosity high --list-tests --reporter xml *</DiscoverCommandLine>

And it discovers tests just fine, but I couldn't find a way to pass this argument to executable when running tests from Test Explorer within Visual Studio.
So when I try to run tests, it just launches my app, cause no --run-unit-test flag = control is never passed to catch2.
Are there any workarounds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions