Explorar o código

Add missing changes for #4876: Provide more information when unit tests and native tests fail.

Fix-up #4876
Doug Ilijev %!s(int64=8) %!d(string=hai) anos
pai
achega
dffd3ffcf0
Modificáronse 4 ficheiros con 14 adicións e 11 borrados
  1. 2 3
      test/jenkins.testone.cmd
  2. 8 3
      test/runcitests.cmd
  3. 1 2
      test/runnativetests.cmd
  4. 3 3
      test/runtests.cmd

+ 2 - 3
test/jenkins.testone.cmd

@@ -101,9 +101,8 @@ set _error=0
 :: ============================================================================
 :runNativeTests
 
-  echo -- jenkins.testone.cmd ^>^> Running native tests... (this can take some time)
-  :: ensure the _LogDir exists
-  mkdir %_LogDir%
+  echo -- jenkins.testone.cmd ^>^> Running native tests... this can take some time
+  if not exist %_LogDir%\ mkdir %_LogDir%
   set _LogFile=%_LogDir%\nativetests.log
   call :do %_TestDir%\runnativetests.cmd -%1 -binDir %_BinDir% > %_LogFile% 2>&1
   echo -- jenkins.testone.cmd ^>^> Running native tests... DONE!

+ 8 - 3
test/runcitests.cmd

@@ -131,7 +131,7 @@ set _HadFailures=0
 
   call :do %_TestDir%\runtests.cmd -%1%2 %3 -quiet -cleanupall -binDir %_StagingDir%\bin
 
-  if %ERRORLEVEL% NEQ 0 (
+  if "%_error%" NEQ "0" (
     echo -- runcitests.cmd ^>^> runtests.cmd failed
     set _HadFailures=3
   )
@@ -143,11 +143,14 @@ set _HadFailures=0
 :: ============================================================================
 :runNativeTests
 
+  echo -- runcitests.cmd ^>^> Running native tests... this can take some time
+  if not exist %_LogDir%\ mkdir %_LogDir%
   set _LogFile=%_TestDir%\logs\%1_%2\nativetests.log
   call :do %_TestDir%\runnativetests.cmd -%1%2 > %_LogFile% 2>&1
+  echo -- runcitests.cmd ^>^> Running native tests... DONE!
 
-  if %ERRORLEVEL% NEQ 0 (
-    echo -- runcitests.cmd ^>^> "runnativetests.cmd failed (printing %_LogFile% below)"
+  if "%_error%" NEQ "0" (
+    echo -- runcitests.cmd ^>^> runnativetests.cmd failed; printing %_LogFile%
     powershell "if (Test-Path %_LogFile%) { Get-Content %_LogFile% }"
     set _HadFailures=4
   )
@@ -283,6 +286,7 @@ set _HadFailures=0
 
   echo -- runcitests.cmd ^>^> %*
   cmd /s /c "%*"
+  set _error=%ERRORLEVEL%
 
   goto :eof
 
@@ -294,5 +298,6 @@ set _HadFailures=0
 
   echo -- runcitests.cmd ^>^> %* ^> nul 2^>^&1
   cmd /s /c "%* > nul 2>&1"
+  set _error=%ERRORLEVEL%
 
   goto :eof

+ 1 - 2
test/runnativetests.cmd

@@ -186,9 +186,8 @@ goto :main
   call :do nativetests.exe %_NativeTestArgs%
   if "%_error%" NEQ "0" (
     set _HadFailures=1
+    echo -- runnativetests.cmd ^>^> nativetests.exe exited with non-zero exit code %_error%
   )
-  echo -- runnativetests.cmd ^>^> nativetests.exe exited with non-zero exit code (%_error%)
-
   popd
 
   goto :eof

+ 3 - 3
test/runtests.cmd

@@ -120,12 +120,12 @@ goto :main
   )
 
   if "%_HadFailures%" NEQ "0" (
-    echo ^>^> Tests failed. See logs for details.
+    echo -- runtests.cmd ^>^> Tests failed. See logs for details.
   ) else (
-    echo ^>^> All tests passed!
+    echo -- runtests.cmd ^>^> All tests passed!
   )
 
-  echo ^>^> runtests.cmd -- exiting with exit code %_HadFailures%
+  echo -- runtests.cmd ^>^> exiting with exit code %_HadFailures%
 
   exit /b %_HadFailures%