microsoft / testfx

MSTest framework and adapter
MIT License
680 stars 247 forks source link

Command Line Options - Set Defaults? e.g. minimum-expected-tests #3144

Closed msm-tomlonghurst closed 3 weeks ago

msm-tomlonghurst commented 3 weeks ago

The Microsoft.Testing.Platform hosts provides us a few bits out of the box, such as minimum-expected-tests.

Is there the ability for me within my framework to set a default value for a flag (that the user could then override?)

Currently, if I execute a test run that doesn't run any tests, the command doesn't return an exit code.

I'd like to change this, so setting a default value of 1.

PS C:\git\TUnit\TUnit.TestProject> dotnet run --treenode-filter "/*/*/*/NonExistingTest"
.NET Testing Platform v1.3.0-preview.24321.4+a25e08a44c (UTC 06/21/2024 00:00:00) [win10-x64 - .NET 7.0.20]
Zero tests ran - Failed: 0, Passed: 0, Skipped: 0, Total: 0, Duration: 149ms - TUnit.TestProject.dll (win10-x64 - .NET 7.0.20)