@@ -14,14 +14,14 @@ Copyright 2023 - Studio Nyx
14
14
15
15
. $PSScriptRoot \dependencies.ps1
16
16
17
- function WaitUnity ([System.Diagnostics.ProcessStartInfo ] $processInfo , $targetName , $unityProjectPath ) {
17
+ function WaitUnity ([System.Diagnostics.ProcessStartInfo ] $processInfo , $targetName , $unityProjectPath , $apiName ) {
18
18
$appdata = " $env: LOCALAPPDATA "
19
19
$logPath = " $appdata \Unity\Editor\Editor.log"
20
20
$processLogsPath = " $unityProjectPath \TestResults"
21
21
22
22
$processInfo.FileName = " $Env: UNITY_2021_3_17 \Unity.exe"
23
- $processInfo.RedirectStandardError = " $processLogsPath \Error.log"
24
- $processInfo.RedirectStandardOutput = " $processLogsPath \Output.log"
23
+ $processInfo.RedirectStandardError = " $processLogsPath$apiName \Error.log"
24
+ $processInfo.RedirectStandardOutput = " $processLogsPath$apiName \Output.log"
25
25
$processInfo.UseShellExecute = $false
26
26
27
27
$process = New-Object System.Diagnostics.Process
@@ -54,7 +54,7 @@ function WaitUnity([System.Diagnostics.ProcessStartInfo] $processInfo, $targetNa
54
54
55
55
if ($process.HasExited ) {
56
56
# Keep a local copy of Unity logs for each targets
57
- $unityLogsCopy = " $processLogsPath \$targetName .log"
57
+ $unityLogsCopy = " $processLogsPath \$targetName$apiName .log"
58
58
Copy-Item $logPath $unityLogsCopy
59
59
60
60
# Unity does not send valid keycode at the end of process operation
@@ -103,13 +103,12 @@ function RunUnitTestWithAPI($apiName) {
103
103
104
104
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
105
105
$pinfo.Arguments = $cmdArgs
106
- WaitUnity $pinfo " UnitTest_InteropUnityCUDA" $Env: INTEROP_UNITY_CUDA_UNITY_PROJECT_ROOT
106
+ WaitUnity $pinfo " UnitTest_InteropUnityCUDA" $Env: INTEROP_UNITY_CUDA_UNITY_PROJECT_ROOT $apiName
107
107
108
108
[xml ]$c = (Get-Content $xmlPath )
109
109
# Display test results
110
110
$details = $c .' test-run' .' test-suite' .' test-suite' .' test-suite' .' test-case' | Select-Object name, duration, result
111
111
$details | Format-Table | Out-String | ForEach-Object { Write-Host $_ }
112
- Write-Host " Passed " $c .' test-run' .' passed' " /" $c .' test-run' .' total'
113
112
$resultTest = $c .' test-run' .' passed' -eq $c .' test-run' .' total'
114
113
if ($resultTest -eq $True ) {
115
114
Write-Host " Unit tests with $apiName have passed !" - ForegroundColor Green
0 commit comments