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
Documentation/Sample for xUnit v2 tests programs as exes #2909
Comments
Yes, what you're doing is the core of what we do. Our version is 10-20x more complex mostly because of options that you aren't doing here (like reporter choice, support for output files, etc.). This is the full version from the v2 console runner: xunit/src/xunit.console/ConsoleRunner.cs Lines 342 to 462 in 57af1d9
We haven't documented this because we don't expect average users to want to do this. We chose stand alone executables because it's impossible to rationalize linking in .NET Core (which is why we ended up abandoning The complexity is why there is the new in-process console runner in v3. But there shouldn't be anything hidden away that you can't use, if you choose to dig into the code yourself. |
Thanks, Brad. Do you think that, once the v3 exe contract is settled, it would make sense to provide a one-line helper class for v2 that allows turning a v2 test project into an exe, so that some of those benefits are easily avaliable in v2 as well? (not that the helper would run the test internally as v3, just that it would support the overall similar command-line switches and output, perhaps compatible from the standpoint of an outside consumer) If not, please feel free to close this issue. |
The v3 support for tests programs as exes is really useful - is there documentation or a sample for how to do this for v2?
Here's what I ended up doing, but I'm not sure if this anything close to a recommended approach:
This is code obviously limited in terms of harness functionality (doesn't support filtering or anything fancy - it just runs all the tests), but is this a reasonable approach, or could some documentation/a sample be added for getting "test as exe" for v2?
(Or maybe there's already something, and I just didn't find it.)
The text was updated successfully, but these errors were encountered: