Repository navigation
Expand file tree
/
Copy pathtest.bat
More file actions
87 lines (78 loc) · 2.89 KB
/
Copy pathtest.bat
File metadata and controls
87 lines (78 loc) · 2.89 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
@echo off
REM ============================================================================
REM test.bat - Run Rift unit tests using Google Test
REM ============================================================================
REM This script:
REM 1. Configures CMake if needed (shares build/ with the game)
REM 2. Builds the rift_tests target
REM 3. Runs all Google Test executables
REM ============================================================================
setlocal
echo ============================================================================
echo RIFT TEST RUNNER
echo ============================================================================
echo.
REM ============================================================================
REM STEP 1: Configure CMake
REM ============================================================================
echo [1/3] Checking CMake configuration...
echo ----------------------------------------------------------------------------
if not exist "build\CMakeCache.txt" (
echo Configuring CMake...
cmake --preset default
if errorlevel 1 (
echo ERROR: CMake configuration failed!
pause
exit /b 1
)
) else (
echo Found existing configuration
)
echo.
REM ============================================================================
REM STEP 2: Build Tests
REM ============================================================================
echo [2/3] Building test executable...
echo ----------------------------------------------------------------------------
cmake --build build --config Release --target rift_tests
if errorlevel 1 (
echo ERROR: Build failed!
pause
exit /b 1
)
echo.
REM ============================================================================
REM STEP 3: Run Tests
REM ============================================================================
echo [3/3] Running tests...
echo ----------------------------------------------------------------------------
echo.
set ALL_PASSED=1
REM Run rift_tests
echo === rift_tests ===
if exist "build\Release\rift_tests.exe" (
build\Release\rift_tests.exe --gtest_color=yes
if errorlevel 1 set ALL_PASSED=0
) else if exist "build\rift_tests.exe" (
build\rift_tests.exe --gtest_color=yes
if errorlevel 1 set ALL_PASSED=0
) else (
echo ERROR: rift_tests.exe not found!
set ALL_PASSED=0
)
echo.
REM ============================================================================
REM SUMMARY
REM ============================================================================
echo ============================================================================
if %ALL_PASSED%==1 (
echo ALL TESTS PASSED
) else (
echo SOME TESTS FAILED
)
echo ============================================================================
if %ALL_PASSED%==1 (
exit /b 0
) else (
exit /b 1
)