diff --git a/.travis.yml b/.travis.yml index 2f22d495..cfa9240d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,9 @@ matrix: - env: JOB=hstox ENV=linux language: haskell ghc: 7.8 - - env: JOB=toxcore ENV=linux - compiler: clang - - env: JOB=toxcore ENV=linux - compiler: gcc - env: JOB=autotools ENV=linux + compiler: gcc + - env: JOB=toxcore ENV=linux compiler: clang addons: diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c index 219550db..69e6033d 100644 --- a/auto_tests/tox_test.c +++ b/auto_tests/tox_test.c @@ -923,7 +923,7 @@ loop_top: } if (counter != last_count) { - printf("got to %u\n", counter); + printf("many_clients got to %u\n", counter); last_count = counter; } @@ -1115,6 +1115,8 @@ loop_top: ck_assert_msg(num != UINT32_MAX && test == TOX_ERR_FRIEND_ADD_OK, "Failed to add friend error code: %i", test); } + uint16_t last_count = 0; + while (1) { uint16_t counter = 0; @@ -1126,6 +1128,11 @@ loop_top: } } + if (counter != last_count) { + printf("many_clients_tcp_b got to %u\n", counter); + last_count = counter; + } + if (counter == NUM_FRIENDS * 2) { break; } diff --git a/other/travis/autotools-after_script b/other/travis/autotools-after_script deleted file mode 100755 index 7c5055b7..00000000 --- a/other/travis/autotools-after_script +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -set -e -u -x -. other/travis/env-$ENV.sh diff --git a/other/travis/autotools-install b/other/travis/autotools-install deleted file mode 120000 index 7174a278..00000000 --- a/other/travis/autotools-install +++ /dev/null @@ -1 +0,0 @@ -toxcore-install \ No newline at end of file diff --git a/other/travis/autotools-linux-install b/other/travis/autotools-linux-install new file mode 100644 index 00000000..edc6a2dc --- /dev/null +++ b/other/travis/autotools-linux-install @@ -0,0 +1,3 @@ +#!/bin/sh + +. other/travis/toxcore-linux-install diff --git a/other/travis/autotools-script b/other/travis/autotools-script index 5448aac5..cc536ab9 100755 --- a/other/travis/autotools-script +++ b/other/travis/autotools-script @@ -1,8 +1,5 @@ #!/bin/sh -set -e -u -x -. other/travis/env-$ENV.sh - # Build toxcore and run tests. ./autogen.sh ./configure \ @@ -10,8 +7,7 @@ set -e -u -x --with-libsodium-headers=$CACHE_DIR/include \ --enable-daemon \ --enable-logging \ - --enable-ntox \ - CFLAGS="-DTRAVIS_ENV=1" + --enable-ntox # We use make instead of RUN $MAKE here, because the autotools build will only # ever run natively on the Linux container, never on a Windows cross compilation diff --git a/other/travis/env-linux.sh b/other/travis/env-linux.sh index 085f94e6..0eb5e9ea 100644 --- a/other/travis/env-linux.sh +++ b/other/travis/env-linux.sh @@ -1,11 +1,10 @@ #!/bin/sh -. other/travis/env.sh +CMAKE=cmake +NPROC=`nproc` +CURDIR=$PWD +TESTS=true RUN() { "$@" } -export CMAKE=cmake -export MAKE=make -export PREFIX=$PWD/_install -export NPROC=`nproc` diff --git a/other/travis/env.sh b/other/travis/env.sh index cd188ceb..78ce0010 100644 --- a/other/travis/env.sh +++ b/other/travis/env.sh @@ -6,5 +6,6 @@ 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 +export CFLAGS="-O3 -DTRAVIS_ENV=1" BUILD_DIR=_build diff --git a/other/travis/hstox-after_script b/other/travis/hstox-after_script deleted file mode 100755 index 7c5055b7..00000000 --- a/other/travis/hstox-after_script +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -set -e -u -x -. other/travis/env-$ENV.sh diff --git a/other/travis/hstox-install b/other/travis/hstox-install index 68b1eacb..f9d0f7b6 100755 --- a/other/travis/hstox-install +++ b/other/travis/hstox-install @@ -1,8 +1,5 @@ #!/bin/sh -set -e -u -x -. other/travis/env-$ENV.sh - # An initial update is required or the cabal cache will be empty and no packages # can be installed. cabal update diff --git a/other/travis/hstox-script b/other/travis/hstox-script index 224d58cc..0c1953cb 100755 --- a/other/travis/hstox-script +++ b/other/travis/hstox-script @@ -1,6 +1,3 @@ #!/bin/sh -set -e -u -x -. other/travis/env-$ENV.sh - make -C ../hstox check-toxcore diff --git a/other/travis/toxcore-after_script b/other/travis/toxcore-after_script deleted file mode 100755 index faa0d7a5..00000000 --- a/other/travis/toxcore-after_script +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -e -u -x -. other/travis/env-$ENV.sh - -# Only submit coverage from the clang build. GCC and clang disagree slightly, -# so we arbitrarily choose the alphabetically first one for the report. -if [ "$CC" = "clang" ]; then - coveralls \ - --exclude auto_tests \ - --exclude other \ - --exclude testing \ - --gcov-options '\-lp' -fi diff --git a/other/travis/toxcore-linux-after_script b/other/travis/toxcore-linux-after_script new file mode 100755 index 00000000..7a388d0d --- /dev/null +++ b/other/travis/toxcore-linux-after_script @@ -0,0 +1,8 @@ +#!/bin/sh + +# We only submit coverage from the Linux build. +coveralls \ + --exclude auto_tests \ + --exclude other \ + --exclude testing \ + --gcov-options '\-lp' diff --git a/other/travis/toxcore-install b/other/travis/toxcore-linux-install similarity index 97% rename from other/travis/toxcore-install rename to other/travis/toxcore-linux-install index d2e67dbc..5cbe36db 100755 --- a/other/travis/toxcore-install +++ b/other/travis/toxcore-linux-install @@ -1,8 +1,5 @@ #!/bin/sh -set -e -u -x -. other/travis/env-$ENV.sh - # Set up opam. opam init -y eval `opam config env` diff --git a/other/travis/toxcore-script b/other/travis/toxcore-script index 1b1482b9..3b9b383b 100755 --- a/other/travis/toxcore-script +++ b/other/travis/toxcore-script @@ -1,15 +1,16 @@ #!/bin/sh -set -e -u -x -. other/travis/env-$ENV.sh +# Enable test coverage recording. +export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" # Build toxcore and run tests. -export CFLAGS="-O3 -fprofile-arcs -ftest-coverage -DTRAVIS_ENV=1" # TODO(iphydf): Enable ASAN. It currently has some bad interactions with gcov, # so it's disabled on Travis. -RUN $CMAKE -B$BUILD_DIR -H. -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDEBUG=ON -DASSOC_DHT=ON #-DASAN=ON +RUN $CMAKE -B$BUILD_DIR -H. -DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install -DDEBUG=ON -DASSOC_DHT=ON #-DASAN=ON -export CTEST_OUTPUT_ON_FAILURE=1 +RUN make -C $BUILD_DIR -j$NPROC -k install -RUN $MAKE -C $BUILD_DIR -j$NPROC -k -RUN $MAKE -C $BUILD_DIR -j$NPROC test +if $TESTS; then + export CTEST_OUTPUT_ON_FAILURE=1 + RUN make -C $BUILD_DIR -j$NPROC test +fi