Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
m-unit-tests
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
m-unit-tests
Commits
72eb484f
Commit
72eb484f
authored
10 years ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Fixed header.
parent
9e8a6560
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mtest.m
+29
-14
29 additions, 14 deletions
src/mtest.m
with
29 additions
and
14 deletions
src/mtest.m
+
29
−
14
View file @
72eb484f
function
[
check
,
info
]
=
mtest
(
fname
,
fpath
)
function
[
check
,
info
]
=
mtest
(
fname
,
fpath
)
% Extract test sections from matlab's routine executes the test and report errors.
% Extracts unit test sections from matlab's routine, executes the tests and reports results.
%
% INPUTS
% - fname [string], name of the Matlab routine where unit tests have to be run.
% * fpath [string], path to the routine
%
% OUTPUTS
% - check [integer], scalar equal to 0 if the test fails and 0 otherwise
% - info [cell], a cell describing the test results. Cell info has nn rows and
% five columns. Each row correponds to a unitary test in fname, and the
% columns report the following informations:
%
% Column 1 Name of the tested routine.
% Column 2 Number of the unitary test.
% Column 3 Status of the unitary test (0 if the unitary test fails, 1 otherwise).
% Column 4 Details about the failure (vector of 0 and 1).
% Column 5 Elapsed time in seconds (cpu time).
%
% REMARKS
% - If only one input argument is provided, fname must be a string containing the
% full path to the targeted matlab routine.
% - If two input arguments are provided, fname is the base name of the targeted
% matlab routine and fpath is the path to this routine.
% Copyright (C) 201
1
-201
3
Dynare Team
% Copyright (C) 201
3
-201
4
Dynare Team
%
%
% This file is part of Dynare.
% This file is part of Dynare
(m-unit-tests module)
.
%
%
% Dynare is free software: you can redistribute it and/or modify
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
% (at your option) any later version.
%
%
% Dynare is distributed in the hope that it will be useful,
% Dynare
's m-unit-tests module
is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY
%
MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the
% or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for
%
GNU General Public License for
more details.
% more details.
%
%
% You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% Original author: stephane DOT adjemian AT univ DASH lemans DOT fr
% Default answer (no problem).
% Default answer (no problem).
check
=
1
;
check
=
1
;
...
@@ -54,11 +74,6 @@ end
...
@@ -54,11 +74,6 @@ end
% Initialize the second output if necessary.
% Initialize the second output if necessary.
if
nargout
>
1
if
nargout
>
1
% First column name of the tested routine.
% Second column number of the unitary test.
% Third column status of the unitary test (0 if the test fails, 1 otherwise)
% Fourth column details about the failure (vector of integers)
% Fifth column elapsed time in seconds (cpu time).
info
=
cell
(
nn
,
5
);
info
=
cell
(
nn
,
5
);
end
end
...
...
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