forked from xspec/xspec
/
run-xspec-tests.cmd
69 lines (60 loc) · 1.81 KB
/
run-xspec-tests.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@echo off
rem ============================================================================
rem
rem DESCRIPTION: This script is a Windows version of run-xspec-tests.sh
rem See run-xspec-tests.sh for details
rem
rem DEPENDENCIES: This script does *not* need to be run from the current directory (i.e. the test directory)
rem
rem ============================================================================
rem
rem Begin localization of environment changes.
rem Also make sure the command processor extensions are enabled.
rem
verify other 2> NUL
setlocal enableextensions
if errorlevel 1 (
echo Unable to enable extensions
exit /b %ERRORLEVEL%
)
rem
rem Go to the directory where this script resides
rem
pushd "%~dp0"
rem
rem Result log
rem
set RESULT_FILE=result.log
rem
rem Run tests
rem
for %%I in (*.xspec) do (
if /i "%APPVEYOR%"=="True" appveyor AddTest "%%~I" -Framework custom -Filename "%~nx0" -Outcome Running
rem
rem Run
rem
"%COMSPEC%" /c ..\bin\xspec.bat "%%~I" > "%RESULT_FILE%" 2>&1
rem
rem Inspect result
rem
( findstr /r /c:".*failed: [1-9]" "%RESULT_FILE%" || findstr /r /c:"\*\** Error [a-z][a-z]*ing the test suite" "%RESULT_FILE%" ) > NUL
if not errorlevel 1 (
echo FAILED: %%~I
echo ---------- "%RESULT_FILE%"
type "%RESULT_FILE%"
echo ----------
if /i "%APPVEYOR%"=="True" appveyor UpdateTest "%%~I" -Framework custom -Filename "%~nx0" -Outcome Failed -Duration 0
exit /b 1
) else (
echo OK: %%~I
if /i "%APPVEYOR%"=="True" appveyor UpdateTest "%%~I" -Framework custom -Filename "%~nx0" -Outcome Passed -Duration 0
)
)
rem
rem Go back to the initial directory
rem
popd
rem
rem Exit as success
rem
exit /b 0