From e0a6f0546d10e0c7b8b60b78fedc71fe5636d178 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 2 Sep 2016 09:30:59 -0400 Subject: [PATCH 1/2] RF: the same .travis.yml to build/test both upstream and debian (if debian/ is present) --- .travis.yml | 14 ++++++-------- tools/ci/debian_before_install | 14 ++++++++++++++ tools/ci/debian_run_tests | 11 +++++++++++ tools/ci/run_tests | 10 ++++++++++ 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100755 tools/ci/debian_before_install create mode 100755 tools/ci/debian_run_tests create mode 100755 tools/ci/run_tests diff --git a/.travis.yml b/.travis.yml index 425011e70..3dffb12ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,15 +9,13 @@ before_install: # install build-dependencies as the doc says - sudo sh src/other_builds/OS_notes.linux_ubuntu_12_64 # install packages needed for testing - - sudo apt-get install xvfb xauth libgl1-mesa-dri mesa-utils tcsh libjpeg-progs + - sudo apt-get install xvfb xauth libgl1-mesa-dri mesa-utils tcsh libjpeg-progs gifsicle + # for Debian pkg build testing + - if [ -e debian ]; then sudo tools/ci/debian_before_install; fi install: - - cd src - - cp other_builds/Makefile.$FLAVOR Makefile - - make vastness + - if [ ! -e debian ]; then cd src; cp other_builds/Makefile.$FLAVOR Makefile; make vastness; fi script: - - export PATH=$PATH:$PWD/$FLAVOR # to gain access to built binaries - - mkdir ../testing; cd ../testing # from here will run tests - - cmake -DAFNI_BUILD_TESTS:BOOL=ON .. - - ctest + - export PATH=$PATH:$PWD/$FLAVOR # to gain access to built binaries if built natively + - if [ -e debian ]; then tools/ci/debian_run_tests; else tools/ci/run_tests; fi # Smoke tests for some additional commands - 3dinfo diff --git a/tools/ci/debian_before_install b/tools/ci/debian_before_install new file mode 100755 index 000000000..a9da0857e --- /dev/null +++ b/tools/ci/debian_before_install @@ -0,0 +1,14 @@ +#!/bin/sh +# Prepares Debian environment to build Debian package + +# To guarantee normal execution in -x mode +export PS4=+ +set -eux + +apt-cache policy | grep -q o=NeuroDebian || bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) + +# Enable deb-src for build-dep +sed -i -e 's,#deb-src,deb-src,g' /etc/apt/sources.list.d/neurodebian.sources.list +apt-get update -q +apt-get install quilt +apt-get build-dep afni diff --git a/tools/ci/debian_run_tests b/tools/ci/debian_run_tests new file mode 100755 index 000000000..b6d0c3591 --- /dev/null +++ b/tools/ci/debian_run_tests @@ -0,0 +1,11 @@ +#!/bin/sh +# Builds package which in turn also runs tests and installs + +# To guarantee normal execution in -x mode +export PS4=+ +set -eux + +QUILT_PATCHES=debian/patches quilt push -a +dpkg-buildpackage -uc -us -b -rfakeroot +sudo dpkg -i ../*.deb +source /etc/afni/afni.sh diff --git a/tools/ci/run_tests b/tools/ci/run_tests new file mode 100755 index 000000000..1dfcc80d1 --- /dev/null +++ b/tools/ci/run_tests @@ -0,0 +1,10 @@ +#!/bin/sh +# Runs AFNI's tests natively + +# To guarantee normal execution in -x mode +export PS4=+ +set -eux + +mkdir ../testing; cd ../testing # from here will run tests +cmake -DAFNI_BUILD_TESTS:BOOL=ON .. +ctest From dd684bcdb6bdfd67c011d20c0106771327d93abc Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 2 Sep 2016 21:43:54 -0400 Subject: [PATCH 2/2] BF(?): do we need to get back from src --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3dffb12ce..de0e98525 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ before_install: # for Debian pkg build testing - if [ -e debian ]; then sudo tools/ci/debian_before_install; fi install: - - if [ ! -e debian ]; then cd src; cp other_builds/Makefile.$FLAVOR Makefile; make vastness; fi + - if [ ! -e debian ]; then cd src; cp other_builds/Makefile.$FLAVOR Makefile; make vastness; cd ..; fi script: - - export PATH=$PATH:$PWD/$FLAVOR # to gain access to built binaries if built natively + - export PATH=$PATH:$PWD/src/$FLAVOR # to gain access to built binaries if built natively - if [ -e debian ]; then tools/ci/debian_run_tests; else tools/ci/run_tests; fi # Smoke tests for some additional commands - 3dinfo