From 455a97f9c8d8e7afcf7b56121b754a046137f5f0 Mon Sep 17 00:00:00 2001 From: Chris Maddock Date: Sun, 2 Aug 2020 13:45:45 +0100 Subject: [PATCH 1/2] Document NUnit Console exit codes --- .../nunit/running-tests/Console-Runner.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/articles/nunit/running-tests/Console-Runner.md b/docs/articles/nunit/running-tests/Console-Runner.md index 6974f7e14..4441c357b 100644 --- a/docs/articles/nunit/running-tests/Console-Runner.md +++ b/docs/articles/nunit/running-tests/Console-Runner.md @@ -11,3 +11,18 @@ It automatically saves its results in XML format, allowing you to produce report In this example, nunit3-console has just run selected tests in the mock-nunit-assembly.exe assembly that is part of the NUnit distribution. This assembly contains a number of tests, some of which are either ignored or marked explicit. The summary line shows the result of the test run. + +## Console Exit Codes + +The console will exit with zero if all tests pass, a positive number if there are any test failures, and a negative number in the case of any errors in running the test suite. The current exit codes used are summarised below: + +| Exit code | Meaning | +|---|---| +| 0 | All tests passed. Note that some tests may still have produced warnings -- those will be listed in the console output. | +| 1-100 | Some tests have failed. The exit code will reflect the number of test failures (capped at 100). | +| -1 | Invalid argument found on command line. | +| -2 | One of the assemblies passed into the console was found to be invalid. This may include assemblies which contain no tests. | +| -3 | No longer used. Previously used when a requested test fixture could not be found. | +| -4 | An invalid test fixture was found within the test suite. | +| -5 | No longer used. Previously used when the App Domain within which the tests were run could not be unloaded cleanly. This situation is now logged as a warning instead of an error, and will result in the console exiting zero. | +| -100 | An unexpected error occured. This may indicate a bug within the test runner - please consider filing an issue on the [nunit-console repository](https://github.com/nunit/nunit-console/issues). | From 34b47a4bc2376191f6cead23f8f1fcfb11df7c17 Mon Sep 17 00:00:00 2001 From: Chris Maddock Date: Sun, 2 Aug 2020 13:50:34 +0100 Subject: [PATCH 2/2] More Americanisms... --- docs/articles/nunit/running-tests/Console-Runner.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/articles/nunit/running-tests/Console-Runner.md b/docs/articles/nunit/running-tests/Console-Runner.md index 4441c357b..405301144 100644 --- a/docs/articles/nunit/running-tests/Console-Runner.md +++ b/docs/articles/nunit/running-tests/Console-Runner.md @@ -14,7 +14,7 @@ result of the test run. ## Console Exit Codes -The console will exit with zero if all tests pass, a positive number if there are any test failures, and a negative number in the case of any errors in running the test suite. The current exit codes used are summarised below: +The console will exit with zero if all tests pass, a positive number if there are any test failures, and a negative number in the case of any errors in running the test suite. The current exit codes used are summarized below: | Exit code | Meaning | |---|---| @@ -25,4 +25,4 @@ The console will exit with zero if all tests pass, a positive number if there ar | -3 | No longer used. Previously used when a requested test fixture could not be found. | | -4 | An invalid test fixture was found within the test suite. | | -5 | No longer used. Previously used when the App Domain within which the tests were run could not be unloaded cleanly. This situation is now logged as a warning instead of an error, and will result in the console exiting zero. | -| -100 | An unexpected error occured. This may indicate a bug within the test runner - please consider filing an issue on the [nunit-console repository](https://github.com/nunit/nunit-console/issues). | +| -100 | An unexpected error occurred. This may indicate a bug within the test runner - please consider filing an issue on the [nunit-console repository](https://github.com/nunit/nunit-console/issues). |