| 1 |
@rem ------------------------------------------------------------------------------ |
| 2 |
@rem Copyright (C) Intel Corporation |
| 3 |
@rem |
| 4 |
@rem SPDX-License-Identifier: MIT |
| 5 |
@rem ------------------------------------------------------------------------------ |
| 6 |
@rem Run the test suite. |
| 7 |
@rem |
| 8 |
@rem Scope can be limited by providing subset of tests as argumene from among: |
| 9 |
@rem lint, unit |
| 10 |
|
| 11 |
@echo off |
| 12 |
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION |
| 13 |
|
| 14 |
for %%Q in ("%~dp0\.") DO set "script_dir=%%~fQ" |
| 15 |
pushd "%script_dir%\.." |
| 16 |
set "source_dir=%cd%" |
| 17 |
popd |
| 18 |
set "build_dir=%source_dir%\_build" |
| 19 |
set "staging_dir=%source_dir%\_install" |
| 20 |
|
| 21 |
|
| 22 |
if "%~1"=="" ( |
| 23 |
set "do_lint=1" & set "do_unit=1" & goto done |
| 24 |
) |
| 25 |
:loop |
| 26 |
if "%1"=="lint" (set "do_lint=1") else ^ |
| 27 |
if "%1"=="unit" (set "do_unit=1") else ^ |
| 28 |
echo invalid option: '%1' && exit /b 1 |
| 29 |
shift |
| 30 |
if not "%~1"=="" goto loop |
| 31 |
:done |
| 32 |
|
| 33 |
|
| 34 |
if "%do_lint%" == "1" ( |
| 35 |
call "%source_dir%\script\lint.bat" |
| 36 |
if !errorlevel! neq 0 exit /b !errorlevel! |
| 37 |
) |
| 38 |
|
| 39 |
if "%do_unit%" == "1" ( |
| 40 |
ctest --test-dir "%build_dir%" -C Release --output-on-failure -T test |
| 41 |
if !errorlevel! neq 0 exit /b !errorlevel! |
| 42 |
) |
| 43 |
|
| 44 |
endlocal |