Hello,
I'm trying to run tests on Jenkins. The command line is executing just fine for me, but for some reason windows in not returning it's exit code as expected.
runScript = 'start /WAIT "" ${PathToUnity} -batchmode -nographics -runTests -projectPath ${PathToProject} -testPlatform editmode -logFile logfile.log'
result = bat(returnStatus: true, script: runScript)
println "result === ${result}" // WHY DOES WINDOWS RETURN 0 WHEN THERE ARE COMPILER ERRORS???
if(result != 0){
String message = "Exit ${result} for ${runScript}";
println message
}
I've verified that Jenkins is getting return status properly for mac and windows with other scripts, and mac is getting the exit code properly (when running sh instead of bat). Also as a workaround I know that appending `&& EXIT /B !ERRORLEVEL!` to the runScript string will give me the result correctly, but I'm at a loss for why unity on windows isn't returning an exit code as expected here without the hack (for example it returns zero instead of 1 even though there are intentional compiler errors). Any thoughts?
↧