summaryrefslogtreecommitdiffstats
path: root/Tests/FindMatlab/failure_reports
diff options
context:
space:
mode:
authorRaffi Enficiaud <raffi.enficiaud@mines-paris.org>2018-04-09 20:34:48 (GMT)
committerRaffi Enficiaud <raffi.enficiaud@mines-paris.org>2018-04-09 21:36:53 (GMT)
commitffb1f19191d96572a9fcae166e911a464a143a7a (patch)
tree27d3424c8fdf6f9606bdb4b6fb91f10917465dfd /Tests/FindMatlab/failure_reports
parent44c916b4c831f1e81d3cc686ddb030e363b7e90b (diff)
downloadCMake-ffb1f19191d96572a9fcae166e911a464a143a7a.zip
CMake-ffb1f19191d96572a9fcae166e911a464a143a7a.tar.gz
CMake-ffb1f19191d96572a9fcae166e911a464a143a7a.tar.bz2
FindMatlab: add unit tests
Diffstat (limited to 'Tests/FindMatlab/failure_reports')
-rw-r--r--Tests/FindMatlab/failure_reports/CMakeLists.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/Tests/FindMatlab/failure_reports/CMakeLists.txt b/Tests/FindMatlab/failure_reports/CMakeLists.txt
new file mode 100644
index 0000000..1cf9613
--- /dev/null
+++ b/Tests/FindMatlab/failure_reports/CMakeLists.txt
@@ -0,0 +1,39 @@
+
+cmake_minimum_required (VERSION 2.8.12)
+enable_testing()
+project(failure_reports)
+
+# gather tests about proper failure reports
+
+set(MATLAB_FIND_DEBUG TRUE)
+
+find_package(Matlab REQUIRED COMPONENTS MX_LIBRARY MAIN_PROGRAM)
+
+# main extensions for testing, same as other tests
+matlab_add_mex(
+ # target name
+ NAME cmake_matlab_test_wrapper1
+ # output name
+ OUTPUT_NAME cmake_matlab_mex1
+ SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper1.cpp
+ DOCUMENTATION ${CMAKE_CURRENT_SOURCE_DIR}/../help_text1.m.txt
+ )
+
+# the unit test file does not exist: the failure should be properly reported
+matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-1
+ TIMEOUT 300
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../nonexistantfile.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1>
+ )
+set_tests_properties(${PROJECT_NAME}_matlabtest-1 PROPERTIES WILL_FAIL TRUE)
+
+# without the unit test framework
+matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-2
+ TIMEOUT 300
+ NO_UNITTEST_FRAMEWORK
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../nonexistantfile2.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper1>
+ )
+set_tests_properties(${PROJECT_NAME}_matlabtest-2 PROPERTIES WILL_FAIL TRUE)