diff --git a/src/build_report_summary.m b/src/build_report_summary.m index b8a5c43e53d469b9c5f0969889b0d148087a21bb..31a3d4e6f3e472f001570f89cd883a99219be4f2 100644 --- a/src/build_report_summary.m +++ b/src/build_report_summary.m @@ -2,13 +2,13 @@ function str = build_report_summary(reportfile, printonscreen, mailreport) % Builds summary report for the unit tests. % -% INPUTS +% INPUTS % - reportfile [string] Name of the mat files where the unit tests results are stored. % - printonscreen [logical] Report is displayed in the command window if true. % - mailreport [string] Email adress where the report summary is to be sent. % -% OUTPUTS -% - str [string] Report summary. +% OUTPUTS +% - str [string] Report summary. % Copyright (C) 2013-2014 Dynare Team % @@ -20,8 +20,8 @@ function str = build_report_summary(reportfile, printonscreen, mailreport) % (at your option) any later version. % % 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 MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +% but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for % more details. % % You should have received a copy of the GNU General Public License @@ -94,9 +94,9 @@ if mailreport if exist('~/.matlab-send-mail-info','file') fid = fopen('~/.matlab-send-mail-info','r'); else - disp(['build_report_summary:: I Cannot send the report to ' mailto ' because the sender and the smtp server are not defined!']) - disp([' You probably need to add a ''.matlab-send-mail-info'' in your root directory...']) - return + disp(['build_report_summary:: I Cannot send the report to ' mailto ' because the sender and the smtp server are not defined!']) + disp([' You probably need to add a ''.matlab-send-mail-info'' in your root directory...']) + return end setpref('Internet','SMTP_Server',fgetl(fid)); setpref('Internet','SMTP_Username',fgetl(fid)); @@ -107,5 +107,5 @@ if mailreport for i=2:size(str,1) STR = [STR 10 deblank(str(i,:)) ]; end - sendmail(mailto,'Dynare/Matlab unitary tests',STR); + sendmail(mailto,'Dynare/Matlab unitary tests',STR); end \ No newline at end of file diff --git a/src/dassert.m b/src/dassert.m index 43950564288b9ca4517f63e05c544d7e35dff1c9..572123eb2d6a434648e733a2d0e3bf6fbb12d245 100644 --- a/src/dassert.m +++ b/src/dassert.m @@ -12,8 +12,8 @@ function t = dassert(A,B,tol) % (at your option) any later version. % % 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 MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +% but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for % more details. % % You should have received a copy of the GNU General Public License diff --git a/src/dtest.m b/src/dtest.m index de28226e19213d20be24ef312025fa8d6879f960..28624cbd39dac3fdd5c17af15d9675e995db41c9 100644 --- a/src/dtest.m +++ b/src/dtest.m @@ -2,22 +2,22 @@ function dtest(fun, tpath) % Runs unit test defined in fun, by calling mtest routine, and display results. % -% INPUTS +% INPUTS % - fun [string], name of the Matlab routine where unit tests have to be run (with path). % - tpath [string], path to the folder where the test routines generated by mtest should be % temporarly saved. % -% OUTPUTS +% OUTPUTS % None. % -% REMARKS +% 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. % % See also mtest - + % Copyright (C) 2011-2014 Dynare Team % % This file is part of Dynare (m-unit-tests module). @@ -28,8 +28,8 @@ function dtest(fun, tpath) % (at your option) any later version. % % 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 MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +% but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for % more details. % % You should have received a copy of the GNU General Public License diff --git a/src/get_directory_description.m b/src/get_directory_description.m index 5eb253c536bac4756cab900330a3ffdba2f1320b..c5c5328f8b78d532e795e66cf735c8a6e25e8e8e 100644 --- a/src/get_directory_description.m +++ b/src/get_directory_description.m @@ -2,11 +2,11 @@ function flist = get_directory_description(basedir) % Lists recursively all the *.m files in a directory. % -% INPUTS +% INPUTS % - basedir [string], the name of the directory to be inspected. % -% OUTPUTS -% - flist [cell of strings], the files under basedir (and subfolders). +% OUTPUTS +% - flist [cell of strings], the files under basedir (and subfolders). % Copyright (C) 2013-2014 Dynare Team % @@ -18,18 +18,18 @@ function flist = get_directory_description(basedir) % (at your option) any later version. % % 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 MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +% but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for % more details. % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. if ~nargin || isempty(basedir) - % Current directory is the default value of basedir - basedir = '.'; + % Current directory is the default value of basedir + basedir = '.'; end - + dd = dir(basedir); flist = {}; file = 1; @@ -46,6 +46,6 @@ for f=1:length(dd) flist{length(flist)+1} = [basedir filesep dd(f).name]; end end - file = file + 1; + file = file + 1; end end \ No newline at end of file diff --git a/src/initialize_unit_tests_toolbox.m b/src/initialize_unit_tests_toolbox.m index df3db508437fb22393f35fee7d59efc042f6df05..2581d7e12e2b07c973c7db69e9df0cd74eac198c 100644 --- a/src/initialize_unit_tests_toolbox.m +++ b/src/initialize_unit_tests_toolbox.m @@ -1,7 +1,7 @@ % Get the path to the m-unit-tests/src folder. unit_tests_src_root = strrep(which('initialize_unit_tests_toolbox'),'initialize_unit_tests_toolbox.m',''); -if ~exist('isoctave','file') +if ~exist('isoctave','file') addpath([unit_tests_src_root '/missing/isoctave']) end diff --git a/src/is_unitary_test_available.m b/src/is_unitary_test_available.m index c8a3320695968dacb78fed729c4bc886694e29e4..f7a877298dde35a87fb708520c82beffd4d3e6e8 100644 --- a/src/is_unitary_test_available.m +++ b/src/is_unitary_test_available.m @@ -3,10 +3,10 @@ function info = is_unitary_test_available(fun) % Decides if unitary tests defined in a matlab routine (file) have to be run % by checking the content of the first line. % -% INPUTS +% INPUTS % - fun [string], name of the routine (with full relative path) % -% OUTPUTS +% OUTPUTS % - info [integer], scalar equal to 1 if unitary tests must be run, 0 otherwise. % Copyright (C) 2013-2014 Dynare Team @@ -19,13 +19,13 @@ function info = is_unitary_test_available(fun) % (at your option) any later version. % % 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 MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +% but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for % more details. % % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. - + info = 0; fid = fopen(fun,'r'); diff --git a/src/missing/isoctave/isoctave.m b/src/missing/isoctave/isoctave.m index 5d5273fbbf4541e5474c762670f55622acbf0583..4ea6d3f3293bf1da2ead78f2ec06a4b3d04c2e6c 100644 --- a/src/missing/isoctave/isoctave.m +++ b/src/missing/isoctave/isoctave.m @@ -1,7 +1,7 @@ function l = isoctave() % Tests if Octave is used. - + % Copyright (C) 2013-2014 Dynare Team % % This code is free software: you can redistribute it and/or modify diff --git a/src/missing/skipline/skipline.m b/src/missing/skipline/skipline.m index 5b311ab937d912f690dc50ede578e3855e6dda4b..53438aa11b7dd1485758d02cc3629c3b2673097d 100644 --- a/src/missing/skipline/skipline.m +++ b/src/missing/skipline/skipline.m @@ -1,12 +1,12 @@ function skipline(n, fid) % This function prints n newlines to fid % -% INPUTS +% INPUTS % % n [integer] Number of newlines to print % fid [integer] file id returned by fopen -% -% OUTPUTS +% +% OUTPUTS % None % @@ -25,7 +25,7 @@ function skipline(n, fid) % GNU General Public License for more details. % % 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/>. if nargin < 2 fid = 1; diff --git a/src/mtest.m b/src/mtest.m index 30255295d667e67a44da7b3f260509df471a813e..e000d2ff68bf18f0b0bd289209cee9cf261fa203 100644 --- a/src/mtest.m +++ b/src/mtest.m @@ -2,11 +2,11 @@ function [check, info] = mtest(fname, fpath) % Extracts unit test sections from matlab's routine, executes the tests and reports results. % -% INPUTS +% INPUTS % - fname [string], name of the Matlab routine where unit tests have to be run. % * fpath [string], path to the routine % -% OUTPUTS +% 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 @@ -18,7 +18,7 @@ function [check, info] = mtest(fname, fpath) % Column 4 Details about the failure (vector of 0 and 1). % Column 5 Elapsed time in seconds. % -% REMARKS +% 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 @@ -34,8 +34,8 @@ function [check, info] = mtest(fname, fpath) % (at your option) any later version. % % 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 MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +% but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for % more details. % % You should have received a copy of the GNU General Public License @@ -161,6 +161,6 @@ end function file = append_extension_if_needed(file) - if ~isequal(file(end-1:end),'.m') - file = [file '.m']; - end \ No newline at end of file +if ~isequal(file(end-1:end),'.m') + file = [file '.m']; +end \ No newline at end of file diff --git a/src/run_unitary_tests.m b/src/run_unitary_tests.m index e61c7d6a356ed8fee137e505360e60729a3b7829..c404e18ab44db2050a465e8c8326a241d60a41fb 100644 --- a/src/run_unitary_tests.m +++ b/src/run_unitary_tests.m @@ -2,11 +2,11 @@ function [report, time] = run_unitary_tests(listoffiles) % Runs unitary tests defined in a collection of files. % -% INPUTS +% INPUTS % - listoffiles [cell], The list of m files (with path) where the unitary tests are written. % This cell, with n elements, is the output of get_directory_description routine. % -% OUTPUTS +% OUTPUTS % - report [cell], Results of the unitary tests (n rows and 5 columns). Each row stores % the second output argument of mtest routine (info). % - time [double], Current date and time as date vector. diff --git a/src/run_unitary_tests_in_directory.m b/src/run_unitary_tests_in_directory.m index 49d4102db8ac2fa905cb608db6993b50023251db..0d88f1ae4839308fb65bb696462854161e18c17b 100644 --- a/src/run_unitary_tests_in_directory.m +++ b/src/run_unitary_tests_in_directory.m @@ -2,16 +2,16 @@ function report = run_unitary_tests_in_directory(dirname, savereport, printrepor % Runs all the unitary tests defined in a directory (and subfolders). % -% INPUTS +% INPUTS % - dirname [string], name of the directory where % - savereport [integer], scalar equal to 0 or 1. If equal to 1 the report is saved in a mat file. % - printreport [integer], scalar equal to 0 or 1. If equal to 1 the report is printed on screen. % - sendreport [integer], scalar equal to 0 or 1. If equal to 1 the report is sent by email. % -% OUTPUTS +% OUTPUTS % - report [cell], first output argument of run_unitary_test routine. % -% REMARKS +% REMARKS % 1. Git needs to be available on the system and it is assumed that the content of dirname is versionned with Git. % % See also get_directory_description, run_unitary_tests, build_report_summary