2
setlocal ENABLEDELAYEDEXPANSION
4
rem Process command line
6
rem This script is designed to allow situations when the tests are installed in
7
rem a different directory from the library.
11
if "%OPENCV_DIR%" == "" (
12
echo>&2 This script runs the OpenCV tests on Windows.
14
echo>&2 usage: %0 ^<OpenCV install directory^>
18
if NOT EXIST "%OPENCV_DIR%" (
19
echo>&2 error: "%OPENCV_DIR%" doesn't exist
24
set PATH=%OPENCV_DIR%\@OPENCV_BIN_INSTALL_PATH@;%PATH%
25
set OPENCV_TEST_PATH=%~dp0
26
set OPENCV_TEST_DATA_PATH=%OPENCV_TEST_PATH%\..\testdata
34
for %%t IN ("%OPENCV_TEST_PATH%\opencv_test_*.exe" "%OPENCV_TEST_PATH%\opencv_perf_*.exe") DO (
36
set report=!test_name!.xml
38
set cmd="%%t" --perf_min_samples=1 --perf_force_samples=1 "--gtest_output=xml:!report!"
40
echo [!test_name!] RUN : !cmd!
43
echo [!test_name!] RETURN_CODE : !ret!
47
set PASSED_TESTS=!PASSED_TESTS! !test_name!
49
echo [!test_name!] FAILED
51
set FAILED_TESTS=!FAILED_TESTS! !test_name!
57
rem Remove temporary test files
59
del /F /Q "%TMP%\ocv*.tmp*"
61
rem Report final status
63
echo ===============================================================
64
echo PASSED TESTS : %PASSED_TESTS%
65
echo FAILED TESTS : %FAILED_TESTS%
66
if %SUMMARY_STATUS% EQU 0 (
68
echo STATUS : All OpenCV tests finished successfully
71
echo STATUS : OpenCV tests finished with status %SUMMARY_STATUS%
74
exit /B %SUMMARY_STATUS%