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

@ -4,9 +4,6 @@ matrix:
include: include:
- env: JOB=toxcore ENV=osx RUN_TESTS=true - env: JOB=toxcore ENV=osx RUN_TESTS=true
os: osx os: osx
- env: JOB=hstox ENV=linux
language: haskell
ghc: 7.8
- env: JOB=autotools ENV=linux - env: JOB=autotools ENV=linux
compiler: gcc compiler: gcc
- env: JOB=toxcore ENV=linux - env: JOB=toxcore ENV=linux
@ -23,13 +20,18 @@ addons:
apt: apt:
sources: sources:
- avsm - avsm
- hvr-ghc
packages: packages:
- check - 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. - libcv-dev # For av_test.
- libhighgui-dev # For av_test. - libhighgui-dev # For av_test.
- libopencv-contrib-dev # For av_test. - libopencv-contrib-dev # For av_test.
- libsndfile1-dev # For av_test. - libsndfile1-dev # For av_test.
- libvpx-dev - libvpx-dev # For toxav.
- opam # For apidsl and Frama-C. - opam # For apidsl and Frama-C.
- portaudio19-dev # For av_test. - portaudio19-dev # For av_test.
- texinfo # For libconfig. - texinfo # For libconfig.
@ -58,7 +60,6 @@ notifications:
- "%{result} %{repository_name} %{build_url}" - "%{result} %{repository_name} %{build_url}"
- "#%{build_number} changes: %{compare_url}" - "#%{build_number} changes: %{compare_url}"
branches: branches:
only: only:
- master - master

View File

@ -1,5 +1,8 @@
#!/bin/sh #!/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=cmake
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DFORMAT_TEST=ON" CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DFORMAT_TEST=ON"
NPROC=`nproc` 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 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). # Install libconfig (version in ubuntu-precise too old).
[ -f $CACHE_DIR/lib/libconfig.a ] || { [ -f $CACHE_DIR/lib/libconfig.a ] || {
git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig ../libconfig 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 make install -j$NPROC
cd - # popd 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