34debf7a6d36bbd9a52e68e079ddfc446faf5bef Modify .travis.yml to explictly pass no in env vars instead of setting to nothing (Elichai Turkel) ef37761feed0172baa03dd94c842f1547bdf3016 Change travis.sh to check if variables are equal to yes instead of not-empty. Before this, setting `VALGRIND=wat` was considered as true, and to make it evaluate as false you had to unset the variable `VALGRIND=` but not it checks if `VALGRIND=yes` and if it's not `yes` then it's evaluated to false (Elichai Turkel) Pull request description: ACKs for top commit: real-or-random: ACK 34debf7a6d36bbd9a52e68e079ddfc446faf5bef jonasnick: ACK 34debf7a6d36bbd9a52e68e079ddfc446faf5bef Tree-SHA512: 91becfbc9cb7587ee55b2bceb604ea0aed8860990d63a5f414b11db92180c090ea8bcc048c2fb67a094e892138e3be46f00562bf78b7c3369232457289cde447
68 lines
2.0 KiB
Bash
Executable File
68 lines
2.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
set -x
|
|
|
|
if [ "$HOST" = "i686-linux-gnu" ]
|
|
then
|
|
export CC="$CC -m32"
|
|
fi
|
|
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
|
|
then
|
|
export CC="gcc-9"
|
|
fi
|
|
|
|
./configure \
|
|
--enable-experimental="$EXPERIMENTAL" --enable-endomorphism="$ENDOMORPHISM" \
|
|
--with-test-override-wide-multiply="$WIDEMUL" --with-bignum="$BIGNUM" --with-asm="$ASM" \
|
|
--enable-ecmult-static-precomputation="$STATICPRECOMPUTATION" --with-ecmult-gen-precision="$ECMULTGENPRECISION" \
|
|
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
|
|
--enable-module-schnorrsig="$SCHNORRSIG" \
|
|
--host="$HOST" $EXTRAFLAGS
|
|
|
|
if [ -n "$BUILD" ]
|
|
then
|
|
make -j2 "$BUILD"
|
|
fi
|
|
if [ "$VALGRIND" = "yes" ]
|
|
then
|
|
make -j2
|
|
# the `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (http://valgrind.org/docs/manual/manual-core.html)
|
|
valgrind --error-exitcode=42 ./tests 16
|
|
valgrind --error-exitcode=42 ./exhaustive_tests
|
|
fi
|
|
if [ "$BENCH" = "yes" ]
|
|
then
|
|
if [ "$VALGRIND" = "yes" ]
|
|
then
|
|
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
|
|
EXEC='./libtool --mode=execute valgrind --error-exitcode=42'
|
|
else
|
|
EXEC=
|
|
fi
|
|
# This limits the iterations in the benchmarks below to ITER(set in .travis.yml) iterations.
|
|
export SECP256K1_BENCH_ITERS="$ITERS"
|
|
{
|
|
$EXEC ./bench_ecmult
|
|
$EXEC ./bench_internal
|
|
$EXEC ./bench_sign
|
|
$EXEC ./bench_verify
|
|
} >> bench.log 2>&1
|
|
if [ "$RECOVERY" = "yes" ]
|
|
then
|
|
$EXEC ./bench_recover >> bench.log 2>&1
|
|
fi
|
|
if [ "$ECDH" = "yes" ]
|
|
then
|
|
$EXEC ./bench_ecdh >> bench.log 2>&1
|
|
fi
|
|
if [ "$SCHNORRSIG" = "yes" ]
|
|
then
|
|
$EXEC ./bench_schnorrsig >> bench.log 2>&1
|
|
fi
|
|
fi
|
|
if [ "$CTIMETEST" = "yes" ]
|
|
then
|
|
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
|
|
fi
|