From 8339e3449f41f5d6edd16a8657f7faa84040fdc3 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 13 Jul 2016 15:18:03 +0200 Subject: Run hstox test suite against toxcore on Travis. --- .travis.yml | 11 ++++++++++- other/travis/hstox-after_script | 3 +++ other/travis/hstox-install | 23 +++++++++++++++++++++++ other/travis/hstox-script | 5 +++++ other/travis/toxcore-install | 28 +++++++++++++--------------- 5 files changed, 54 insertions(+), 16 deletions(-) create mode 100755 other/travis/hstox-after_script create mode 100755 other/travis/hstox-install create mode 100755 other/travis/hstox-script diff --git a/.travis.yml b/.travis.yml index 527b1b79..2ced7f3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,27 +5,36 @@ compiler: env: matrix: -# - BUILD=hstox + - BUILD=hstox - BUILD=toxcore addons: apt: sources: - avsm + - hvr-ghc packages: + - cabal-install-1.22 - check + - ghc-7.10.3 - libvpx-dev - opam # For apidsl and Frama-C. - texinfo # For libconfig. cache: directories: + - $HOME/.cabal + - $HOME/.ghc - $HOME/cache install: + # Set up PATH for the /opt packages. + - export PATH=/opt/cabal/1.22/bin:$PATH + - export PATH=/opt/ghc/7.10.3/bin:$PATH # Globally used environment variables. - export CACHE_DIR=$HOME/cache - export OPAMROOT=$CACHE_DIR/.opam + - export LD_LIBRARY_PATH=$CACHE_DIR/lib - export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig - export ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle # Install required packages. diff --git a/other/travis/hstox-after_script b/other/travis/hstox-after_script new file mode 100755 index 00000000..0f4ddcd5 --- /dev/null +++ b/other/travis/hstox-after_script @@ -0,0 +1,3 @@ +#!/bin/sh + +set -e -x diff --git a/other/travis/hstox-install b/other/travis/hstox-install new file mode 100755 index 00000000..839dfd04 --- /dev/null +++ b/other/travis/hstox-install @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e -x + +cabal update + +# We need to install happy explicitly, otherwise setup-Simple-Cabal will fail to +# install. +cabal install happy + +# Fetch hstox. +git clone --recursive --depth=1 https://github.com/TokTok/hstox ../hstox + +# Delete all files in the cloned toxcore. +rm -rf ../hstox/test/toxcore/toxcore/toxcore +# Move the toxcore source files to the hstox test directory. +# The reason we move source files instead of the whole git root directory is +# that the travis scripts (like this one) need to remain in place. +mv toxcore ../hstox/test/toxcore/toxcore + +# In the "install" step, we only run configure, which downloads the required +# packages. In the "script" step we then build the actual code. +make -C ../hstox configure diff --git a/other/travis/hstox-script b/other/travis/hstox-script new file mode 100755 index 00000000..6e19ee11 --- /dev/null +++ b/other/travis/hstox-script @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e -x + +make -C ../hstox check-toxcore diff --git a/other/travis/toxcore-install b/other/travis/toxcore-install index 0cd43bc5..f3b213ac 100755 --- a/other/travis/toxcore-install +++ b/other/travis/toxcore-install @@ -2,8 +2,6 @@ set -e -x -cd .. - # Set up opam. opam init -y eval `opam config env` @@ -12,46 +10,46 @@ eval `opam config env` opam install -y ocamlfind ppx_deriving menhir # Build apidsl. -git clone --depth=1 https://github.com/iphydf/apidsl -make -C apidsl +git clone --depth=1 https://github.com/iphydf/apidsl ../apidsl +make -C ../apidsl # Install cpp-coveralls to upload test coverage results. pip install --user cpp-coveralls # Install astyle (version in ubuntu-precise too old). [ -f $ASTYLE ] || { - wget -O astyle.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/astyle_2.05.1.orig.tar.gz - tar -xf astyle.tar.gz -C $CACHE_DIR + wget -O ../astyle.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/astyle_2.05.1.orig.tar.gz + tar -xf ../astyle.tar.gz -C $CACHE_DIR make -C $CACHE_DIR/astyle/build/gcc } # Install libsodium (not in ubuntu-precise). [ -f $CACHE_DIR/lib/libsodium.a ] || { - git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium - cd libsodium + git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium ../libsodium + cd ../libsodium # pushd ./autogen.sh ./configure --prefix=$CACHE_DIR make install -j3 - cd .. + cd - # popd } # Install libconfig (version in ubuntu-precise too old). [ -f $CACHE_DIR/lib/libconfig.a ] || { - git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig - cd libconfig + git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig ../libconfig + cd ../libconfig # pushd autoreconf -fi ./configure --prefix=$CACHE_DIR touch lib/scanner.l make install -j3 - cd .. + cd - # popd } # Install libopus (not in ubuntu-precise). [ -f $CACHE_DIR/lib/libopus.a ] || { - git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus - cd opus + git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus ../opus + cd ../opus # pushd ./autogen.sh ./configure --prefix=$CACHE_DIR make install -j3 - cd .. + cd - # popd } -- cgit v1.2.3