forked from kirillkovalenko/nssm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all_tests.bat
More file actions
101 lines (88 loc) · 2.77 KB
/
Copy pathrun_all_tests.bat
File metadata and controls
101 lines (88 loc) · 2.77 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
echo ============================================
echo NSSM - Run All Tests (x86 + x64)
echo ============================================
echo.
REM -----------------------------------------------------------------------
REM Find vcvarsall.bat (VS2017+ via vswhere)
REM -----------------------------------------------------------------------
set VCVARS=
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist "%VSWHERE%" (
for /f "delims=" %%i in ('"%VSWHERE%" -latest -property installationPath') do (
if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
)
if not defined VCVARS (
echo [ERROR] vcvarsall.bat not found. Install VS2019+ with the C++ workload, or run from a VS Developer Command Prompt.
exit /b 1
)
echo [INFO] vcvarsall.bat: !VCVARS!
set ERRORS=0
REM -----------------------------------------------------------------------
REM x64 unit tests
REM -----------------------------------------------------------------------
echo.
echo [1/5] Loading x64 MSVC environment...
call "!VCVARS!" x64 >nul 2>&1
echo [2/5] Building x64 unit tests...
call tests\build_test.bat x64
cd /d "%~dp0"
if errorlevel 1 (
echo [FAILED] x64 unit test build
set /a ERRORS+=1
goto :x86_unit
)
echo Running x64 unit tests...
tests\test_nssm_x64.exe --reporter compact
if errorlevel 1 (
echo [FAILED] x64 unit tests
set /a ERRORS+=1
) else (
echo OK
)
REM -----------------------------------------------------------------------
REM x86 unit tests
REM -----------------------------------------------------------------------
:x86_unit
echo.
echo Cleaning intermediate files...
del /q tests\*.obj 2>nul
echo [3/5] Loading x86 MSVC environment and building x86 unit tests...
call "!VCVARS!" x86 >nul 2>&1
call tests\build_test.bat x86
cd /d "%~dp0"
if errorlevel 1 (
echo [FAILED] x86 unit test build
set /a ERRORS+=1
goto :inttest
)
echo [4/5] Running x86 unit tests...
tests\test_nssm_x86.exe --reporter compact
if errorlevel 1 (
echo [FAILED] x86 unit tests
set /a ERRORS+=1
) else (
echo OK
)
REM -----------------------------------------------------------------------
REM Integration tests (PowerShell finds MSBuild independently)
REM -----------------------------------------------------------------------
:inttest
echo.
echo [5/5] Running integration tests...
powershell -ExecutionPolicy Bypass -File "%~dp0tests\integration\run_tests.ps1"
if errorlevel 1 (
set /a ERRORS+=1
)
echo.
echo ============================================
if !ERRORS! equ 0 (
echo ALL TESTS PASSED
) else (
echo !ERRORS! test suite^(s^) FAILED
)
echo ============================================
exit /b !ERRORS!