Skip to content

Commit

Permalink
Remove invalid if block
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipAlg committed Dec 5, 2024
1 parent 30fce00 commit 49515f7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Tests/Runtime/ResultSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEngine.TestRunner;

[assembly: TestRunCallback( typeof( ResultSerializer ) )]

public class ResultSerializer : ITestRunCallback
{
public void RunStarted( ITest testsToRun ) { }
Expand All @@ -15,14 +16,12 @@ public void TestStarted( ITest test ) { }
public void RunFinished( ITestResult testResults )
{
if ( Environment.CommandLine.HasArg( "testResults" ) ) {
if ( !testResults.Test.IsSuite ) {
var path = Environment.CommandLine.GetValues( "testResults" )?[ 0 ] ?? "results.xml";
var fullPath = Path.GetFullPath(path);
using ( var xmlWriter = XmlWriter.Create( fullPath, new XmlWriterSettings { Indent = true } ) )
WriteResultsToXml( testResults, xmlWriter );
var path = Environment.CommandLine.GetValues( "testResults" )?[ 0 ] ?? "results.xml";
var fullPath = Path.GetFullPath(path);
using ( var xmlWriter = XmlWriter.Create( fullPath, new XmlWriterSettings { Indent = true } ) )
WriteResultsToXml( testResults, xmlWriter );

System.Console.WriteLine( $"\n Test results written to: {fullPath}\n" );
}
System.Console.WriteLine( $"\n Test results written to: {fullPath}\n" );
}
Application.Quit( testResults.FailCount > 0 ? 1 : 0 );
}
Expand Down

0 comments on commit 49515f7

Please sign in to comment.