Testsuite: better isolation between tests
Restore the path and add an extra clear all between teststime-shift
parent
4a33af5a80
commit
a98393339b
|
@ -46,11 +46,16 @@ while ~isempty(name)
|
||||||
disp('');
|
disp('');
|
||||||
disp(['*** TESTING: ' modfile ' ***']);
|
disp(['*** TESTING: ' modfile ' ***']);
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsMat
|
save wsMat
|
||||||
dynare([testfile ext],'console')
|
dynare([testfile ext],'console')
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
catch exception
|
catch exception
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
failedBase{size(failedBase,2)+1} = modfile;
|
failedBase{size(failedBase,2)+1} = modfile;
|
||||||
printMakeCheckMatlabErrMsg(modfile, exception);
|
printMakeCheckMatlabErrMsg(modfile, exception);
|
||||||
clear exception
|
clear exception
|
||||||
|
@ -90,22 +95,30 @@ for blockFlag = 0:1
|
||||||
% This is the reference simulation path against which all
|
% This is the reference simulation path against which all
|
||||||
% other simulations will be tested
|
% other simulations will be tested
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsMat
|
save wsMat
|
||||||
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
y_ref = oo_.endo_simul;
|
y_ref = oo_.endo_simul;
|
||||||
save('test.mat','y_ref');
|
save('test.mat','y_ref');
|
||||||
catch exception
|
catch exception
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
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);
|
printMakeCheckMatlabErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], exception);
|
||||||
clear exception
|
clear exception
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsMat
|
save wsMat
|
||||||
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
% Test against the reference simulation path
|
% Test against the reference simulation path
|
||||||
load('test.mat','y_ref');
|
load('test.mat','y_ref');
|
||||||
diff = oo_.endo_simul - y_ref;
|
diff = oo_.endo_simul - y_ref;
|
||||||
|
@ -116,7 +129,9 @@ for blockFlag = 0:1
|
||||||
clear exception
|
clear exception
|
||||||
end
|
end
|
||||||
catch exception
|
catch exception
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
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);
|
printMakeCheckMatlabErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], exception);
|
||||||
clear exception
|
clear exception
|
||||||
|
@ -126,9 +141,12 @@ for blockFlag = 0:1
|
||||||
for i = 1:length(stack_solve_algos)
|
for i = 1:length(stack_solve_algos)
|
||||||
num_block_tests = num_block_tests + 1;
|
num_block_tests = num_block_tests + 1;
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsMat
|
save wsMat
|
||||||
run_ls2003(blockFlag, bytecodeFlag, default_solve_algo, stack_solve_algos(i))
|
run_ls2003(blockFlag, bytecodeFlag, default_solve_algo, stack_solve_algos(i))
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
% Test against the reference simulation path
|
% Test against the reference simulation path
|
||||||
load('test.mat','y_ref');
|
load('test.mat','y_ref');
|
||||||
diff = oo_.endo_simul - y_ref;
|
diff = oo_.endo_simul - y_ref;
|
||||||
|
@ -139,7 +157,9 @@ for blockFlag = 0:1
|
||||||
clear exception
|
clear exception
|
||||||
end
|
end
|
||||||
catch exception
|
catch exception
|
||||||
|
clear -all
|
||||||
load wsMat
|
load wsMat
|
||||||
|
path(old_path);
|
||||||
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
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);
|
printMakeCheckMatlabErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], exception);
|
||||||
clear exception
|
clear exception
|
||||||
|
|
|
@ -45,11 +45,16 @@ for i=1:size(name,2)
|
||||||
cd(directory);
|
cd(directory);
|
||||||
printf("\n*** TESTING: %s ***\n", name{i});
|
printf("\n*** TESTING: %s ***\n", name{i});
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsOct
|
save wsOct
|
||||||
dynare([testfile ext])
|
dynare([testfile ext])
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
catch
|
catch
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
failedBase{size(failedBase,2)+1} = name{i};
|
failedBase{size(failedBase,2)+1} = name{i};
|
||||||
printMakeCheckOctaveErrMsg(name{i}, lasterror);
|
printMakeCheckOctaveErrMsg(name{i}, lasterror);
|
||||||
end_try_catch
|
end_try_catch
|
||||||
|
@ -85,21 +90,29 @@ for blockFlag = 0:1
|
||||||
## This is the reference simulation path against which all
|
## This is the reference simulation path against which all
|
||||||
## other simulations will be tested
|
## other simulations will be tested
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsOct
|
save wsOct
|
||||||
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
y_ref = oo_.endo_simul;
|
y_ref = oo_.endo_simul;
|
||||||
save('test.mat','y_ref');
|
save('test.mat','y_ref');
|
||||||
catch
|
catch
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
||||||
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
|
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
|
||||||
end_try_catch
|
end_try_catch
|
||||||
else
|
else
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsOct
|
save wsOct
|
||||||
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
run_ls2003(blockFlag, bytecodeFlag, solve_algos(i), default_stack_solve_algo)
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
## Test against the reference simulation path
|
## Test against the reference simulation path
|
||||||
load('test.mat','y_ref');
|
load('test.mat','y_ref');
|
||||||
diff = oo_.endo_simul - y_ref;
|
diff = oo_.endo_simul - y_ref;
|
||||||
|
@ -109,7 +122,9 @@ for blockFlag = 0:1
|
||||||
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], differr);
|
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], differr);
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
||||||
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
|
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
|
||||||
end_try_catch
|
end_try_catch
|
||||||
|
@ -118,9 +133,12 @@ for blockFlag = 0:1
|
||||||
for i = 1:length(stack_solve_algos)
|
for i = 1:length(stack_solve_algos)
|
||||||
num_block_tests = num_block_tests + 1;
|
num_block_tests = num_block_tests + 1;
|
||||||
try
|
try
|
||||||
|
old_path = path;
|
||||||
save wsOct
|
save wsOct
|
||||||
run_ls2003(blockFlag, bytecodeFlag, default_solve_algo, stack_solve_algos(i))
|
run_ls2003(blockFlag, bytecodeFlag, default_solve_algo, stack_solve_algos(i))
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
## Test against the reference simulation path
|
## Test against the reference simulation path
|
||||||
load('test.mat','y_ref');
|
load('test.mat','y_ref');
|
||||||
diff = oo_.endo_simul - y_ref;
|
diff = oo_.endo_simul - y_ref;
|
||||||
|
@ -130,7 +148,9 @@ for blockFlag = 0:1
|
||||||
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(default_solve_algo) ', ' num2str(stack_solve_algos(i)) ')'], differr);
|
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(default_solve_algo) ', ' num2str(stack_solve_algos(i)) ')'], differr);
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
|
clear -all
|
||||||
load wsOct
|
load wsOct
|
||||||
|
path(old_path);
|
||||||
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
failedBlock{size(failedBlock,2)+1} = ['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'];
|
||||||
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
|
printMakeCheckOctaveErrMsg(['block_bytecode/run_ls2003.m(' num2str(blockFlag) ', ' num2str(bytecodeFlag) ', ' num2str(solve_algos(i)) ', ' num2str(default_stack_solve_algo) ')'], lasterror);
|
||||||
end_try_catch
|
end_try_catch
|
||||||
|
|
Loading…
Reference in New Issue