-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for reportng Fatal Error Conditions. Fix bug Warnings in …
…sections not always displayed. Improve robustness of runner output parsing.
- Loading branch information
1 parent
9fed124
commit 7bdf548
Showing
20 changed files
with
725 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** Basic Info ** | ||
Copyright: 2018 Johnny Hendriks | ||
Author : Johnny Hendriks | ||
Year : 2018 | ||
Project: VSTestAdapter for Catch2 | ||
Licence: MIT | ||
Notes: None | ||
** Basic Info **/ | ||
|
||
using System; | ||
using System.IO; | ||
using System.Text; | ||
using System.Xml; | ||
|
||
namespace Catch2Interface.Reporter | ||
{ | ||
|
||
/*YAML | ||
Class : | ||
Description : > | ||
This class is intended to handle the xml "FatalErrorCondition" node in a Catch2 Xml report. | ||
*/ | ||
public class FatalErrorCondition | ||
{ | ||
#region Properties | ||
|
||
public string Filename { get; private set; } | ||
public int Line { get; private set; } = -1; | ||
public string Message { get; private set; } | ||
|
||
#endregion // Properties | ||
|
||
#region Constructor | ||
|
||
public FatalErrorCondition(XmlNode node) | ||
{ | ||
if (node.Name == Constants.NodeName_FatalErrorCondition) | ||
{ | ||
int line; | ||
if (int.TryParse(node.Attributes["line"].Value, out line)) | ||
{ | ||
Line = line; | ||
} | ||
|
||
Filename = node.Attributes["filename"]?.Value; | ||
|
||
var nodeMessage = node?.FirstChild; | ||
if (nodeMessage != null && nodeMessage.NodeType == XmlNodeType.Text) | ||
{ | ||
Message = nodeMessage.Value.Trim(); | ||
} | ||
} | ||
} | ||
|
||
#endregion // Constructor | ||
|
||
#region Public Methods | ||
|
||
public string GenerateFailureInfo() | ||
{ | ||
StringBuilder msg = new StringBuilder(); | ||
|
||
msg.Append($"{Path.GetFileName(Filename)} line {Line}: Failed{Environment.NewLine}"); | ||
msg.Append($"due to a fatal error condition with message:{Environment.NewLine}"); | ||
msg.Append($" {Message}{Environment.NewLine}"); | ||
|
||
return msg.ToString(); | ||
} | ||
|
||
#endregion // Public Methods | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
ReferenceTests/MSBuild/Projects/Catch_NoSEH/Catch_NoSEH.vcxproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="..\Catch2Unittest.targets" /> | ||
<PropertyGroup Label="Globals"> | ||
<RootNamespace>Catch_NoSEH</RootNamespace> | ||
<ProjectTypeGuids>{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}</ProjectTypeGuids> | ||
<ProjectGuid>{93AAED31-C6A6-4BFE-ABED-D750C575BA10}</ProjectGuid> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup> | ||
<ClCompile> | ||
<PreprocessorDefinitions>CATCH_CONFIG_NO_WINDOWS_SEH;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
</ClCompile> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\..\..\Src\Catch2\Catch_NoSEH\UT_Tests01.cpp" /> | ||
<ClCompile Include="..\..\..\Src\Catch2\main.cpp" /> | ||
</ItemGroup> | ||
</Project> |
19 changes: 19 additions & 0 deletions
19
ReferenceTests/MSBuild/Projects/Catch_NoSEH/Catch_NoSEH.vcxproj.filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Files"> | ||
<UniqueIdentifier>{e9f92384-33de-4567-ac81-601cc1c65521}</UniqueIdentifier> | ||
</Filter> | ||
<Filter Include="Files\Catch"> | ||
<UniqueIdentifier>{36abadce-429e-4b62-9e22-98a0b1ba6ed1}</UniqueIdentifier> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\..\..\Src\Catch2\main.cpp"> | ||
<Filter>Files\Catch</Filter> | ||
</ClCompile> | ||
<ClCompile Include="..\..\..\Src\Catch2\Catch_NoSEH\UT_Tests01.cpp"> | ||
<Filter>Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.