From 85522bfa3d5f5d37d9874241428b423e3c9c5145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= <stephane.adjemian@univ-lemans.fr> Date: Fri, 19 May 2017 08:39:18 +0200 Subject: [PATCH] Fixed indentation. --- src/build_report_summary.m | 18 +++++++++--------- src/dassert.m | 4 ++-- src/dtest.m | 12 ++++++------ src/get_directory_description.m | 18 +++++++++--------- src/initialize_unit_tests_toolbox.m | 2 +- src/is_unitary_test_available.m | 10 +++++----- src/missing/isoctave/isoctave.m | 2 +- src/missing/skipline/skipline.m | 8 ++++---- src/mtest.m | 16 ++++++++-------- src/run_unitary_tests.m | 4 ++-- src/run_unitary_tests_in_directory.m | 6 +++--- 11 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/build_report_summary.m b/src/build_report_summary.m index b8a5c43..31a3d4e 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 4395056..572123e 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 de28226..28624cb 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 5eb253c..c5c5328 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 df3db50..2581d7e 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 c8a3320..f7a8772 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 5d5273f..4ea6d3f 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 5b311ab..53438aa 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 3025529..e000d2f 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 e61c7d6..c404e18 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 49d4102..0d88f1a 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 -- GitLab