summaryrefslogtreecommitdiff
path: root/Modules/MatlabTestsRedirect.cmake
diff options
context:
space:
mode:
authorSilvio Traversaro <pegua1@gmail.com>2022-03-13 14:23:38 -0400
committerBrad King <brad.king@kitware.com>2022-03-21 14:58:24 -0400
commit8468dfb35f427853f8bd3006160c0e66960f6f39 (patch)
tree1ceaa3ef47fc3744e92395c9253a89f7e930b3ac /Modules/MatlabTestsRedirect.cmake
parentebb06858243c34b0e8447737c7cdad92aee6747b (diff)
downloadcmake-8468dfb35f427853f8bd3006160c0e66960f6f39.tar.gz
FindMatlab: Use -batch option in matlab_add_unit_test if possible
Diffstat (limited to 'Modules/MatlabTestsRedirect.cmake')
-rw-r--r--Modules/MatlabTestsRedirect.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/MatlabTestsRedirect.cmake b/Modules/MatlabTestsRedirect.cmake
index fc36fc3b4c..d651cddd53 100644
--- a/Modules/MatlabTestsRedirect.cmake
+++ b/Modules/MatlabTestsRedirect.cmake
@@ -15,6 +15,7 @@
# -Dcustom_Matlab_test_command=""
# -Dcmd_to_run_before_test=""
# -Dunittest_file_to_run
+# -Dmaut_BATCH_OPTION="-batch"
# -P FindMatlab_TestsRedirect.cmake
set(Matlab_UNIT_TESTS_CMD -nosplash -nodesktop -nodisplay ${Matlab_ADDITIONAL_STARTUP_OPTIONS})
@@ -84,7 +85,7 @@ execute_process(
# Do not use a full path to log file. Depend on the fact that the log file
# is always going to go in the working_directory. This is because matlab
# on unix is a shell script that does not handle spaces in the logfile path.
- COMMAND "${Matlab_PROGRAM}" ${Matlab_UNIT_TESTS_CMD} -logfile "${log_file_name}" -r "${Matlab_SCRIPT_TO_RUN}"
+ COMMAND "${Matlab_PROGRAM}" ${Matlab_UNIT_TESTS_CMD} -logfile "${log_file_name}" "${maut_BATCH_OPTION}" "${Matlab_SCRIPT_TO_RUN}"
RESULT_VARIABLE res
${test_timeout}
OUTPUT_QUIET # we do not want the output twice