[Cmake-commits] CMake branch, next, updated. v3.6.1-1685-ge30f686
Brad King
brad.king at kitware.com
Thu Sep 1 15:06:42 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via e30f686be781bdd2925b9b072d1426e53d21494d (commit)
via 9fdc122bdbda2057f6b44c3122b3199e33ce8bc7 (commit)
from fc6661363956d97e4f726623f0b551bc4292cac5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e30f686be781bdd2925b9b072d1426e53d21494d
commit e30f686be781bdd2925b9b072d1426e53d21494d
Merge: fc66613 9fdc122
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 1 15:06:41 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Sep 1 15:06:41 2016 -0400
Merge topic 'extend_matlab_unit_test' into next
9fdc122b fixup! Extend matlab_add_unit_test to run arbitrary code for the test.
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fdc122bdbda2057f6b44c3122b3199e33ce8bc7
commit 9fdc122bdbda2057f6b44c3122b3199e33ce8bc7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 1 10:13:23 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 1 10:17:10 2016 -0400
fixup! Extend matlab_add_unit_test to run arbitrary code for the test.
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index aaca953..4c787d7 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -784,29 +784,19 @@ function(matlab_add_unit_test)
message(FATAL_ERROR "[MATLAB] The Matlab test name cannot be empty")
endif()
- # escape matlab commands so they can be passed to add_test
- # and to cmake -P script.
-
- string(REPLACE "\"" "" custom_test_cmd_clean "${${prefix}_CUSTOM_TEST_COMMAND}")
- string(REPLACE ";" "\\;" custom_test_cmd_clean "${custom_test_cmd_clean}")
- string(REPLACE "\"" "" unittest_precmd_clean "${${prefix}_UNITTEST_PRECOMMAND}")
- string(REPLACE ";" "\\;" unittest_precmd_clean "${unittest_precmd_clean}")
- string(REPLACE " " "\ " unittest_precmd_clean "${unittest_precmd_clean}")
- string(REPLACE ";" "\\;" additional_path_clean "${${prefix}_ADDITIONAL_PATH}")
-
add_test(NAME ${${prefix}_NAME}
COMMAND ${CMAKE_COMMAND}
- -Dtest_name=${${prefix}_NAME}
- -Dadditional_paths=${additional_path_clean}
- -Dtest_timeout=${${prefix}_TIMEOUT}
- -Doutput_directory=${_matlab_temporary_folder}
- -Dworking_directory=${${prefix}_WORKING_DIRECTORY}
- -DMatlab_PROGRAM=${Matlab_MAIN_PROGRAM}
- -Dno_unittest_framework=${${prefix}_NO_UNITTEST_FRAMEWORK}
- -DMatlab_ADDITIONNAL_STARTUP_OPTIONS=${${prefix}_MATLAB_ADDITIONAL_STARTUP_OPTIONS}
- -Dunittest_file_to_run=${${prefix}_UNITTEST_FILE}
- -Dcustom_Matlab_test_command=${custom_test_cmd_clean}
- -Dcmd_to_run_before_test=${unittest_precmd_clean}
+ "-Dtest_name=${${prefix}_NAME}"
+ "-Dadditional_paths=${${prefix}_ADDITIONAL_PATH}}"
+ "-Dtest_timeout=${${prefix}_TIMEOUT}"
+ "-Doutput_directory=${_matlab_temporary_folder}"
+ "-Dworking_directory=${${prefix}_WORKING_DIRECTORY}"
+ "-DMatlab_PROGRAM=${Matlab_MAIN_PROGRAM}"
+ "-Dno_unittest_framework=${${prefix}_NO_UNITTEST_FRAMEWORK}"
+ "-DMatlab_ADDITIONNAL_STARTUP_OPTIONS=${${prefix}_MATLAB_ADDITIONAL_STARTUP_OPTIONS}"
+ "-Dunittest_file_to_run=${${prefix}_UNITTEST_FILE}"
+ "-Dcustom_Matlab_test_command=${${prefix}_CUSTOM_TEST_COMMAND}}"
+ "-Dcmd_to_run_before_test=${${prefix}_UNITTEST_PRECOMMAND}"
-P ${_FindMatlab_SELF_DIR}/MatlabTestsRedirect.cmake
${${prefix}_TEST_ARGS}
${${prefix}_UNPARSED_ARGUMENTS}
diff --git a/Modules/MatlabTestsRedirect.cmake b/Modules/MatlabTestsRedirect.cmake
index 5677ef6..1045be8 100644
--- a/Modules/MatlabTestsRedirect.cmake
+++ b/Modules/MatlabTestsRedirect.cmake
@@ -59,7 +59,7 @@ foreach(s IN LISTS additional_paths)
endforeach()
if(custom_Matlab_test_command)
- set(unittest_to_run ${custom_Matlab_test_command})
+ set(unittest_to_run "${custom_Matlab_test_command}")
else()
set(unittest_to_run "runtests('${unittest_file_to_run_name}'), exit(max([ans(1,:).Failed]))")
endif()
@@ -70,7 +70,8 @@ if(no_unittest_framework)
endif()
set(Matlab_SCRIPT_TO_RUN
- "addpath(${concat_string}); ${cmd_to_run_before_test}; ${unittest_to_run}")
+ "addpath(${concat_string}); ${cmd_to_run_before_test}; ${unittest_to_run}"
+ )
if(NOT working_directory)
set(working_directory "${output_directory}")
-----------------------------------------------------------------------
Summary of changes:
Modules/FindMatlab.cmake | 32 +++++++++++---------------------
Modules/MatlabTestsRedirect.cmake | 5 +++--
2 files changed, 14 insertions(+), 23 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list