private void parseLine() { if (_line.Contains(": error")) { BuildMessage message = parseMessage(": error"); if (!_results.Errors.Contains(message)) { _results.AddError(message); } } else if (_line.Contains(": warning")) { BuildMessage message = parseMessage(": warning"); if (!_results.Warnings.Contains(message)) { _results.AddWarning(message); } } else if (_line.StartsWith("\tfatal error ")) { BuildMessage message = parseMessage("fatal error "); if (!_results.Errors.Contains(message)) { _results.AddError(message); } } else if (isSolutionError()) { BuildMessage message = parseMessage(": Solution file error"); if (!_results.Errors.Contains(message)) { _results.AddError(message); } } }
public void Should_merge_build_errors() { var results = new BuildRunResults("project"); results.AddError(new BuildMessage() {File = "some file", ErrorMessage = "some error message"}); _runResultCache.Merge(results); results = new BuildRunResults("project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); results.AddError(new BuildMessage() { File = "some other file", ErrorMessage = "some other error message" }); _runResultCache.Merge(results); _runResultCache.Errors.Length.ShouldEqual(2); }
public void Should_serialize_build_run_message() { var results = new BuildRunResults("Project"); results.AddError(new BuildMessage() { File = "file", LineNumber = 15, LinePosition = 20, ErrorMessage = "Error message" }); results.AddWarning(new BuildMessage() { File = "file2", LineNumber = 35, LinePosition = 40, ErrorMessage = "Error message2" }); results.SetTimeSpent(new TimeSpan(23567)); var message = new BuildRunMessage(results); var output = serializeDeserialize <BuildRunMessage>(message); output.Results.Project.ShouldEqual("Project"); output.Results.TimeSpent.ShouldEqual(new TimeSpan(23567)); output.Results.ErrorCount.ShouldEqual(1); output.Results.Errors[0].File.ShouldEqual("file"); output.Results.Errors[0].LineNumber.ShouldEqual(15); output.Results.Errors[0].LinePosition.ShouldEqual(20); output.Results.Errors[0].ErrorMessage.ShouldEqual("Error message"); output.Results.WarningCount.ShouldEqual(1); output.Results.Warnings[0].File.ShouldEqual("file2"); output.Results.Warnings[0].LineNumber.ShouldEqual(35); output.Results.Warnings[0].LinePosition.ShouldEqual(40); output.Results.Warnings[0].ErrorMessage.ShouldEqual("Error message2"); }
public void Should_add_build_errors() { var results = new BuildRunResults("project"); results.AddError(new BuildMessage()); _runResultCache.Merge(results); _runResultCache.Errors.Length.ShouldEqual(1); _runResultCache.Errors[0].Key.ShouldEqual("project"); }
public void Should_not_merge_same_build_errors_from_different_project() { var results = new BuildRunResults("project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); _runResultCache.Merge(results); results = new BuildRunResults("another project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); _runResultCache.Merge(results); _runResultCache.Errors.Length.ShouldEqual(2); }
public void Should_merge_build_errors() { var results = new BuildRunResults("project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); _runResultCache.Merge(results); results = new BuildRunResults("project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); results.AddError(new BuildMessage() { File = "some other file", ErrorMessage = "some other error message" }); _runResultCache.Merge(results); _runResultCache.Errors.Length.ShouldEqual(2); }
public void Should_remove_cached_build_errors_that_now_works() { var results = new BuildRunResults("project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); _runResultCache.Merge(results); results = new BuildRunResults("another project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); _runResultCache.Merge(results); results = new BuildRunResults("project"); _runResultCache.Merge(results); _runResultCache.Errors.Length.ShouldEqual(1); }
private void parseLine() { if (_line.Contains(": error")) { BuildMessage message = parseMessage(": error"); if (!_results.Errors.Contains(message)) { _results.AddError(message); } } else if (_line.Contains(": warning")) { BuildMessage message = parseMessage(": warning"); if (!_results.Warnings.Contains(message)) { _results.AddWarning(message); } } }
public void Should_clear_cache_when_issuing_clear() { var results = new BuildRunResults("another project"); results.AddError(new BuildMessage() { File = "some files", ErrorMessage = "some error messages" }); results.AddWarning(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); _runResultCache.Merge(results); _runResultCache.Merge(new TestRunResults("project", "assembly", false, TestRunner.NUnit, new TestResult[] { new TestResult(TestRunner.NUnit, TestRunStatus.Ignored, "Test name", "Message", new IStackLine[] { }) })); _runResultCache.Merge(new TestRunResults("project", "assembly", true, TestRunner.NUnit, new TestResult[] { new TestResult(TestRunner.NUnit, TestRunStatus.Failed, "Test name", "Message", new IStackLine[] { new StackLineMessage("method", "file", 10) }) })); _runResultCache.Clear(); _runResultCache.Errors.Length.ShouldEqual(0); _runResultCache.Warnings.Length.ShouldEqual(0); _runResultCache.Failed.Length.ShouldEqual(0); _runResultCache.Ignored.Length.ShouldEqual(0); }
public void Should_find_build_error_delta() { _runResultCache.EnabledDeltas(); var results = new BuildRunResults("project"); results.AddError(new BuildMessage() { File = "some file", ErrorMessage = "some error message" }); _runResultCache.Merge(results); _runResultCache.PopDeltas(); results = new BuildRunResults("project"); results.AddError(new BuildMessage() { File = "some other file", ErrorMessage = "some other error message" }); _runResultCache.Merge(results); var deltas = _runResultCache.PopDeltas(); deltas.AddedErrors.Length.ShouldEqual(1); deltas.RemovedErrors.Length.ShouldEqual(1); }
public void Should_add_error() { _results.AddError(new BuildMessage()); _results.ErrorCount.ShouldEqual(1); }