.Net Core Test Result Parser Global Tool for NUnit, XUnit, MsTest
dotnet tool install --global dotnet-labodotnettestresultsparser
$ dotnet labodotnettestresultsparser --help
dotnet-labodotnettestresultsparser
Usage: dotnet labodotnettestresultsparser [arguments] [options]
Arguments:
path The test result xml path.
Options:
--version Show version information
-?|-h|--help Show help information
-f|--format Unit test result xml format. Allowed values are: NUnit, XUnit, MsTest. (Default: NUnit)
-o|--output Output file to write results. (Default output is Console)
-t|--template The output template. Allowed values are: Summary, TestResult. (Default: Summary)
--fail-when-result-is-failed Fails the program when the unit test result is 'Failed'.
- NUnit
- XUnit
- MsTest
$ dotnet labodotnettestresultsparser <path> -f NUnit --fail-when-result-is-failed
$ dotnet labodotnettestresultsparser <path> -f NUnit -o <output.txt> -t TestResult
$ Passed
Writes Only the Test Result Text (Passed | Failed) for Multiple Unit Test Result Xmls to the Output Text
$ dotnet labodotnettestresultsparser "/testresults/*.unittest.xml" -f NUnit -o <output.txt> -t TestResult
$ Passed
dotnet labodotnettestresultsparser "/testresults/*.unittest.xml" -f NUnit -o /testresults/result.txt -t TestResult
if [ ! -f /testresults/result.txt ]; then
echo "Test Result File not found!"
exit 1
fi
result=$(head -n 1 /testresults/result.txt)
if [ "$result" == "Failed" ]
then
echo "Unit Tests Failed!"
exit 1
else
echo "Unit Tests Passed!"
fi
$ Unit Tests Passed!
git clone https://github.com/QuickOrBeDead/Labo.DotnetTestResultParser.git
cd Labo.DotnetTestResultParser/src/Labo.DotnetTestResultParser
dotnet pack -c release -o nupkg
Output is located at src/Labo.DotnetTestResultParser/nupkg
dotnet tool uninstall -g dotnet-labodotnettestresultsparser