


@info:
! @deftypefn {Function File} dynTest (@var{fun})
! @anchor{dynTest}
! @sp 1
! Tests matlab/octave routine @var{fun}.m.
! @sp 2
!
! @strong{Inputs}
! @sp 1
! @table @ @var
! @item fun
! string, name of the matlab/octave routine to be tested.
! @end table
! @sp 2
!
! @strong{Outputs}
! @sp 1
! None
! @sp 2
!
! @strong{This function is called by:}
! @sp 1
! @ref{internals}, @ref{mroutines}
! @sp 2
!
! @strong{This function calls:}
! @sp 1
! @ref{mtest}
!
! @end deftypefn
@eod:

0001 function dynTest(fun,dynare_path) 0002 0003 %@info: 0004 %! @deftypefn {Function File} dynTest (@var{fun}) 0005 %! @anchor{dynTest} 0006 %! @sp 1 0007 %! Tests matlab/octave routine @var{fun}.m. 0008 %! @sp 2 0009 %! 0010 %! @strong{Inputs} 0011 %! @sp 1 0012 %! @table @ @var 0013 %! @item fun 0014 %! string, name of the matlab/octave routine to be tested. 0015 %! @end table 0016 %! @sp 2 0017 %! 0018 %! @strong{Outputs} 0019 %! @sp 1 0020 %! None 0021 %! @sp 2 0022 %! 0023 %! @strong{This function is called by:} 0024 %! @sp 1 0025 %! @ref{internals}, @ref{mroutines} 0026 %! @sp 2 0027 %! 0028 %! @strong{This function calls:} 0029 %! @sp 1 0030 %! @ref{mtest} 0031 %! 0032 %! @end deftypefn 0033 %@eod: 0034 0035 % Copyright (C) 2011 Dynare Team 0036 % stephane DOT adjemian AT univ DASH lemans DOT fr 0037 % 0038 % This file is part of Dynare. 0039 % 0040 % Dynare is free software: you can redistribute it and/or modify 0041 % it under the terms of the GNU General Public License as published by 0042 % the Free Software Foundation, either version 3 of the License, or 0043 % (at your option) any later version. 0044 % 0045 % Dynare is distributed in the hope that it will be useful, 0046 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0047 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0048 % GNU General Public License for more details. 0049 % 0050 % You should have received a copy of the GNU General Public License 0051 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0052 0053 original_directory = pwd(); 0054 0055 [pathstr1, name1, ext1] = fileparts(fun); 0056 0057 pathstr1 = [original_directory filesep pathstr1]; 0058 0059 cd([dynare_path filesep '..' filesep 'tests']); 0060 0061 mex_flag = 0; 0062 if exist(name1)==3 0063 mex_flag = 1; 0064 end 0065 0066 class_flag = 0; 0067 if ~isempty(strfind(fun,'@')) || ~isempty(strfind(which(name1),'@')) 0068 class_flag = 1; 0069 end 0070 0071 check = mtest(name1,pathstr1); 0072 0073 if check 0074 if mex_flag 0075 disp(['Succesfull test(s) for ' name1 ' mex file!']) 0076 elseif class_flag 0077 disp(['Succesfull test(s) for ' name1 ' method!']) 0078 else 0079 disp(['Succesfull test(s) for ' name1 ' routine!']) 0080 end 0081 end 0082 0083 cd(original_directory);