toxcore/other/travis/toxcore-script
iphydf db22522741
Add missing DHT_bootstrap to CMakeLists.txt.
- This PR also adds a DEBUG cmake option that enables -DTOX_DEBUG.
- We also remove `-Wall`, because there are too many warnings, and nobody really
  looks at them at the moment. We'll see about fixing them soon. We'll also want
  to enable `-Werror` at some point.
- Finally, this PR enables `-O3` to make sure toxcore still works correctly
  under heavy compiler optimisations.
2016-08-17 22:12:39 +01:00

21 lines
907 B
Bash
Executable File

#!/bin/sh
set -e -u -x
. other/travis/env-$ENV.sh
# Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h.
../apidsl/_build/apigen.native other/apidsl/tox.in.h | $ASTYLE --options=other/astyle/astylerc > toxcore/tox.h
../apidsl/_build/apigen.native other/apidsl/toxav.in.h | $ASTYLE --options=other/astyle/astylerc > toxav/toxav.h
# Check if the code is formatted according to the astyle configuration.
$ASTYLE --options=other/astyle/astylerc `find . -name "*.[ch]" -and -not -name "*.in.*" -and -not -wholename "*crypto_pwhash*" -and -not -wholename "./super_donators/*"`
git diff --exit-code
# Build toxcore and run tests.
export CFLAGS="-O3 -fprofile-arcs -ftest-coverage -DTRAVIS_ENV=1"
RUN $CMAKE -B$BUILD_DIR -H. -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DLOGGING=ON -DDEBUG=ON
export CTEST_OUTPUT_ON_FAILURE=1
RUN $MAKE -C $BUILD_DIR -j$NPROC -k
RUN $MAKE -C $BUILD_DIR -j$NPROC test