secp256k1/ci/cirrus.sh

86 lines
2.2 KiB
Bash
Raw Normal View History

#!/bin/sh
set -e
set -x
2020-12-22 15:42:08 +00:00
export LC_ALL=C
env >> test_env.log
$CC -v || true
valgrind --version || true
./autogen.sh
./configure \
2020-09-26 03:06:36 +00:00
--enable-experimental="$EXPERIMENTAL" \
--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" \
--with-valgrind="$WITH_VALGRIND" \
--host="$HOST" $EXTRAFLAGS
make -j2
# Print information about binaries so that we can see that the architecture is correct
file *tests || true
file bench_* || true
file .libs/* || true
if [ -n "$BUILD" ]
then
make -j2 "$BUILD"
fi
2020-12-22 15:42:08 +00:00
if [ "$RUN_VALGRIND" = "yes" ]
then
2020-12-17 06:33:49 +00:00
# the `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (https://www.valgrind.org/docs/manual/manual-core.html)
valgrind --error-exitcode=42 ./tests 16
valgrind --error-exitcode=42 ./exhaustive_tests
fi
2020-12-22 15:42:08 +00:00
if [ -n "$QEMU_CMD" ]
then
$QEMU_CMD ./tests 16
$QEMU_CMD ./exhaustive_tests
fi
if [ "$BENCH" = "yes" ]
then
2020-12-22 15:42:08 +00:00
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
EXEC='./libtool --mode=execute'
if [ -n "$QEMU_CMD" ]
then
EXEC="$EXEC $QEMU_CMD"
fi
if [ "$RUN_VALGRIND" = "yes" ]
then
2020-12-22 15:42:08 +00:00
EXEC="$EXEC valgrind --error-exitcode=42"
fi
2020-12-22 15:42:08 +00:00
# This limits the iterations in the benchmarks below to ITER 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
2020-09-11 22:04:04 +00:00
if [ "$SCHNORRSIG" = "yes" ]
then
$EXEC ./bench_schnorrsig >> bench.log 2>&1
fi
fi
if [ "$CTIMETEST" = "yes" ]
then
2020-05-02 19:06:04 +00:00
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
fi