I found the list of error codes in the forum: https://groups.google.com/forum/?fromgroups=#!topic/specrun/vPQ7z2kpkbs
After ordering the list by the error code you get:
Unknown = 0,
Succeeded = 110,
Ignored = 120,
Pending = 210
NothingToRun = 310,
Skipped = 320,
Inconclusive = 410,
CleanupFailed = 420,
RandomlyFailed = 430,
Failed = 440,
InitializationFailed = 450,
FrameworkError = 510,
ConfigurationError = 520,
Based on this list we use the following command line script on the build server to execute the tests:
SpecRun.exe [...]
if errorlevel 200 exit /b %errorlevel%
exit /b 0
We use the exit command to return the error code. For the higher error level codes (>= 200) we return the error code to break the build. However, error codes below that limit are treated as success and we return 0.
Using this limit (200) the Succeeded and Ignored cases are treated as successful and everything else breaks the build. If you also want to allow Pending tests (210) you can simply check for higher error code in the IF.