Testsuite: fix workaround for TeX option with MATLAB R2014a

MATLAB R2014a run with -nodisplay crashes with the TeX option. A workaround was
introduced in commit f946baf6c5. The present
commit updates this workaround following the move to the Meson build system.

By the way, use consistent variable naming in tests/run_mod_file.m.
kalman-mex
Sébastien Villemot 2023-09-28 15:17:00 +02:00
parent 2600a878da
commit 0e5bba7567
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
5 changed files with 13 additions and 13 deletions

View File

@ -175,16 +175,16 @@ options_mom_ = mom.default_option_mom_values(options_mom_, options_, M_.dname, d
% The TeX option crashes MATLAB R2014a run with "-nodisplay" option
% (as is done from the testsuite).
% Since we cant directly test whether "-nodisplay" has been passed,
% we test for the "TOP_TEST_DIR" environment variable, which is set
% we test for the "source_root" environment variable, which is set
% by the testsuite.
% Note that it was not tested whether the crash happens with more
% recent MATLAB versions, so when OLD_MATLAB_VERSION is increased,
% one should make a test before removing this workaround.
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('TOP_TEST_DIR'))
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('source_root'))
warning('Disabling TeX option due to a bug in MATLAB R2014a with -nodisplay')
options_.TeX = false;
end
if isfield(options_mom_, 'TeX') && options_mom_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('TOP_TEST_DIR'))
if isfield(options_mom_, 'TeX') && options_mom_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('source_root'))
warning('Disabling TeX option due to a bug in MATLAB R2014a with -nodisplay')
options_mom_.TeX = false;
end
@ -599,4 +599,4 @@ if isoctave && isfield(options_mom_, 'prior_restrictions') && ...
% Octave crashes if it tries to save function handles (to the _results.mat file)
% See https://savannah.gnu.org/bugs/?43215
options_mom_.prior_restrictions.routine = [];
end
end

View File

@ -46,12 +46,12 @@ end
% The TeX option crashes MATLAB R2014a run with "-nodisplay" option
% (as is done from the testsuite).
% Since we cant directly test whether "-nodisplay" has been passed,
% we test for the "TOP_TEST_DIR" environment variable, which is set
% we test for the "source_root" environment variable, which is set
% by the testsuite.
% Note that it was not tested whether the crash happens with more
% recent MATLAB versions, so when OLD_MATLAB_VERSION is increased,
% one should make a test before removing this workaround.
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('TOP_TEST_DIR'))
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('source_root'))
warning('Disabling TeX option due to a bug in MATLAB R2014a with -nodisplay')
options_.TeX = false;
end

View File

@ -70,12 +70,12 @@ global M_ options_ oo_ bayestopt_ estim_params_
% The TeX option crashes MATLAB R2014a run with "-nodisplay" option
% (as is done from the testsuite).
% Since we cant directly test whether "-nodisplay" has been passed,
% we test for the "TOP_TEST_DIR" environment variable, which is set
% we test for the "source_root" environment variable, which is set
% by the testsuite.
% Note that it was not tested whether the crash happens with more
% recent MATLAB versions, so when OLD_MATLAB_VERSION is increased,
% one should make a test before removing this workaround.
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('TOP_TEST_DIR'))
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('source_root'))
warning('Disabling TeX option due to a bug in MATLAB R2014a with -nodisplay')
options_.TeX = false;
end

View File

@ -39,12 +39,12 @@ end
% The TeX option crashes MATLAB R2014a run with "-nodisplay" option
% (as is done from the testsuite).
% Since we cant directly test whether "-nodisplay" has been passed,
% we test for the "TOP_TEST_DIR" environment variable, which is set
% we test for the "source_root" environment variable, which is set
% by the testsuite.
% Note that it was not tested whether the crash happens with more
% recent MATLAB versions, so when OLD_MATLAB_VERSION is increased,
% one should make a test before removing this workaround.
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('TOP_TEST_DIR'))
if options_.TeX && ~isoctave && matlab_ver_less_than('8.4') && ~isempty(getenv('source_root'))
warning('Disabling TeX option due to a bug in MATLAB R2014a with -nodisplay')
options_.TeX = false;
end

View File

@ -15,9 +15,9 @@
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
source_dir = getenv('source_root');
addpath([source_dir filesep 'tests' filesep 'utils']);
addpath([source_dir filesep 'matlab']);
source_root = getenv('source_root');
addpath([source_root filesep 'tests' filesep 'utils']);
addpath([source_root filesep 'matlab']);
if isoctave
load_octave_packages