build system: make check works with both matlab and octave

time-shift
Houtan Bastani 2011-05-04 16:28:13 +02:00
parent dccdd727f1
commit 8181dc44be
8 changed files with 369 additions and 147 deletions

View File

@ -31,6 +31,7 @@ case ${host_os} in
# On mingw32, we don't want dynamic libgcc
# Note that static-libstdc++ is only supported since GCC 4.5 (but generates no error on older versions)
LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
have_windows="yes"
;;
*cygwin*)
AC_MSG_WARN([You are compiling for the Cygwin target. This means that the preprocessor will])
@ -41,6 +42,7 @@ case ${host_os} in
# And by default, the AC_PROG_F77 will pick up g77 if it is present (even if gfortran is also here)
F77=gfortran
fi
have_windows="yes"
;;
esac
@ -201,6 +203,8 @@ AC_CONFIG_FILES([Makefile
AC_ARG_ENABLE([matlab], AS_HELP_STRING([--disable-matlab], [disable compilation of MEX files for MATLAB]), [], [enable_matlab=yes])
if test "x$enable_matlab" = "xyes"; then
AC_CONFIG_SUBDIRS([mex/build/matlab])
AX_MATLAB
AM_CONDITIONAL([HAVE_CMD_LINE_MATLAB], [test "x$ax_enable_matlab" = "xyes" -a "x$have_windows" = "x"])
fi
AM_CONDITIONAL([ENABLE_MATLAB], [test "x$enable_matlab" = "xyes"])

6
tests/.gitignore vendored
View File

@ -10,15 +10,17 @@
*.dat
*_simul
/block_bytecode/ws
/block_bytecode/wsOct
/block_bytecode/ls2003_tmp.mod
/partial_information/PItest3aHc0PCLsimModPiYrVarobsAll_PCL*
/partial_information/PItest3aHc0PCLsimModPiYrVarobsCNR_PCL*
!/fs2000_ssfile_aux.m
!/printMakeCheckErrMsg.m
!/printMakeCheckMatlabErrMsg.m
!/printMakeCheckOctaveErrMsg.m
!/ramst_initval_file_data.m
!/run_test.m
!/run_test_matlab.m
!/run_test_octave.m
!/test.m
!/AIM/data_ca1.m

View File

@ -1,10 +1,138 @@
DYNARE_ROOT = $(abs_top_srcdir)/matlab
TESTS_ENVIRONMENT = \
$(OCTAVE) --norc --silent --no-history --path $(DYNARE_ROOT) --eval dynver=\"$(PACKAGE_VERSION)\"
MODFILES = \
ramst.mod \
ramst_a.mod \
example1.mod \
example2.mod \
example1_use_dll.mod \
example1_with_tags.mod \
t_sgu_ex1.mod \
osr_example.mod \
optimal_policy/ramsey.mod \
optimal_policy/mult_elimination_test.mod \
discretionary_policy/dennis_1.mod \
ramst_initval_file.mod \
ramst_normcdf_and_friends.mod \
example1_varexo_det.mod \
predetermined_variables.mod \
fs2000_nonstationary.mod \
fs2000_ssfile.mod \
comments.mod \
histval_sto.mod \
histval_det.mod \
expectation.mod \
steady_state_operator/standard.mod \
steady_state_operator/use_dll.mod \
steady_state_operator/block.mod \
steady_state_operator/bytecode_test.mod \
block_bytecode/ireland.mod \
block_bytecode/ramst_normcdf_and_friends.mod \
k_order_perturbation/fs2000k2a.mod \
k_order_perturbation/fs2000k2_use_dll.mod \
k_order_perturbation/fs2000k_1_use_dll.mod \
k_order_perturbation/fs2000k3_use_dll.mod \
k_order_perturbation/fs2000k2_m.mod \
k_order_perturbation/fs2000k_1_m.mod \
k_order_perturbation/fs2000k3_m.mod \
partial_information/PItest3aHc0PCLsimModPiYrVarobsAll.mod \
partial_information/PItest3aHc0PCLsimModPiYrVarobsCNR.mod \
arima/mod1.mod \
arima/mod1a.mod \
arima/mod1b.mod \
arima/mod1c.mod \
arima/mod2.mod \
arima/mod2a.mod \
arima/mod2b.mod \
arima/mod2c.mod \
fs2000/fs2000.mod \
fs2000/fs2000a.mod \
fs2000/fs2000c.mod \
homotopy/homotopy1_test.mod \
homotopy/homotopy2_test.mod \
homotopy/homotopy3_test.mod \
bvar_a_la_sims/bvar_standalone.mod \
bvar_a_la_sims/bvar_and_dsge.mod \
AIM/fs2000x10L9_L.mod \
AIM/fs2000x10L9_L_AIM.mod \
AIM/fs2000x10_L9_L.mod \
AIM/fs2000x10_L9_L_AIM.mod \
AIM/fs2000_b1L1L.mod \
AIM/fs2000_b1L1L_AIM.mod \
AIM/ls2003_2L0L.mod \
AIM/ls2003_2L0L_AIM.mod \
AIM/ls2003_2L2L.mod \
AIM/ls2003_2L2L_AIM.mod \
conditional_variance_decomposition/example1.mod \
dsge-var/simul_hybrid.mod \
dsge-var/dsgevar_forward_calibrated_lambda.mod \
dsge-var/dsgevar_forward_estimated_lambda.mod \
external_function/example1_1st_and_2nd_deriv_functions_provided.mod \
external_function/example1_1st_and_2nd_deriv_functions_provided_dll.mod \
external_function/example1_1st_deriv_function_provided.mod \
external_function/example1_1st_deriv_function_provided_dll.mod \
external_function/example1_no_deriv_functions_provided.mod \
external_function/example1_no_deriv_functions_provided_dll.mod \
seeds.mod \
simul/example1.mod
TESTS = \
run_test_octave.m
EXTRA_DIST = \
$(MODFILES) \
homotopy/common.mod \
block_bytecode/ls2003.mod \
fs2000_ssfile_aux.m \
printMakeCheckMatlabErrMsg.m \
printMakeCheckOctaveErrMsg.m \
ramst_initval_file_data.m \
run_test.m \
run_test_matlab.m \
run_test_octave.m \
test.m \
AIM/data_ca1.m \
AIM/fs2000_b1L1L_AIM_steadystate.m \
AIM/fs2000_b1L1L_steadystate.m \
AIM/fsdat.m \
block_bytecode/run_ls2003.m \
bvar_a_la_sims/bvar_sample.m \
external_function/extFunDeriv.m \
external_function/extFunNoDerivs.m \
external_function/extFunWithFirstAndSecondDerivs.m \
fs2000/fs2000a_steadystate.m \
fs2000/fsdat_simul.m \
k_order_perturbation/run_fs2000kplusplus.m \
ls2003/data_ca1.m \
measurement_errors/data_ca1.m \
missing/simulate_data_with_missing_observations.m \
objectives/sgu_ex1.mat
TARGETS = check-test-file
if HAVE_CMD_LINE_MATLAB
TARGETS += check-matlab
endif
if HAVE_OCTAVE
TARGETS += check-octave
endif
check-local: $(TARGETS)
check-test-file: $(MODFILES)
@set -e; \
echo "function name=filesToTest()" > filesToTest.m; \
echo "name = { ..." >> filesToTest.m; \
for modfile in $(MODFILES); do \
echo " '"$$modfile"' ..." >> filesToTest.m; \
done
@set -e; \
echo " };" >> filesToTest.m; \
echo "end" >> filesToTest.m;
check-matlab:
$(MATLAB)/bin/matlab -nodesktop -nosplash -r run_test_matlab
check-octave:
$(OCTAVE) --norc --silent --no-history --path $(DYNARE_ROOT) --eval dynver=\"$(PACKAGE_VERSION)\" run_test_octave.m
clean-local:
rm -f $(patsubst %.mod, %.m, $(MODS)) \

View File

@ -1,29 +1,31 @@
## Copyright (C) 2010 Dynare Team
##
## This file is part of Dynare.
##
## Dynare is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## Dynare is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Dynare. If not, see <http://www.gnu.org/licenses/>.
function run_ls2003(block, bytecode, solve_algo, stack_solve_algo)
printf("\nTEST: ls2003 (block=%d, bytecode=%d, solve_algo=%d, stack_solve_algo=%d)...\n", block, bytecode, solve_algo, stack_solve_algo);
fid = fopen("ls2003_tmp.mod", "w");
assert(fid > 0);
fprintf(fid, "@#define block = %d\n@#define bytecode = %d\n@#define solve_algo = %d\n@#define stack_solve_algo = %d\n@#include \"ls2003.mod\"\n", block, bytecode, solve_algo, stack_solve_algo)
fclose(fid);
dynare("ls2003_tmp.mod")
endfunction
## Local variables:
## mode: Octave
## End:
% Copyright (C) 2010-2011 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
disp(['TEST: ls2003 (block=' num2str(block) ', bytecode=' ...
num2str(bytecode) ', solve_algo=' num2str(solve_algo) ...
', stack_solve_algo=' num2str(stack_solve_algo) ')...']);
fid = fopen('ls2003_tmp.mod', 'w');
assert(fid > 0);
fprintf(fid, ['@#define block = %d\n@#define bytecode = %d\n' ...
'@#define solve_algo = %d\n@#define stack_solve_algo = %d\n' ...
'@#include \"ls2003.mod\"\n'], block, bytecode, ...
solve_algo, stack_solve_algo);
fclose(fid);
dynare('ls2003_tmp.mod')
end

View File

@ -0,0 +1,9 @@
function printMakeCheckMatlabErrMsg(modfilename, exception)
fprintf('\n********************************************\n');
disp('*** DYNARE-TEST-MATLAB ERROR ENCOUNTERED ***');
disp('********************************************');
disp([' WHILE RUNNING MODFILE: ' modfilename]);
fprintf('\n');
disp(getReport(exception));
fprintf('*************************************\n\n\n');
end

View File

@ -1,8 +1,8 @@
function printMakeCheckErrMsg(modfilename, err)
function printMakeCheckOctaveErrMsg(modfilename, err)
printf("\n");
printf("*************************************\n");
printf("*** DYNARE-TEST ERROR ENCOUNTERED ***\n");
printf("*************************************\n");
printf("********************************************\n");
printf("*** DYNARE-TEST-OCTAVE ERROR ENCOUNTERED ***\n");
printf("********************************************\n");
printf(" WHILE RUNNING MODFILE: %s\n", modfilename);
printf(" MSG: %s\n", err.message);
if (size(err.stack, 1) > 0)
@ -11,4 +11,4 @@ function printMakeCheckErrMsg(modfilename, err)
printf(" ON LINE and COLUMN: %d and %d\n",err.stack(1).line,err.stack(1).column);
end
printf("*************************************\n\n\n");
end
end

151
tests/run_test_matlab.m Normal file
View File

@ -0,0 +1,151 @@
% Copyright (C) 2011 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% List of files to be tested
name=filesToTest();
% BASE TESTS
failedBase = {};
top_test_dir = pwd;
addpath(top_test_dir);
addpath([top_test_dir '/../matlab']);
for i=1:size(name,2)
try
[directory, testfile, ext] = fileparts([top_test_dir '/' name{i}]);
cd(directory);
disp(['*** TESTING: ' name{i} ' ***']);
dynare([testfile ext], 'noclearall')
catch exception
failedBase{size(failedBase,2)+1} = name{i};
printMakeCheckMatlabErrMsg(name{i}, exception);
end
cd(top_test_dir);
save('makeCheckMatlabBase.mat', 'name', 'failedBase', 'i', 'top_test_dir');
clear -all;
load('makeCheckMatlabBase.mat');
end
% BLOCK TEST
clear i name;
failedBlock = {};
num_block_tests = 0;
cd([top_test_dir '/block_bytecode']);
save('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
for blockFlag = 0:1
for bytecodeFlag = 0:1
default_solve_algo = 2;
default_stack_solve_algo = 0;
if ~blockFlag && ~bytecodeFlag
solve_algos = 0:4;
stack_solve_algos = 0;
elseif blockFlag && ~bytecodeFlag
solve_algos = [0:4 6:8];
stack_solve_algos = 0:4;
else
solve_algos = 0:8;
stack_solve_algos = 0:5;
end
for i = 1:length(solve_algos)
num_block_tests = num_block_tests + 1;
save wsMat
if ~blockFlag && ~bytecodeFlag && (i == 1)
try
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
y_ref = oo_.endo_simul;
save('test.mat','y_ref');
catch exception
load wsMat
load('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
printMakeCheckMatlabErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], exception);
save('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
end
else
try
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
load('test.mat','y_ref');
diff = oo_.endo_simul - y_ref;
if(abs(diff) > options_.dynatol)
load wsMat
load('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
exception = MException('ERROR: diff fails for block code in run_test_octave.m', ['makecheck found error: if (abs(diff) <= options_.dynatol) FAILS. line 85, col 1.' ]);
printMakeCheckMatlabErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], exception);
save('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
end
catch exception
load wsMat
load('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
printMakeCheckMatlabErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], exception);
save('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
end
end
load wsMat
end
for i = 1:length(stack_solve_algos)
num_block_tests = num_block_tests + 1;
save wsMat
try
run_ls2003(blockFlag, bytecodeFlag, default_solve_algo, stack_solve_algos(i))
catch exception
load wsMat
load('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
printMakeCheckMatlabErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], exception);
save('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir');
end
load wsMat
end
end
end
load('makeCheckBlockByteMatlab.mat');
save('makeCheckBlockByteMatlab.mat', 'failedBlock', 'top_test_dir', 'num_block_tests');
delete('wsMat.mat');
clear -all;
load('makeCheckBlockByteMatlab.mat');
delete('makeCheckBlockByteMatlab.mat');
cd(top_test_dir);
load('makeCheckMatlabBase.mat');
delete('makeCheckMatlabBase.mat');
total_tests = size(name,2)+num_block_tests;
fprintf('\n\n\n');
disp('***************************************');
disp('* DYNARE TEST RESULTS *');
disp('* for make check-matlab *');
disp('***************************************');
disp([' ' num2str(total_tests-size(failedBase,2)-size(failedBlock,2)) ' tests PASSED out of ' num2str(total_tests) ' tests run']);
disp('***************************************');
if size(failedBase,2) > 0 || size(failedBlock,2) > 0
disp(['List of ' num2str(size(failedBase,2)+size(failedBlock,2)) ' tests FAILED:']);
for i=1:size(failedBase,2)
disp([' * ' failedBase{i}]);
end
for i=1:size(failedBlock,2)
disp([' * ' failedBlock{i}]);
end
fprintf('***************************************\n\n');
end
exit;

View File

@ -21,82 +21,7 @@ if !strcmp(dynare_version(), dynver)
endif
## List of files to be tested
name = { ...
'ramst.mod' ...
'ramst_a.mod' ...
'example1.mod' ...
'example2.mod' ...
'example1_use_dll.mod' ...
'example1_with_tags.mod' ...
't_sgu_ex1.mod' ...
'osr_example.mod' ...
'optimal_policy/ramsey.mod' ...
'optimal_policy/mult_elimination_test.mod' ...
'discretionary_policy/dennis_1.mod' ...
'ramst_initval_file.mod' ...
'ramst_normcdf_and_friends.mod' ...
'example1_varexo_det.mod' ...
'predetermined_variables.mod' ...
'fs2000_nonstationary.mod' ...
'fs2000_ssfile.mod' ...
'comments.mod' ...
'histval_sto.mod' ...
'histval_det.mod' ...
'expectation.mod' ...
'steady_state_operator/standard.mod' ...
'steady_state_operator/use_dll.mod' ...
'steady_state_operator/block.mod' ...
'steady_state_operator/bytecode_test.mod' ...
'block_bytecode/ireland.mod' ...
'block_bytecode/ramst_normcdf_and_friends.mod' ...
'k_order_perturbation/fs2000k2a.mod' ...
'k_order_perturbation/fs2000k2_use_dll.mod' ...
'k_order_perturbation/fs2000k_1_use_dll.mod' ...
'k_order_perturbation/fs2000k3_use_dll.mod' ...
'k_order_perturbation/fs2000k2_m.mod' ...
'k_order_perturbation/fs2000k_1_m.mod' ...
'k_order_perturbation/fs2000k3_m.mod' ...
'partial_information/PItest3aHc0PCLsimModPiYrVarobsAll.mod' ...
'partial_information/PItest3aHc0PCLsimModPiYrVarobsCNR.mod' ...
'arima/mod1.mod' ...
'arima/mod1a.mod' ...
'arima/mod1b.mod' ...
'arima/mod1c.mod' ...
'arima/mod2.mod' ...
'arima/mod2a.mod' ...
'arima/mod2b.mod' ...
'arima/mod2c.mod' ...
'fs2000/fs2000.mod' ...
'fs2000/fs2000a.mod' ...
'fs2000/fs2000c.mod' ...
'homotopy/homotopy1_test.mod' ...
'homotopy/homotopy2_test.mod' ...
'homotopy/homotopy3_test.mod' ...
'bvar_a_la_sims/bvar_standalone.mod' ...
'bvar_a_la_sims/bvar_and_dsge.mod' ...
'AIM/fs2000x10L9_L.mod' ...
'AIM/fs2000x10L9_L_AIM.mod' ...
'AIM/fs2000x10_L9_L.mod' ...
'AIM/fs2000x10_L9_L_AIM.mod' ...
'AIM/fs2000_b1L1L.mod' ...
'AIM/fs2000_b1L1L_AIM.mod' ...
'AIM/ls2003_2L0L.mod' ...
'AIM/ls2003_2L0L_AIM.mod' ...
'AIM/ls2003_2L2L.mod' ...
'AIM/ls2003_2L2L_AIM.mod' ...
'conditional_variance_decomposition/example1.mod' ...
'dsge-var/simul_hybrid.mod' ...
'dsge-var/dsgevar_forward_calibrated_lambda.mod' ...
'dsge-var/dsgevar_forward_estimated_lambda.mod' ...
'external_function/example1_1st_and_2nd_deriv_functions_provided.mod' ...
'external_function/example1_1st_and_2nd_deriv_functions_provided_dll.mod' ...
'external_function/example1_1st_deriv_function_provided.mod' ...
'external_function/example1_1st_deriv_function_provided_dll.mod' ...
'external_function/example1_no_deriv_functions_provided.mod' ...
'external_function/example1_no_deriv_functions_provided_dll.mod' ...
'seeds.mod' ...
'simul/example1.mod' ...
};
name = filesToTest();
## Ask gnuplot to create graphics in text mode
## Note that setenv() was introduced in Octave 3.0.2, for compatibility
@ -116,13 +41,13 @@ for i=1:size(name,2)
dynare([testfile ext], 'noclearall')
catch
failedBase{size(failedBase,2)+1} = name{i};
printMakeCheckErrMsg(name{i}, lasterror);
printMakeCheckOctaveErrMsg(name{i}, lasterror);
end_try_catch
cd(top_test_dir);
save('makeCheckBase.mat', 'name', 'failedBase', 'i', 'top_test_dir');
save('makeCheckOctaveBase.mat', 'name', 'failedBase', 'i', 'top_test_dir');
clear -all;
load('makeCheckBase.mat');
load('makeCheckOctaveBase.mat');
end
## BLOCK TEST
@ -130,7 +55,7 @@ clear i name;
failedBlock = {};
num_block_tests = 0;
cd([top_test_dir '/block_bytecode']);
save('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
save('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
for blockFlag = 0:1
for bytecodeFlag = 0:1
## Recall that solve_algo=7 and stack_solve_algo=2 are not supported
@ -150,18 +75,18 @@ for blockFlag = 0:1
for i = 1:length(solve_algos)
num_block_tests = num_block_tests + 1;
save ws
save wsOct
if !blockFlag && !bytecodeFlag && (i == 1)
try
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
y_ref = oo_.endo_simul;
save('test.mat','y_ref');
catch
load ws
load('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
load wsOct
load('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
printMakeCheckErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
save('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
save('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
end_try_catch
else
try
@ -169,61 +94,62 @@ for blockFlag = 0:1
load('test.mat','y_ref');
diff = oo_.endo_simul - y_ref;
if(abs(diff) > options_.dynatol)
load ws
load('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
load wsOct
load('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
differr.message = ["makecheck found error: if (abs(diff) <= options_.dynatol) FAILS." ];
differr.stack(1).file = "run_test_octave.m";
differr.stack(1).name = "run_test_octave.m";
differr.stack(1).line = 72;
differr.stack(1).line = 96;
differr.stack(1).column = 1;
printMakeCheckErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], differr);
save('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], differr);
save('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
endif
catch
load ws
load('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
load wsOct
load('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
printMakeCheckErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
save('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
save('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
end_try_catch
endif
load ws
load wsOct
endfor
for i = 1:length(stack_solve_algos)
num_block_tests = num_block_tests + 1;
save ws
save wsOct
try
run_ls2003(blockFlag, bytecodeFlag, default_solve_algo, stack_solve_algos(i))
catch
load ws
load('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
load wsOct
load('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
printMakeCheckErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
save('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir');
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
save('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir');
end_try_catch
load ws
load wsOct
endfor
endfor
endfor
load('makeCheckBlockByte.mat');
save('makeCheckBlockByte.mat', 'failedBlock', 'top_test_dir', 'num_block_tests');
delete('ws');
load('makeCheckOctaveBlockByte.mat');
save('makeCheckOctaveBlockByte.mat', 'failedBlock', 'top_test_dir', 'num_block_tests');
delete('wsOct');
clear -all;
load('makeCheckBlockByte.mat');
delete('makeCheckBlockByte.mat');
load('makeCheckOctaveBlockByte.mat');
delete('makeCheckOctaveBlockByte.mat');
cd(top_test_dir);
load('makeCheckBase.mat');
delete('makeCheckBase.mat');
load('makeCheckOctaveBase.mat');
delete('makeCheckOctaveBase.mat');
total_tests = size(name,2)+num_block_tests;
printf("\n\n\n");
printf("***************************************\n");
printf("* DYNARE TEST RESULTS *\n");
printf("* for make check-octave *\n");
printf("***************************************\n");
printf(" %d tests PASSED out of %d tests run\n", total_tests-size(failedBase,2)-size(failedBlock,2), total_tests);
printf("***************************************\n");
@ -237,7 +163,7 @@ if size(failedBase,2) > 0 || size(failedBlock,2) > 0
end
printf("***************************************\n\n");
clear -all
error("Make Check FAILED");
error("make check-octave FAILED");
end
clear -all