Provisions for MATLAB R2019a

In particular, use the new "-batch" option for running the testsuite.
time-shift
Sébastien Villemot 2019-03-22 15:44:29 +01:00
parent 4f6a8a9524
commit 0f28974c2c
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
5 changed files with 45 additions and 13 deletions

View File

@ -137,13 +137,7 @@ AC_ARG_ENABLE([matlab], AS_HELP_STRING([--disable-matlab], [disable compilation
if test "x$enable_matlab" = "xyes"; then
AC_CONFIG_SUBDIRS([mex/build/matlab])
AX_MATLAB
AX_MATLAB_ARCH
if test "${MATLAB_ARCH}" = win32 -o "${MATLAB_ARCH}" = win64; then
MATLAB_BATCH_OPTIONS='-nosplash -automation -wait -sd "$(CURDIR)"'
else
MATLAB_BATCH_OPTIONS='-nosplash -nodisplay'
fi
AC_SUBST([MATLAB_BATCH_OPTIONS])
AX_MATLAB_BATCH_OPTIONS
fi
AM_CONDITIONAL([ENABLE_MATLAB], [test "x$enable_matlab" = "xyes"])
AM_CONDITIONAL([HAVE_CMD_LINE_MATLAB], [test "x$ax_enable_matlab" = "xyes" -a "x$have_windows" = "x"])

View File

@ -0,0 +1,35 @@
dnl Copyright (C) 2019 Dynare Team
dnl
dnl This file is part of Dynare.
dnl
dnl Dynare is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl Dynare is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>.
AC_DEFUN([AX_MATLAB_BATCH_OPTIONS],
[dnl
AC_REQUIRE([AX_MATLAB])
AC_REQUIRE([AX_MATLAB_ARCH])
AC_REQUIRE([AX_MATLAB_VERSION])
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [9.6],
[MATLAB_BATCH_OPTIONS='-batch'],
[
if test "${MATLAB_ARCH}" = win32 -o "${MATLAB_ARCH}" = win64; then
MATLAB_BATCH_OPTIONS='-nosplash -automation -wait -sd "$(CURDIR)" -r'
else
MATLAB_BATCH_OPTIONS='-nosplash -nodisplay -r'
fi
])
AC_SUBST([MATLAB_BATCH_OPTIONS])
])

View File

@ -22,6 +22,9 @@ AC_REQUIRE([AX_MATLAB])
AC_MSG_CHECKING([for MATLAB version])
if test "x$MATLAB_VERSION" != "x"; then
case $MATLAB_VERSION in
*2019a | *2019A)
MATLAB_VERSION="9.6"
;;
*2018b | *2018B)
MATLAB_VERSION="9.5"
;;

View File

@ -882,7 +882,7 @@ check-octave: $(O_XFAIL_TRS_FILES) $(O_TRS_FILES)
%.m.trs %.m.log: %.mod
@echo "`tput bold``tput setaf 8`MATLAB: $(CURDIR)/$*... `tput sgr0`"
@DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(CURDIR)" FILESTEM="$*" \
$(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) -r run_test_matlab > $*.m.log 2> /dev/null || \
$(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) run_test_matlab > $*.m.log 2> /dev/null || \
printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:elapsed-time: 0.0\n" > $*.m.trs
@if test -z "$(filter $*.m.trs,$(M_XFAIL_TRS_FILES))"; then pass_color=2; fail_color=1; else pass_color=1; fail_color=2; fi; \
if grep -q ":test-result: PASS" $*.m.trs; then \
@ -897,7 +897,7 @@ check-octave: $(O_XFAIL_TRS_FILES) $(O_TRS_FILES)
%.m.trs %.m.log : %.m
@echo "`tput bold``tput setaf 8`MATLAB: $(CURDIR)/$*... `tput sgr0`"
@DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(CURDIR)" \
$(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) -r $* > $*.m.log 2> /dev/null
$(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) $* > $*.m.log 2> /dev/null
@echo "`tput bold``tput setaf 8`MATLAB: $(CURDIR)/$* Done!`tput sgr0`"
%.o.trs %.o.log: %.mod
@ -925,7 +925,7 @@ check-octave: $(O_XFAIL_TRS_FILES) $(O_TRS_FILES)
%.m.tls : %.m
@echo "`tput bold``tput setaf 8`MATLAB: $(CURDIR)/$*... `tput sgr0`"
@TOP_TEST_DIR="$(CURDIR)" FILESTEM="$*" \
$(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) -r run_m_script >/dev/null 2>&1
$(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) run_m_script >/dev/null 2>&1
@touch $*.m.tls
@echo "`tput bold`MATLAB`tput setaf 8`: $(CURDIR)/$* Done!`tput sgr0`"

View File

@ -98,9 +98,9 @@ Section "MEX files for MATLAB 64-bit, version 7.9 to 9.3 (R2009b to R2017b)"
File ..\mex\matlab\win64-7.9-9.3\*.mexw64
SectionEnd
Section "MEX files for MATLAB 64-bit, version 9.4 to 9.5 (R2018a to R2018b)"
SetOutPath $INSTDIR\mex\matlab\win64-9.4-9.5
File ..\mex\matlab\win64-9.4-9.5\*.mexw64
Section "MEX files for MATLAB 64-bit, version 9.4 to 9.5 (R2018a to R2019a)"
SetOutPath $INSTDIR\mex\matlab\win64-9.4-9.6
File ..\mex\matlab\win64-9.4-9.6\*.mexw64
SectionEnd
SectionGroupEnd