Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Dynare/dseries
  • sebastien/dseries
  • houtanb/dseries
  • wmutschl/dseries
  • DoraK/dseries
  • JohannesPfeifer/dseries
6 results
Show changes
Commits on Source (89)
variables:
GIT_SUBMODULE_STRATEGY: normal
TERM: linux
MATLAB_VERSION: R2021b
OLD_MATLAB_VERSION: R2014a
OCTAVE_VERSION: 6.4.0
MATLAB_VERSION: R2024b
OLD_MATLAB_VERSION: R2018b
# To ensure that "false && true" fails, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/25394#note_412609647
FF_ENABLE_BASH_EXIT_CODE_CHECK: 'true'
before_script:
- git clone https://git.dynare.org/Dynare/m-unit-tests
......@@ -11,16 +12,16 @@ before_script:
test_matlab:
stage: test
script:
- make check-matlab MATLAB=/usr/local/MATLAB/$MATLAB_VERSION/bin/matlab
- make check-matlab MATLAB=/opt/MATLAB/$MATLAB_VERSION/bin/matlab
test_old_matlab:
stage: test
script:
- make check-matlab MATLAB=/usr/local/MATLAB/$OLD_MATLAB_VERSION/bin/matlab
- make check-matlab MATLAB=/opt/MATLAB/$OLD_MATLAB_VERSION/bin/matlab
test_octave:
stage: test
variables:
OPENBLAS_NUM_THREADS: 1
script:
- make check-octave OCTAVE=/usr/local/octave/$OCTAVE_VERSION/bin/octave
- make check-octave
> Copyright (C) 2014-2018 Dynare Team
> Copyright © 2014-2018 Dynare Team
>
> The dseries and dates MATLAB/Octave classes are licensed under GNU GPL as published by
> the Free Software Foundation, either version 3 of the License, or (at
......
......@@ -11,7 +11,7 @@ check-octave: m-unit-tests/src/mtest.m
$(OCTAVE) --no-init-file --silent --no-history --eval "addpath([pwd() '/../m-unit-tests/src']); runalltests" && [ ! -f ./failed ] && [ -f ./pass ]
check-matlab: m-unit-tests/src/mtest.m
@$(MATLAB) -nosplash -nodisplay -r "addpath([pwd '/m-unit-tests/src']); cd tests; runalltests; quit" && [ ! -f ./tests/failed ] && [ -f ./tests/pass ]
@$(MATLAB) -batch "addpath([pwd '/m-unit-tests/src']); cd tests; runalltests; quit" && [ ! -f ./tests/failed ] && [ -f ./tests/pass ]
check-clean:
rm -f tests/*_test_*.m tests/*.csv tests/*.xls tests/*.xlsx tests/*.mat tests/failed tests/datafile_for_test
......
classdef arima<handle % --*-- Unitary tests --*--
classdef arima<handle
% Class for ARIMA models (interface to X13).
% Copyright (C) 2017-2022 Dynare Team
% Copyright © 2017-2023 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -151,7 +151,7 @@ methods
end
end % arima
end % methods
end % classdef
end % classdef --*-- Unit tests --*--
%@test:1
%$ try
......
......@@ -73,7 +73,7 @@ fprintf(fid, '}\n');
fclose(fid);
% Run estimation of the ARIMA model
[status, result] = system(sprintf('%s %s', select_x13_binary(), basefilename));
system(sprintf('%s %s', select_x13_binary(), basefilename));
% Get the content of the generated *.est file
fid = fopen(sprintf('%s.est', basefilename), 'r');
......
function o = append(o, d) % --*-- Unitary tests --*--
function o = append(o, d)
% append method for dates class.
%
......@@ -9,7 +9,7 @@ function o = append(o, d) % --*-- Unitary tests --*--
% OUTPUTS
% - o [dates] containing dates defined in o and d.
% Copyright © 2012-2021 Dynare Team
% Copyright © 2012-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -42,7 +42,7 @@ end
o = copy(o);
o.append_(d);
return
return % --*-- Unit tests --*--
%@test:1
% Define some dates
......
function o = append_(o, d) % --*-- Unitary tests --*--
function o = append_(o, d)
% append method for dates class (in place modification).
%
......@@ -9,7 +9,7 @@ function o = append_(o, d) % --*-- Unitary tests --*--
% OUTPUTS
% - o [dates] dates object containing dates defined in o and d.
% Copyright © 2012-2021 Dynare Team
% Copyright © 2012-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -41,7 +41,7 @@ end
o.time = [o.time; d.time];
return
return % --*-- Unit tests --*--
%@test:1
% Define some dates
......
function s = char(o) % --*-- Unitary tests --*--
function s = char(o)
% Given a one element dates object, returns a string with the formatted date.
%
......@@ -8,7 +8,7 @@ function s = char(o) % --*-- Unitary tests --*--
% OUTPUTS
% - s [string]
% Copyright © 2014-2021 Dynare Team
% Copyright © 2014-2023 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -29,7 +29,7 @@ end
s = date2string(o.time, o.freq);
return
return % --*-- Unit tests --*--
%@test:1
% Define a dates object
......
function q = colon(varargin) % --*-- Unitary tests --*--
function q = colon(varargin)
% Overloads the colon operator (:). This method can be used to create ranges of dates.
%
......@@ -14,7 +14,7 @@ function q = colon(varargin) % --*-- Unitary tests --*--
% 1. p must be greater than o if d>0.
% 2. p and q are dates objects with one element.
% Copyright © 2013-2021 Dynare Team
% Copyright © 2013-2023 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -72,7 +72,7 @@ q.freq = o.freq;
% Set time
q.time = transpose(o.time:d:p.time);
return
return % --*-- Unit tests --*--
%@test:1
% Define two dates
......@@ -172,4 +172,4 @@ d = dd(1950, 01, 28):dd(1950, 01, 30);
t(1) = isequal(d.time(:,1), e.time(:,1));
t(2) = isequal(d.freq, e.freq);
T = all(t);
%@eof:6
\ No newline at end of file
%@eof:6
function p = copy(o) % --*-- Unitary tests --*--
function p = copy(o)
% Do a copy of a dates object.
%
......@@ -8,7 +8,7 @@ function p = copy(o) % --*-- Unitary tests --*--
% OUTPUTS
% - p [dates]
% Copyright © 2014-2020 Dynare Team
% Copyright © 2014-2023 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -27,7 +27,7 @@ p = dates();
p.freq = o.freq;
p.time = o.time;
return
return % --*-- Unit tests --*--
%@test:1
% Define a dates object
......@@ -48,4 +48,4 @@ if t(1)
end
T = all(t);
%@eof:1
\ No newline at end of file
%@eof:1
classdef dates<handle % --*-- Unitary tests --*--
classdef dates<handle
% Copyright (C) 2014-2021 Dynare Team
% Copyright © 2014-2023 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -193,8 +193,7 @@ methods
n = ndat(o);
n = length(o);
end % methods
end % classdef
end % classdef --*-- Unit tests --*--
%@test:1
%$ % Define some dates
......@@ -378,4 +377,4 @@ end % classdef
%$ end
%$
%$ T = all(t);
%@eof:10
\ No newline at end of file
%@eof:10
......@@ -8,7 +8,7 @@ function disp(o)
% OUTPTS
% None
% Copyright (C) 2013-2017 Dynare Team
% Copyright © 2013-2017 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......
......@@ -8,7 +8,7 @@ function display(o)
% OUTPTS
% None
% Copyright (C) 2013-2017 Dynare Team
% Copyright © 2013-2017 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......
function [m, f] = double(o) % --*-- Unitary tests --*--
function [m, f] = double(o)
% Returns a vector of doubles with the fractional part corresponding
% to the subperiod. Used for plots and to store dates in a matrix.
......@@ -13,7 +13,7 @@ function [m, f] = double(o) % --*-- Unitary tests --*--
% REMARKS
% Obviously the frequency is lost during the conversion.
% Copyright © 2013-2021 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -45,7 +45,7 @@ if nargout>1
f = o.freq;
end
return
return % --*-- Unit tests --*--
%@test:1
% Define a dates object
......
function lastIndex = end(o, k, n) % --*-- Unitary tests --*--
function lastIndex = end(o, k, n)
% Overloads end keyword.
%
......@@ -10,7 +10,7 @@ function lastIndex = end(o, k, n) % --*-- Unitary tests --*--
% OUTPUTS
% lastIndex [integer] last dates index
% Copyright © 2013-2021 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -28,7 +28,7 @@ function lastIndex = end(o, k, n) % --*-- Unitary tests --*--
assert(k==1 && n==1, 'dates:end:ArgCheck', 'dates only has one dimension');
lastIndex = o.ndat();
return
return % --*-- Unit tests --*--
%@test:1
% Define a dates object
......
function l = eq(varargin) % --*-- Unitary tests --*--
function l = eq(varargin)
% Overloads == operator for dates objects.
%
......@@ -9,7 +9,7 @@ function l = eq(varargin) % --*-- Unitary tests --*--
% OUTPUTS
% - l [logical] column vector of max(n,1) elements (zeros or ones).
% Copyright © 2013-2020 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -37,7 +37,7 @@ else
l = bsxfun(@eq,o.time(:,1),p.time(:,1));
end
return
return % --*-- Unit tests --*--
%@test:1
% Define some dates objects
......@@ -134,4 +134,4 @@ if t(1)
end
T = all(t);
%@eof:4
\ No newline at end of file
%@eof:4
function l = ge(varargin) % --*-- Unitary tests --*--
function l = ge(varargin)
% Overloads the >= operator for dates objects.
%
......@@ -9,7 +9,7 @@ function l = ge(varargin) % --*-- Unitary tests --*--
% OUTPUTS
% - l [logical] column vector of max(n,1) elements (zeros or ones).
% Copyright © 2013-2021 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -28,7 +28,7 @@ function l = ge(varargin) % --*-- Unitary tests --*--
l = o.time>=p.time;
return
return % --*-- Unit tests --*--
%@test:1
% Define some dates
......
function l = gt(varargin) % --*-- Unitary tests --*--
function l = gt(varargin)
% Overloads the > operator for dates objects.
%
......@@ -9,7 +9,7 @@ function l = gt(varargin) % --*-- Unitary tests --*--
% OUTPUTS
% - l [logical] column vector of max(n,1) elements (zeros or ones).
% Copyright © 2013-2021 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -28,7 +28,7 @@ function l = gt(varargin) % --*-- Unitary tests --*--
l = o.time>p.time;
return
return % --*-- Unit tests --*--
%@test:1
% Define some dates
......
function o = horzcat(varargin) % --*-- Unitary tests --*--
function o = horzcat(varargin)
% Overloads the horzcat method for dates objects.
%
......@@ -8,7 +8,7 @@ function o = horzcat(varargin) % --*-- Unitary tests --*--
% OUTPUTS
% - o [dates] object containing dates defined in varargin{:}
% Copyright (C) 2013-2021 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -43,7 +43,7 @@ for i=2:nargin
end
end
return
return % --*-- Unit tests --*--
%@test:1
% Define some dates
......@@ -165,4 +165,4 @@ if t(1)
end
T = all(t);
%@eof:6
\ No newline at end of file
%@eof:6
function q = intersect(o, p) % --*-- Unitary tests --*--
function q = intersect(o, p)
% Overloads intersect function for dates objects.
%
......@@ -9,7 +9,7 @@ function q = intersect(o, p) % --*-- Unitary tests --*--
% OUTPUTS
% - q [dates] All the common elements in o and p.
% Copyright © 2013-2021 Dynare Team
% Copyright © 2013-2022 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -48,7 +48,7 @@ end
q.freq = o.freq;
q.time = time;
return
return % --*-- Unit tests --*--
%@test:1
% Define some dates objects
......