Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dynare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MichelJuillard
dynare
Commits
a9839333
Commit
a9839333
authored
Nov 17, 2011
by
Sébastien Villemot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testsuite: better isolation between tests
Restore the path and add an extra clear all between tests
parent
4a33af5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
tests/run_test_matlab.m
tests/run_test_matlab.m
+20
-0
tests/run_test_octave.m
tests/run_test_octave.m
+20
-0
No files found.
tests/run_test_matlab.m
View file @
a9839333
...
...
@@ -46,11 +46,16 @@ while ~isempty(name)
disp
(
''
);
disp
([
'*** TESTING: '
modfile
' ***'
]);
try
old_path
=
path
;
save
wsMat
dynare
([
testfile
ext
],
'console'
)
clear
-
all
load
wsMat
path
(
old_path
);
catch
exception
clear
-
all
load
wsMat
path
(
old_path
);
failedBase
{
size
(
failedBase
,
2
)
+
1
}
=
modfile
;
printMakeCheckMatlabErrMsg
(
modfile
,
exception
);
clear
exception
...
...
@@ -90,22 +95,30 @@ for blockFlag = 0:1
% This is the reference simulation path against which all
% other simulations will be tested
try
old_path
=
path
;
save
wsMat
run_ls2003
(
blockFlag
,
bytecodeFlag
,
solve_algos
(
i
),
default_stack_solve_algo
)
clear
-
all
load
wsMat
path
(
old_path
);
y_ref
=
oo_
.
endo_simul
;
save
(
'test.mat'
,
'y_ref'
);
catch
exception
clear
-
all
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
)
')'
];
printMakeCheckMatlabErrMsg
([
'block_bytecode/run_ls2003.m('
num2str
(
blockFlag
)
', '
num2str
(
bytecodeFlag
)
', '
num2str
(
solve_algos
(
i
))
', '
num2str
(
default_stack_solve_algo
)
')'
],
exception
);
clear
exception
end
else
try
old_path
=
path
;
save
wsMat
run_ls2003
(
blockFlag
,
bytecodeFlag
,
solve_algos
(
i
),
default_stack_solve_algo
)
clear
-
all
load
wsMat
path
(
old_path
);
% Test against the reference simulation path
load
(
'test.mat'
,
'y_ref'
);
diff
=
oo_
.
endo_simul
-
y_ref
;
...
...
@@ -116,7 +129,9 @@ for blockFlag = 0:1
clear
exception
end
catch
exception
clear
-
all
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
)
')'
];
printMakeCheckMatlabErrMsg
([
'block_bytecode/run_ls2003.m('
num2str
(
blockFlag
)
', '
num2str
(
bytecodeFlag
)
', '
num2str
(
solve_algos
(
i
))
', '
num2str
(
default_stack_solve_algo
)
')'
],
exception
);
clear
exception
...
...
@@ -126,9 +141,12 @@ for blockFlag = 0:1
for
i
=
1
:
length
(
stack_solve_algos
)
num_block_tests
=
num_block_tests
+
1
;
try
old_path
=
path
;
save
wsMat
run_ls2003
(
blockFlag
,
bytecodeFlag
,
default_solve_algo
,
stack_solve_algos
(
i
))
clear
-
all
load
wsMat
path
(
old_path
);
% Test against the reference simulation path
load
(
'test.mat'
,
'y_ref'
);
diff
=
oo_
.
endo_simul
-
y_ref
;
...
...
@@ -139,7 +157,9 @@ for blockFlag = 0:1
clear
exception
end
catch
exception
clear
-
all
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
)
')'
];
printMakeCheckMatlabErrMsg
([
'block_bytecode/run_ls2003.m('
num2str
(
blockFlag
)
', '
num2str
(
bytecodeFlag
)
', '
num2str
(
solve_algos
(
i
))
', '
num2str
(
default_stack_solve_algo
)
')'
],
exception
);
clear
exception
...
...
tests/run_test_octave.m
View file @
a9839333
...
...
@@ -45,11 +45,16 @@ for i=1:size(name,2)
cd
(
directory
);
printf
(
"\n*** TESTING: %s ***\n"
,
name
{
i
});
try
old_path
=
path
;
save
wsOct
dynare
([
testfile
ext
])
clear
-
all
load
wsOct
path
(
old_path
);
catch
clear
-
all
load
wsOct
path
(
old_path
);
failedBase
{
size
(
failedBase
,
2
)
+
1
}
=
name
{
i
};
printMakeCheckOctaveErrMsg
(
name
{
i
},
lasterror
);
end_try_catch
...
...
@@ -85,21 +90,29 @@ for blockFlag = 0:1
##
This
is
the
reference
simulation
path
against
which
all
##
other
simulations
will
be
tested
try
old_path
=
path
;
save
wsOct
run_ls2003
(
blockFlag
,
bytecodeFlag
,
solve_algos
(
i
),
default_stack_solve_algo
)
clear
-
all
load
wsOct
path
(
old_path
);
y_ref
=
oo_
.
endo_simul
;
save
(
'test.mat'
,
'y_ref'
);
catch
clear
-
all
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
)
')'
];
printMakeCheckOctaveErrMsg
([
'block_bytecode/run_ls2003.m('
num2str
(
blockFlag
)
', '
num2str
(
bytecodeFlag
)
', '
num2str
(
solve_algos
(
i
))
', '
num2str
(
default_stack_solve_algo
)
')'
],
lasterror
);
end_try_catch
else
try
old_path
=
path
;
save
wsOct
run_ls2003
(
blockFlag
,
bytecodeFlag
,
solve_algos
(
i
),
default_stack_solve_algo
)
clear
-
all
load
wsOct
path
(
old_path
);
##
Test
against
the
reference
simulation
path
load
(
'test.mat'
,
'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
);
endif
catch
clear
-
all
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
)
')'
];
printMakeCheckOctaveErrMsg
([
'block_bytecode/run_ls2003.m('
num2str
(
blockFlag
)
', '
num2str
(
bytecodeFlag
)
', '
num2str
(
solve_algos
(
i
))
', '
num2str
(
default_stack_solve_algo
)
')'
],
lasterror
);
end_try_catch
...
...
@@ -118,9 +133,12 @@ for blockFlag = 0:1
for
i
=
1
:
length
(
stack_solve_algos
)
num_block_tests
=
num_block_tests
+
1
;
try
old_path
=
path
;
save
wsOct
run_ls2003
(
blockFlag
,
bytecodeFlag
,
default_solve_algo
,
stack_solve_algos
(
i
))
clear
-
all
load
wsOct
path
(
old_path
);
##
Test
against
the
reference
simulation
path
load
(
'test.mat'
,
'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
);
endif
catch
clear
-
all
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
)
')'
];
printMakeCheckOctaveErrMsg
([
'block_bytecode/run_ls2003.m('
num2str
(
blockFlag
)
', '
num2str
(
bytecodeFlag
)
', '
num2str
(
solve_algos
(
i
))
', '
num2str
(
default_stack_solve_algo
)
')'
],
lasterror
);
end_try_catch
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment