55 lines
1.1 KiB
Batchfile
55 lines
1.1 KiB
Batchfile
@echo off
|
|
setlocal
|
|
|
|
for %%I in ("%~dp0..") do set "ROOT_DIR=%%~fI"
|
|
set "BUILD_DIR=%ROOT_DIR%\build-tests"
|
|
set "CONFIG=%~1"
|
|
|
|
if not defined CONFIG set "CONFIG=Release"
|
|
|
|
where cmake >nul 2>nul
|
|
if errorlevel 1 (
|
|
echo Error: CMake was not found in PATH.
|
|
exit /b 1
|
|
)
|
|
|
|
where ctest >nul 2>nul
|
|
if errorlevel 1 (
|
|
echo Error: CTest was not found in PATH.
|
|
exit /b 1
|
|
)
|
|
|
|
echo Configuring iKvxx tests in "%BUILD_DIR%"...
|
|
cmake -S "%ROOT_DIR%" -B "%BUILD_DIR%" ^
|
|
-DIKVXX_BUILD_TESTS=ON ^
|
|
-DIKVXX_INSTALL=OFF
|
|
if errorlevel 1 (
|
|
echo Error: CMake configuration failed.
|
|
exit /b 1
|
|
)
|
|
|
|
echo Building iKvxx tests using the %CONFIG% configuration...
|
|
cmake --build "%BUILD_DIR%" --config "%CONFIG%" --parallel
|
|
if errorlevel 1 (
|
|
echo Error: Test build failed.
|
|
exit /b 1
|
|
)
|
|
|
|
echo Running iKvxx tests...
|
|
ctest --test-dir "%BUILD_DIR%" --build-config "%CONFIG%" --show-only
|
|
if errorlevel 1 (
|
|
echo Error: Could not enumerate tests.
|
|
exit /b 1
|
|
)
|
|
|
|
ctest --test-dir "%BUILD_DIR%" ^
|
|
--build-config "%CONFIG%" ^
|
|
--output-on-failure
|
|
if errorlevel 1 (
|
|
echo Error: One or more tests failed.
|
|
exit /b 1
|
|
)
|
|
|
|
echo All iKvxx tests passed.
|
|
exit /b 0
|