Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
5f3d56c3
Commit
5f3d56c3
authored
Dec 09, 2013
by
Sébastien Villemot
Browse files
Add unitary tests to testsuite
parent
b840af9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/Makefile.am
View file @
5f3d56c3
...
...
@@ -237,12 +237,12 @@ dsge-var/dsgevar_forward_estimated_lambda.o.trs: dsge-var/simul_hybrid.o.trs
# Matlab TRS Files
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)
)
# Octave TRS Files
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)
)
EXTRA_DIST
=
\
...
...
tests/run_unitary_tests.m
0 → 100644
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
Write
Preview
Supports
Markdown
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