2016-07-13 20:12:11 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-08-25 06:52:34 +08:00
|
|
|
# Enable test coverage recording.
|
|
|
|
export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
|
2016-08-10 19:28:33 +08:00
|
|
|
|
2017-01-05 05:15:48 +08:00
|
|
|
set_opt() {
|
|
|
|
opts="$opts -D$1="`expr ON \& \( $i % 2 \) \| OFF`
|
|
|
|
set +e # result can be 0
|
|
|
|
i=`expr $i / 2`
|
|
|
|
set -e
|
|
|
|
}
|
|
|
|
|
|
|
|
# Try some combinations of cmake options.
|
|
|
|
for i in `seq 0 7`; do
|
|
|
|
set +x
|
|
|
|
opts="$CMAKE_EXTRA_FLAGS -DWARNINGS=OFF"
|
|
|
|
set_opt STRICT_ABI
|
|
|
|
set_opt ENABLE_STATIC
|
|
|
|
set_opt ENABLE_SHARED
|
|
|
|
set -x
|
|
|
|
RUN $CMAKE -B$BUILD_DIR -H. $opts
|
|
|
|
rm -rf $BUILD_DIR
|
|
|
|
done
|
|
|
|
|
2016-07-13 20:12:11 +08:00
|
|
|
# Build toxcore and run tests.
|
2016-10-01 02:13:29 +08:00
|
|
|
RUN $CMAKE \
|
|
|
|
-B$BUILD_DIR \
|
|
|
|
-H. \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install \
|
2016-11-06 04:24:36 +08:00
|
|
|
-DASAN=ON \
|
2016-10-01 02:13:29 +08:00
|
|
|
-DDEBUG=ON \
|
|
|
|
-DSTRICT_ABI=ON \
|
|
|
|
-DTEST_TIMEOUT_SECONDS=300 \
|
|
|
|
-DTRACE=ON \
|
2016-11-06 04:24:36 +08:00
|
|
|
$CMAKE_EXTRA_FLAGS
|
2016-08-10 19:28:33 +08:00
|
|
|
|
2016-08-25 06:52:34 +08:00
|
|
|
export CTEST_OUTPUT_ON_FAILURE=1
|
2016-07-13 20:12:11 +08:00
|
|
|
|
2016-08-25 06:52:34 +08:00
|
|
|
RUN make -C$BUILD_DIR -j$NPROC -k install
|
2017-01-06 05:23:06 +08:00
|
|
|
if $RUN_TESTS; then
|
|
|
|
TESTS make -C$BUILD_DIR -j$NPROC test
|
|
|
|
fi
|