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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
dynare
Commits
5f3d56c3
Commit
5f3d56c3
authored
Dec 9, 2013
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Add unitary tests to testsuite
parent
b840af9f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/Makefile.am
+2
-2
2 additions, 2 deletions
tests/Makefile.am
tests/run_unitary_tests.m
+47
-0
47 additions, 0 deletions
tests/run_unitary_tests.m
with
49 additions
and
2 deletions
tests/Makefile.am
+
2
−
2
View file @
5f3d56c3
...
@@ -237,12 +237,12 @@ dsge-var/dsgevar_forward_estimated_lambda.o.trs: dsge-var/simul_hybrid.o.trs
...
@@ -237,12 +237,12 @@ dsge-var/dsgevar_forward_estimated_lambda.o.trs: dsge-var/simul_hybrid.o.trs
# Matlab TRS Files
# Matlab TRS Files
M_TRS_FILES
=
$(
patsubst %.mod, %.m.trs,
$(
MODFILES
))
M_TRS_FILES
=
$(
patsubst %.mod, %.m.trs,
$(
MODFILES
))
M_TRS_FILES
+=
run_block_byte_tests_matlab.m.trs run_reporting_test_matlab.m.trs
M_TRS_FILES
+=
run_block_byte_tests_matlab.m.trs run_reporting_test_matlab.m.trs
run_unitary_tests.m.trs
M_XFAIL_TRS_FILES
=
$(
patsubst %.mod, %.m.trs,
$(
XFAIL_MODFILES
))
M_XFAIL_TRS_FILES
=
$(
patsubst %.mod, %.m.trs,
$(
XFAIL_MODFILES
))
# Octave TRS Files
# Octave TRS Files
O_TRS_FILES
=
$(
patsubst %.mod, %.o.trs,
$(
MODFILES
))
O_TRS_FILES
=
$(
patsubst %.mod, %.o.trs,
$(
MODFILES
))
O_TRS_FILES
+=
run_block_byte_tests_octave.o.trs run_reporting_test_octave.o.trs
O_TRS_FILES
+=
run_block_byte_tests_octave.o.trs run_reporting_test_octave.o.trs
run_unitary_tests.o.trs
O_XFAIL_TRS_FILES
=
$(
patsubst %.mod, %.o.trs,
$(
XFAIL_MODFILES
))
O_XFAIL_TRS_FILES
=
$(
patsubst %.mod, %.o.trs,
$(
XFAIL_MODFILES
))
EXTRA_DIST
=
\
EXTRA_DIST
=
\
...
...
This diff is collapsed.
Click to expand it.
tests/run_unitary_tests.m
0 → 100644
+
47
−
0
View file @
5f3d56c3
top_test_dir
=
getenv
(
'TOP_TEST_DIR'
);
addpath
(
top_test_dir
);
addpath
([
top_test_dir
filesep
'..'
filesep
'matlab'
]);
dynare_config
([],
0
);
% Test Dynare Version
if
~
strcmp
(
dynare_version
(),
getenv
(
'DYNARE_VERSION'
))
error
(
'Incorrect version of Dynare is being tested'
)
end
mlist
=
get_directory_description
(
'../matlab'
);
failedtests
=
{};
counter
=
0
;
for
i
=
1
:
length
(
mlist
)
f
=
[
top_test_dir
filesep
mlist
{
i
}
];
if
is_unitary_test_available
(
f
)
[
check
,
info
]
=
mtest
(
f
);
for
j
=
1
:
size
(
info
,
1
)
counter
=
counter
+
1
;
if
~
info
{
j
,
3
}
failedtests
{
length
(
failedtests
)
+
1
}
=
[
mlist
{
i
}
'#'
num2str
(
info
{
j
,
2
})
];
end
end
end
end
cd
(
getenv
(
'TOP_TEST_DIR'
));
if
isoctave
fid
=
fopen
(
'run_unitary_tests.o.trs'
,
'w+'
);
else
fid
=
fopen
(
'run_unitary_tests.m.trs'
,
'w+'
);
end
if
length
(
failedtests
)
>
0
fprintf
(
fid
,
':test-result: FAIL\n'
);
fprintf
(
fid
,
':number-tests: %d\n'
,
counter
);
fprintf
(
fid
,
':number-failed-tests: %d\n'
,
length
(
failedtests
));
fprintf
(
fid
,
':list-of-failed-tests: %s\n'
,
failedtests
{:});
else
fprintf
(
fid
,
':test-result: PASS\n'
);
fprintf
(
fid
,
':number-tests: %d\n'
,
counter
);
fprintf
(
fid
,
':number-failed-tests: 0\n'
);
end
fclose
(
fid
);
exit
This diff is collapsed.
Click to expand it.
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