Commit 78957f33 by Christian Kern

Modified tests, to only execute opencl tests when opencl project was build with…

Modified tests, to only execute opencl tests when opencl project was build with opencl. This involves also generating test batch files completely, therefore tests executables need no longer to be added manually to the respective batch files.
parent 65e021ba
...@@ -124,8 +124,26 @@ else() ...@@ -124,8 +124,26 @@ else()
endif() endif()
message(" (set with command line option -DUSE_EXCEPTIONS=ON/OFF)") message(" (set with command line option -DUSE_EXCEPTIONS=ON/OFF)")
# these are the test executables, we expect to be generated.
set(EXPECTED_EMBB_TEST_EXECUTABLES "embb_algorithms_cpp_test"
"embb_base_c_test"
"embb_base_cpp_test"
"embb_containers_cpp_test"
"embb_dataflow_cpp_test"
"embb_mtapi_c_test"
"embb_mtapi_cpp_test"
"embb_mtapi_network_c_test"
"embb_tasks_cpp_test"
)
# if opencl is there, we also expect the mtapi opencl test to be generated
if(OpenCL_FOUND)
list(APPEND EXPECTED_EMBB_TEST_EXECUTABLES "embb_mtapi_opencl_c_test")
endif()
## Copy test execution script to local binaries folder ## Copy test execution script to local binaries folder
#
if (DEFINED CYGWIN) if (DEFINED CYGWIN)
set(test_script_in run_tests_cygwin.sh) set(test_script_in run_tests_cygwin.sh)
set(test_script_out run_tests.sh) set(test_script_out run_tests.sh)
...@@ -136,9 +154,7 @@ else() ...@@ -136,9 +154,7 @@ else()
set(test_script_in run_tests_windows.bat) set(test_script_in run_tests_windows.bat)
set(test_script_out run_tests.bat) set(test_script_out run_tests.bat)
endif() endif()
execute_process( CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/scripts/${test_script_in}.cmake binaries/${test_script_out} )
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/scripts/${test_script_in} binaries/${test_script_out}
)
## Test and Partest build ## Test and Partest build
# #
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# Needs to be located in the folder containing the tests!! # Needs to be located in the folder containing the tests!!
# Is copied automatically there when generating build files with cmake. # Is copied automatically there when generating build files with cmake.
EMBB_TEST_EXECUTABLES="@EXPECTED_EMBB_TEST_EXECUTABLES@"
SCRIPT_LOCATION="$0" SCRIPT_LOCATION="$0"
# case we have symlinks... # case we have symlinks...
...@@ -36,10 +37,6 @@ done ...@@ -36,10 +37,6 @@ done
DIR=`dirname "$SCRIPT_LOCATION"` DIR=`dirname "$SCRIPT_LOCATION"`
TESTS="embb_base_c_test embb_base_cpp_test embb_mtapi_c_test \ for TEST in $(echo $EMBB_TEST_EXECUTABLES | tr ";" " "); do
embb_mtapi_cpp_test embb_tasks_cpp_test embb_algorithms_cpp_test \
embb_containers_cpp_test embb_dataflow_cpp_test"
for TEST in $TESTS; do
"$DIR/$TEST".exe; "$DIR/$TEST".exe;
done done
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# Needs to be located in the folder containing the tests!! # Needs to be located in the folder containing the tests!!
# Is copied automatically there when generating build files with cmake. # Is copied automatically there when generating build files with cmake.
EMBB_TEST_EXECUTABLES="@EXPECTED_EMBB_TEST_EXECUTABLES@"
SCRIPT_LOCATION="$0" SCRIPT_LOCATION="$0"
# case we have symlinks... # case we have symlinks...
...@@ -36,10 +37,6 @@ done ...@@ -36,10 +37,6 @@ done
DIR=`dirname "$SCRIPT_LOCATION"` DIR=`dirname "$SCRIPT_LOCATION"`
TESTS="embb_base_c_test embb_base_cpp_test embb_mtapi_c_test \ for TEST in $(echo $EMBB_TEST_EXECUTABLES | tr ";" " "); do
embb_mtapi_cpp_test embb_tasks_cpp_test embb_algorithms_cpp_test \
embb_containers_cpp_test embb_dataflow_cpp_test"
for TEST in $TESTS; do
$DIR/$TEST; $DIR/$TEST;
done done
...@@ -28,29 +28,28 @@ ...@@ -28,29 +28,28 @@
setlocal EnableDelayedExpansion setlocal EnableDelayedExpansion
SET NUM_ERRORS=0 SET NUM_ERRORS=0
SET DIR=%~dp0 SET DIR=%~dp0
"%DIR:~0,-1%\embb_base_c_test.exe" SET EMBB_EXECUTABLES=@EXPECTED_EMBB_TEST_EXECUTABLES@
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1
echo. call :parse "%EMBB_EXECUTABLES%"
"%DIR:~0,-1%\embb_base_cpp_test.exe" goto :end
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1
echo. :parse
"%DIR:~0,-1%\embb_mtapi_c_test.exe" set list=%1
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1 set list=%list:"=%
echo. FOR /f "tokens=1* delims=;" %%a IN ("%list%") DO (
"%DIR:~0,-1%\embb_mtapi_cpp_test.exe" if not "%%a" == "" call :sub %%a
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1 if not "%%b" == "" call :parse "%%b"
echo. )
"%DIR:~0,-1%\embb_tasks_cpp_test.exe" exit /b
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1
echo. :sub
"%DIR:~0,-1%\embb_algorithms_cpp_test.exe" call "%DIR:~0,-1%\%1.exe"
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1
echo.
"%DIR:~0,-1%\embb_containers_cpp_test.exe"
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1
echo.
"%DIR:~0,-1%\embb_dataflow_cpp_test.exe"
if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1 if not !ERRORLEVEL! ==0 set /a NUM_ERRORS=!NUM_ERRORS!+1
exit /b
:end
if not !NUM_ERRORS! ==0 ( if not !NUM_ERRORS! ==0 (
echo. echo.
SET ERRORLEVEL=1 SET ERRORLEVEL=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment