Commit 54e05d16 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

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 ...@@ -5,7 +5,10 @@ all: check-octave check-matlab
check-octave: check-octave:
@cd tests ;\ @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: 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 #!/bin/bash
if [ -f ./tests/failed ] if [[ -f ./tests/failed ]]; then
then exit 1
exit 1 elif [[ -f ./tests/pass ]]; then
exit 0
else
exit 1
fi 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(); opath = path();
system('rm -f failed'); system('rm -f failed');
system('rm -f pass');
% Check that the m-unit-tests module is available. % Initialize m-unit-test submodule
install_unit_test_toolbox = false;
try try
initialize_unit_tests_toolbox; initialize_unit_tests_toolbox;
catch catch
urlwrite('https://git.dynare.org/Dynare/m-unit-tests/-/archive/master/m-unit-tests-master.zip','master.zip'); error('Missing dependency: m-unit-tests module is not available.')
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;
end end
% Initialize the dseries module % Initialize the dates submodule
try try
initialize_dates_toolbox; initialize_dates_toolbox;
catch catch
...@@ -32,17 +43,16 @@ if isoctave ...@@ -32,17 +43,16 @@ if isoctave
more off; more off;
end end
tmp = dates_src_root; r = run_unitary_tests_in_directory(dates_src_root(1:end-1));
tmp = tmp(1:end-1); % Remove trailing slash.
report = run_unitary_tests_in_directory(tmp);
delete('*.log'); delete('*.log');
if install_unit_test_toolbox if any(~[r{:,3}])
rmdir('../externals/m-unit-tests-master','s'); system('touch failed');
else
system('touch pass');
end end
path(opath); path(opath);
if any(~[report{:,3}]) display_report(r);
system('touch failed'); \ No newline at end of file
end
\ No newline at end of file
Supports Markdown
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