From 42643812785697be2dc7b884099e6a60dc757332 Mon Sep 17 00:00:00 2001 From: Steven Dennis Date: Fri, 9 Sep 2016 10:41:49 -0400 Subject: [PATCH] Fixed #12 --- NUnitOperation.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NUnitOperation.cs b/NUnitOperation.cs index 8389b68..85c56db 100644 --- a/NUnitOperation.cs +++ b/NUnitOperation.cs @@ -111,6 +111,7 @@ await this.ExecuteCommandLineAsync( var testResultsElement = xdoc.Element("test-results"); var startTime = this.TryParseStartTime((string)testResultsElement.Attribute("date"), (string)testResultsElement.Attribute("time")) ?? DateTime.UtcNow; + var failures = 0; using (var db = new DB.Context()) { @@ -130,6 +131,8 @@ await this.ExecuteCommandLineAsync( .Case("Inconclusive", Domains.TestStatusCodes.Inconclusive) .Default(Domains.TestStatusCodes.Failed) .End(); + if (result == Domains.TestStatusCodes.Failed) + failures++; var testDuration = this.TryParseTestTime((string)testCaseElement.Attribute("time")); @@ -148,6 +151,9 @@ await this.ExecuteCommandLineAsync( startTime += testDuration; } } + + if (failures > 0) + this.LogError($"{0} test failures were reported."); } finally {