Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
e49cada3
Verified
Commit
e49cada3
authored
3 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Testsuite: run_block_byte_tests_{matlab,octave}.m were not actually checking the results
parent
65e18fe8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/run_block_byte_tests_matlab.m
+13
-7
13 additions, 7 deletions
tests/run_block_byte_tests_matlab.m
tests/run_block_byte_tests_octave.m
+8
-3
8 additions, 3 deletions
tests/run_block_byte_tests_octave.m
with
21 additions
and
10 deletions
tests/run_block_byte_tests_matlab.m
+
13
−
7
View file @
e49cada3
...
...
@@ -19,9 +19,13 @@
%
% Before every call to Dynare, the contents of the workspace is saved in
% 'wsMat.mat', and reloaded after Dynare has finished (this is necessary since
% Dynare does a 'clear -all'). Also note that we take care of clearing the
% 'exception' variable in all 'catch' block, because otherwise the next 'load
% wsMat' within a 'catch' block will overwrite the last exception.
% Dynare does a 'clear -all').
% Note that we take care of clearing oo_ before saving the workspace,
% otherwise the newly created oo_ will be scratched upon loading,
% thus making the path comparison bogus.
% We also take care of clearing the 'exception' variable in all 'catch'
% block, because otherwise the next 'load wsMat' within a 'catch' block will
% overwrite the last exception.
top_test_dir
=
getenv
(
'TOP_TEST_DIR'
);
addpath
([
top_test_dir
filesep
'utils'
]);
...
...
@@ -80,6 +84,7 @@ for blockFlag = 0:1
else
try
old_path
=
path
;
clear
oo_
% Ensure that oo_.endo_simul won’t be overwritten when loading wsMat
save
wsMat
run_ls2003
(
blockFlag
,
storageFlag
,
solve_algos
(
i
),
default_stack_solve_algo
)
load
wsMat
...
...
@@ -87,9 +92,9 @@ for blockFlag = 0:1
% Test against the reference simulation path
load
(
'test.mat'
,
'y_ref'
);
diff
=
oo_
.
endo_simul
-
y_ref
;
if
abs
(
diff
)
>
options_
.
dynatol
.
x
if
max
(
max
(
abs
(
diff
)
))
>
options_
.
dynatol
.
x
failedBlock
{
size
(
failedBlock
,
2
)
+
1
}
=
[
'block_bytecode'
filesep
'run_ls2003.m('
num2str
(
blockFlag
)
','
num2str
(
storageFlag
)
','
num2str
(
solve_algos
(
i
))
','
num2str
(
default_stack_solve_algo
)
')'
];
exception
=
MException
(
'ERROR: simulation path differs from the reference path'
);
exception
=
MException
(
'Dynare:simerr'
,
'ERROR: simulation path differs from the reference path'
);
printMakeCheckMatlabErrMsg
([
'block_bytecode'
filesep
'run_ls2003.m('
num2str
(
blockFlag
)
','
num2str
(
storageFlag
)
','
num2str
(
solve_algos
(
i
))
','
num2str
(
default_stack_solve_algo
)
')'
],
exception
);
clear
exception
end
...
...
@@ -106,6 +111,7 @@ for blockFlag = 0:1
num_block_tests
=
num_block_tests
+
1
;
try
old_path
=
path
;
clear
oo_
% Ensure that oo_.endo_simul won’t be overwritten when loading wsMat
save
wsMat
run_ls2003
(
blockFlag
,
storageFlag
,
default_solve_algo
,
stack_solve_algos
(
i
))
load
wsMat
...
...
@@ -113,9 +119,9 @@ for blockFlag = 0:1
% Test against the reference simulation path
load
(
'test.mat'
,
'y_ref'
);
diff
=
oo_
.
endo_simul
-
y_ref
;
if
abs
(
diff
)
>
options_
.
dynatol
.
x
if
max
(
max
(
abs
(
diff
)
))
>
options_
.
dynatol
.
x
failedBlock
{
size
(
failedBlock
,
2
)
+
1
}
=
[
'block_bytecode'
filesep
'run_ls2003.m('
num2str
(
blockFlag
)
','
num2str
(
storageFlag
)
','
num2str
(
default_solve_algo
)
','
num2str
(
stack_solve_algos
(
i
))
')'
];
exception
=
MException
(
'ERROR: simulation path difers from the reference path'
);
exception
=
MException
(
'Dynare:simerr'
,
'ERROR: simulation path difers from the reference path'
);
printMakeCheckMatlabErrMsg
([
'block_bytecode'
filesep
'run_ls2003.m('
num2str
(
blockFlag
)
','
num2str
(
storageFlag
)
','
num2str
(
default_solve_algo
)
','
num2str
(
stack_solve_algos
(
i
))
')'
],
exception
);
clear
exception
end
...
...
This diff is collapsed.
Click to expand it.
tests/run_block_byte_tests_octave.m
+
8
−
3
View file @
e49cada3
...
...
@@ -20,6 +20,9 @@
## Before every call to Dynare, the contents of the workspace is saved in
## 'wsOct', and reloaded after Dynare has finished (this is necessary since
## Dynare does a 'clear -all').
## Note that we take care of clearing oo_ before saving the workspace,
## otherwise the newly created oo_ will be scratched upon loading,
## thus making the path comparison bogus.
top_test_dir = getenv('TOP_TEST_DIR');
addpath([top_test_dir filesep 'utils']);
...
...
@@ -53,7 +56,7 @@ for blockFlag = 0:1
# Workaround for strange race condition related to the static/dynamic
# files (especially when we switch to/from use_dll)
rmdir('+ls2003_tmp', 's')
rmdir('+ls2003_tmp', 's')
;
pause(1)
for i = 1:length(solve_algos)
...
...
@@ -78,6 +81,7 @@ for blockFlag = 0:1
else
try
old_path = path;
clear oo_ # Ensure that oo_.endo_simul won’t be overwritten when loading wsOct
save wsOct
run_ls2003(blockFlag, storageFlag, solve_algos(i), default_stack_solve_algo)
load wsOct
...
...
@@ -85,7 +89,7 @@ for blockFlag = 0:1
## Test against the reference simulation path
load('test.mat','y_ref');
diff = oo_.endo_simul - y_ref;
if abs(diff) > options_.dynatol.x
if
max(max(
abs(diff)
))
> options_.dynatol.x
failedBlock{size(failedBlock,2)+1} = ['block_bytecode' filesep 'run_ls2003.m(' num2str(blockFlag) ',' num2str(storageFlag) ',' num2str(solve_algos(i)) ',' num2str(default_stack_solve_algo) ')'];
differr.message = ["ERROR: simulation path differs from the reference path" ];
printMakeCheckOctaveErrMsg(['block_bytecode' filesep 'run_ls2003.m(' num2str(blockFlag) ',' num2str(storageFlag) ',' num2str(solve_algos(i)) ',' num2str(default_stack_solve_algo) ')'], differr);
...
...
@@ -102,6 +106,7 @@ for blockFlag = 0:1
num_block_tests = num_block_tests + 1;
try
old_path = path;
clear oo_ # Ensure that oo_.endo_simul won’t be overwritten when loading wsOct
save wsOct
run_ls2003(blockFlag, storageFlag, default_solve_algo, stack_solve_algos(i))
load wsOct
...
...
@@ -109,7 +114,7 @@ for blockFlag = 0:1
## Test against the reference simulation path
load('test.mat','y_ref');
diff = oo_.endo_simul - y_ref;
if abs(diff) > options_.dynatol.x
if
max(max(
abs(diff)
))
> options_.dynatol.x
failedBlock{size(failedBlock,2)+1} = ['block_bytecode' filesep 'run_ls2003.m(' num2str(blockFlag) ',' num2str(storageFlag) ',' num2str(default_solve_algo) ',' num2str(stack_solve_algos(i)) ')'];
differr.message = ["ERROR: simulation path differs from the reference path" ];
printMakeCheckOctaveErrMsg(['block_bytecode' filesep 'run_ls2003.m(' num2str(blockFlag) ',' num2str(storageFlag) ',' num2str(default_solve_algo) ',' num2str(stack_solve_algos(i)) ')'], differr);
...
...
This diff is collapsed.
Click to expand it.
Sébastien Villemot
@sebastien
mentioned in commit
feffd7dc
·
3 years ago
mentioned in commit
feffd7dc
mentioned in commit feffd7dc5d2acf0630dfa63260a15ca2d4a6f37f
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment