Added gitlab-ci configuration file.

Also removed automatic installation of dependencies (done in gitlab-ci
pipeline instead).
parent b9e15931
variables:
GIT_SUBMODULE_STRATEGY: normal
TERM: linux
before_script:
- git clone https://git.dynare.org/Dynare/m-unit-tests
testsuite_matlab:
stage: test
script:
- make check-matlab
- ./success.sh
testsuite_octave:
stage: test
variables:
OPENBLAS_NUM_THREADS: 1
script:
- cp -r binaries/linux externals/x13
- ./success.sh
......@@ -5,7 +5,10 @@ all: check-octave check-matlab
check-octave:
@cd tests ;\
$(OCTAVE) --no-init-file --silent --no-history runalltests.m
$(OCTAVE) --no-init-file --silent --no-history --eval "addpath ../m-unit-tests/src; runalltests"
check-matlab:
@$(MATLAB) -nosplash -nodisplay -r "cd tests; runalltests; quit"
@$(MATLAB) -nosplash -nodisplay -r "addpath m-unit-tests/src; cd tests; runalltests; quit"
check-clean:
rm -f tests/*_test_*.m tests/*.csv tests/*.xls tests/*.xlsx tests/*.mat tests/failed tests/datafile_for_test
[![pipeline status](https://git.dynare.org/Dynare/dates/badges/master/pipeline.svg)](https://git.dynare.org/Dynare/dates/commits/master)
#!/bin/sh
if [ -f ./tests/failed ]
then
exit 1
#!/bin/bash
if [[ -f ./tests/failed ]]; then
exit 1
elif [[ -f ./tests/pass ]]; then
exit 0
else
exit 1
fi
function runalltests()
% Copyright (C) 2015-2018 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
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare dseries submodule 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 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/>.
dates_src_root = []; % Initialize path as an array to be updated
% when calling initialize_dseries_toolbox() script.
opath = path();
system('rm -f failed');
system('rm -f pass');
% Check that the m-unit-tests module is available.
install_unit_test_toolbox = false;
% Initialize m-unit-test submodule
try
initialize_unit_tests_toolbox;
catch
urlwrite('https://git.dynare.org/Dynare/m-unit-tests/-/archive/master/m-unit-tests-master.zip','master.zip');
warning('off','MATLAB:MKDIR:DirectoryExists');
mkdir('../externals');
warning('on','MATLAB:MKDIR:DirectoryExists');
unzip('master.zip','../externals');
delete('master.zip');
addpath([pwd() '/../externals/m-unit-tests-master/src']);
initialize_unit_tests_toolbox;
install_unit_test_toolbox = true;
error('Missing dependency: m-unit-tests module is not available.')
end
% Initialize the dseries module
% Initialize the dates submodule
try
initialize_dates_toolbox;
catch
......@@ -32,17 +43,16 @@ if isoctave
more off;
end
tmp = dates_src_root;
tmp = tmp(1:end-1); % Remove trailing slash.
report = run_unitary_tests_in_directory(tmp);
r = run_unitary_tests_in_directory(dates_src_root(1:end-1));
delete('*.log');
if install_unit_test_toolbox
rmdir('../externals/m-unit-tests-master','s');
if any(~[r{:,3}])
system('touch failed');
else
system('touch pass');
end
path(opath);
if any(~[report{:,3}])
system('touch failed');
end
\ No newline at end of file
display_report(r);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment