-
Notifications
You must be signed in to change notification settings - Fork 13
/
run-tests.bat
48 lines (41 loc) · 1.89 KB
/
run-tests.bat
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
@ECHO OFF
REM ********************************************************************
REM File: run-tests.bat
REM Description: Runs test suite under all supported versions of Python
REM and displays failures when encountered.
REM ********************************************************************
GOTO:mainProgram
REM ********************************************************************
REM Define function (takes command to run as a single argument).
REM ********************************************************************
:runCommand
SETLOCAL & IF %GLOBAL_ERRORLEVEL% NEQ 0 ENDLOCAL & GOTO:EOF
ECHO.
ECHO ======================================================================
ECHO %~1
ECHO ======================================================================
CALL %~fs1
IF %ERRORLEVEL% NEQ 0 (
ECHO.
ECHO Failed Command: %~1
)
ENDLOCAL & SET GLOBAL_ERRORLEVEL=%ERRORLEVEL%
GOTO:EOF
REM ********************************************************************
REM Run test suite in all supported versions of Python.
REM ********************************************************************
:mainProgram
SET GLOBAL_ERRORLEVEL=0
CALL :runCommand "C:\Program Files\Python37\python.exe -B -m unittest %*"
CALL :runCommand "C:\Program Files\Python 3.6\python.exe -B -m unittest %*"
CALL :runCommand "C:\Program Files\Python 3.5\python.exe -B -m unittest %*"
CALL :runCommand "C:\Python34\python.exe -B -m unittest %*"
CALL :runCommand "C:\Python33\python.exe -B -m unittest %*"
CALL :runCommand "C:\Python32\python.exe -B -m unittest %*"
CALL :runCommand "C:\Python31\python.exe -B tests/discover.py %*"
CALL :runCommand "C:\Python27\python.exe -B -m unittest discover %*"
CALL :runCommand "C:\Python26\python.exe -B tests/discover.py %*"
IF %GLOBAL_ERRORLEVEL% EQU 0 (
ECHO.
ECHO All commands successful.
)