Fold hstox tests into the general linux test.

We can run the spectest from within cmake, so we should exercise that.
This commit is contained in:
iphydf 2017-06-04 18:34:15 +00:00
parent cb69b8a986
commit 8479b82431
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
5 changed files with 79 additions and 63 deletions

View File

@ -2,48 +2,50 @@ language: c
matrix:
include:
- env: JOB=toxcore ENV=osx RUN_TESTS=true
os: osx
- env: JOB=hstox ENV=linux
language: haskell
ghc: 7.8
- env: JOB=autotools ENV=linux
compiler: gcc
- env: JOB=toxcore ENV=linux
compiler: clang
- env: JOB=toxcore ENV=windows ARCH=i686
services:
- docker
- env: JOB=toxcore ENV=windows ARCH=x86_64
services:
- docker
- env: JOB=toxcore ENV=osx RUN_TESTS=true
os: osx
- env: JOB=autotools ENV=linux
compiler: gcc
- env: JOB=toxcore ENV=linux
compiler: clang
- env: JOB=toxcore ENV=windows ARCH=i686
services:
- docker
- env: JOB=toxcore ENV=windows ARCH=x86_64
services:
- docker
fast_finish: true
addons:
apt:
sources:
- avsm
- avsm
- hvr-ghc
packages:
- check
- libcv-dev # For av_test.
- libhighgui-dev # For av_test.
- libopencv-contrib-dev # For av_test.
- libsndfile1-dev # For av_test.
- libvpx-dev
- opam # For apidsl and Frama-C.
- portaudio19-dev # For av_test.
- texinfo # For libconfig.
- alex-3.1.7 # For hstox.
- cabal-install-1.18 # For hstox.
- check # For tests.
- ghc-7.8.4 # For hstox.
- happy-1.19.5 # For hstox.
- libcv-dev # For av_test.
- libhighgui-dev # For av_test.
- libopencv-contrib-dev # For av_test.
- libsndfile1-dev # For av_test.
- libvpx-dev # For toxav.
- opam # For apidsl and Frama-C.
- portaudio19-dev # For av_test.
- texinfo # For libconfig.
cache:
directories:
# Although Travis documentation says not to rely on the value of $HOME, we
# rely on it here because cabal installs its packages there by default. If
# that ever changes, these values need to be updated.
# Note that we can't use shell expressions in these paths, so we can't ask
# cabal where its data is stored.
- $HOME/.cabal
- $HOME/.ghc
- $HOME/cache
# Although Travis documentation says not to rely on the value of $HOME, we
# rely on it here because cabal installs its packages there by default. If
# that ever changes, these values need to be updated.
# Note that we can't use shell expressions in these paths, so we can't ask
# cabal where its data is stored.
- $HOME/.cabal
- $HOME/.ghc
- $HOME/cache
install: other/travis/phase $JOB $ENV install
script: other/travis/phase $JOB $ENV script
@ -53,12 +55,11 @@ after_failure: other/travis/phase $JOB $ENV after_failure
notifications:
irc:
channels:
- "chat.freenode.net#toktok-status"
- "chat.freenode.net#toktok-status"
template:
- "%{result} %{repository_name} %{build_url}"
- "#%{build_number} changes: %{compare_url}"
- "%{result} %{repository_name} %{build_url}"
- "#%{build_number} changes: %{compare_url}"
branches:
only:
- master
- master

View File

@ -1,5 +1,8 @@
#!/bin/sh
export PATH=/opt/ghc/7.8.4/bin:/opt/cabal/1.18/bin:/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH
export PATH=$HOME/.cabal/bin:$PATH
CMAKE=cmake
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DFORMAT_TEST=ON"
NPROC=`nproc`

View File

@ -1,22 +0,0 @@
#!/bin/sh
# An initial update is required or the cabal cache will be empty and no packages
# can be installed.
cabal update
# We need to install happy explicitly, otherwise setup-Simple-Cabal will fail to
# install.
cabal install happy
# Fetch hstox and msgpack-c.
git clone --recursive --depth=1 https://github.com/TokTok/hs-toxcore ../hs-toxcore
git clone --depth=1 https://github.com/msgpack/msgpack-c testing/hstox/msgpack-c
# Install toxcore dependencies before hstox, as hstox needs libsodium.
. other/travis/toxcore-linux-install
# Install the hstox test runner.
CABAL_FLAGS="--disable-library-profiling"
CABAL_FLAGS="$CABAL_FLAGS --extra-include-dirs=$CACHE_DIR/include"
CABAL_FLAGS="$CABAL_FLAGS --extra-lib-dirs=$CACHE_DIR/lib"
(cd ../hs-toxcore && cabal install $CABAL_FLAGS)

View File

@ -1,3 +0,0 @@
#!/bin/sh
make -C testing/hstox check

View File

@ -36,6 +36,30 @@ sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyo
cd - # popd
}
# Install msgpack-c.
[ -f $CACHE_DIR/lib/libmsgpackc.so ] || {
git clone --depth=1 https://github.com/msgpack/msgpack-c ../msgpack-c
$CC -shared -fPIC -O3 -I../msgpack-c/include ../msgpack-c/src/*.c -o $CACHE_DIR/lib/libmsgpackc.so
cp -a ../msgpack-c/include/* $CACHE_DIR/include/
sed -e "s|@prefix@|$CACHE_DIR|" \
-e 's|@exec_prefix@|${prefix}|' \
-e 's|@libdir@|${prefix}/lib|' \
-e 's|@includedir@|${prefix}/include|' \
-e 's|@VERSION@|2.1.1|' \
../msgpack-c/msgpack.pc.in \
> $CACHE_DIR/lib/pkgconfig/msgpack.pc
# TODO(iphydf): This doesn't work, because the cmake version on travis is too
# old. We're building it manually, instead.
# cd ../msgpack-c # pushd
# cmake . -DCMAKE_INSTALL_PREFIX:PATH=$CACHE_DIR \
# -DMSGPACK_ENABLE_CXX=OFF \
# -DMSGPACK_BUILD_EXAMPLES=OFF \
# -DMSGPACK_BUILD_TESTS=OFF
# make -j$NPROC
# make install -j$NPROC
# 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 ../libconfig
@ -56,3 +80,16 @@ sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyo
make install -j$NPROC
cd - # popd
}
if [ "$CC" = "clang" ]; then
# An initial update is required or the cabal cache will be empty and no packages
# can be installed.
cabal update
# Install the hstox test runner after installing libsodium.
CABAL_FLAGS="--disable-library-profiling"
CABAL_FLAGS="$CABAL_FLAGS --extra-include-dirs=$CACHE_DIR/include"
CABAL_FLAGS="$CABAL_FLAGS --extra-lib-dirs=$CACHE_DIR/lib"
git clone --recursive --depth=1 https://github.com/TokTok/hs-toxcore ../hs-toxcore
(cd ../hs-toxcore && cabal install $CABAL_FLAGS)
fi