Skip to content

Commit

Permalink
Set Inconclusive result in NUnit reports
Browse files Browse the repository at this point in the history
  • Loading branch information
csandfeld committed Apr 7, 2024
1 parent 6cf60c6 commit 066ca5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/functions/TestResults.NUnit25.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

function Write-NUnitTestResultAttributes {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns','')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')]
param($Result, [System.Xml.XmlWriter] $XmlWriter)

$XmlWriter.WriteAttributeString('xmlns', 'xsi', $null, 'http://www.w3.org/2001/XMLSchema-instance')
Expand All @@ -32,7 +32,7 @@ function Write-NUnitTestResultAttributes {
}

function Write-NUnitTestResultChildNodes {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns','')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')]
param($Result, [System.Xml.XmlWriter] $XmlWriter)

Write-NUnitEnvironmentInformation -Result $Result -XmlWriter $XmlWriter
Expand Down Expand Up @@ -98,7 +98,7 @@ function Write-NUnitCultureInformation {
}

function Write-NUnitTestSuiteElements {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns','')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')]
param($Node, [System.Xml.XmlWriter] $XmlWriter, [string] $Path)

$suiteInfo = Get-TestSuiteInfo -TestSuite $Node -Path $Path
Expand Down Expand Up @@ -249,7 +249,7 @@ function Get-TestSuiteInfo {
}

function Write-NUnitTestSuiteAttributes {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns','')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')]
param($TestSuiteInfo, [string] $TestSuiteType = 'TestFixture', [System.Xml.XmlWriter] $XmlWriter, [string] $Path)

$name = $TestSuiteInfo.Name
Expand Down Expand Up @@ -279,7 +279,7 @@ function Write-NUnitTestCaseElement {
}

function Write-NUnitTestCaseAttributes {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns','')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')]
param($TestResult, [System.Xml.XmlWriter] $XmlWriter, [string] $ParameterizedSuiteName)

$testName = $TestResult.ExpandedPath
Expand Down Expand Up @@ -399,5 +399,8 @@ function Get-GroupResult ($InputObject) {
if ($InputObject.PendingCount -gt 0) {
return 'Inconclusive'
}
if ($InputObject.InconclusiveCount -gt 0) {
return 'Inconclusive'
}
return 'Success'
}
5 changes: 4 additions & 1 deletion src/functions/TestResults.NUnit3.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,12 @@ function Get-NUnit3Result ($InputObject) {
elseif ($InputObject.SkippedCount -gt 0) {
'Skipped'
}
else {
elseif ($InputObject.PassedCount -gt 0) {
'Passed'
}
else {
'Inconclusive'
}
}

function Get-NUnit3Site ($Node) {
Expand Down

0 comments on commit 066ca5d

Please sign in to comment.