Windows WML tests: Improve stdout output

Differentiate between timeouts and real errors: In case of a timeout, only
throw a warning instead of an error.

Also implement a basic progress bar.
This commit is contained in:
aquileia 2014-05-29 02:37:48 +02:00
parent 8d91cef488
commit f90569ccee

View file

@ -9,6 +9,7 @@ set binary=wesnoth.exe
set opt=--log-strict=warning
cd ..\..\
echo running WML tests:
:: ignore lines beginning with #
:: %%G contains whether the test should pass (0), timeout (2) or fail (1,4)
@ -17,9 +18,19 @@ for /f "eol=# tokens=1,2 delims= " %%G in (%LoadFile%) do (
:: WindowsTimeout is more reliable than the --timeout option
WindowsTimeout.exe "%binary% %opt% -u %%H" 20000
if !ERRORLEVEL! neq %%G (
echo WML_tests.cmd: Error WML1: Test '%%H' returned !ERRORLEVEL!, expected %%G
if !ERRORLEVEL! equ 2 (
echo(
echo WML_tests.cmd: Warning WML2: Test '%%H' timed out, expected return value %%G
) else (
echo(
echo WML_tests.cmd: Error WML1: Test '%%H' returned !ERRORLEVEL!, expected %%G
)
)
:: minimalistic progress bar
<nul (set/p progress=.)
)
echo(
echo WML tests completed
:: restore the state before execution
cd %~p0