diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..3ad8982d406914fb57570a6f76de0ba86f487d63 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: python + +install: + - export + - sudo add-apt-repository ppa:octave/stable -y + - sudo apt-get update -qq + - sudo apt-get install -qq octave liboctave-dev + +script: + - make check-octave + - ./success.sh diff --git a/success.sh b/success.sh new file mode 100755 index 0000000000000000000000000000000000000000..125cc1bf2b587ed641928c2c815e0456fe2eb4e3 --- /dev/null +++ b/success.sh @@ -0,0 +1,5 @@ +#!/bin/sh +if [ -f ./tests/failed ] +then + exit 1 +fi diff --git a/tests/runalltests.m b/tests/runalltests.m index cd561e0091ca55ef86b8a97b77934348789c8c62..144cf57d9b15c843be880d393a637e78a7d9e101 100644 --- a/tests/runalltests.m +++ b/tests/runalltests.m @@ -1,19 +1,20 @@ opath = path(); -% Check that the m-unit-tests module is available. +system('rm -f failed'); +% Check that the m-unit-tests module is available. install_unit_test_toolbox = false; try initialize_unit_tests_toolbox; catch urlwrite('https://github.com/DynareTeam/m-unit-tests/archive/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']) + 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 @@ -28,16 +29,20 @@ catch end if isoctave - more off + more off; end tmp = dates_src_root; tmp = tmp(1:end-1); % Remove trailing slash. -run_unitary_tests_in_directory(tmp); +report = run_unitary_tests_in_directory(tmp); delete('*.log'); if install_unit_test_toolbox rmdir('../externals/m-unit-tests-master','s'); end -path(opath); \ No newline at end of file +path(opath); + +if any(~[report{:,3}]) + system('touch failed'); +end \ No newline at end of file