2020-05-02 18:58:42 +00:00
|
|
|
#!/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
|
|
|
|
|
2020-05-02 18:58:42 +00:00
|
|
|
./configure \
|
2020-09-26 03:06:36 +00:00
|
|
|
--enable-experimental="$EXPERIMENTAL" \
|
2020-10-11 23:04:58 +00:00
|
|
|
--with-test-override-wide-multiply="$WIDEMUL" --with-asm="$ASM" \
|
2020-05-02 18:58:42 +00:00
|
|
|
--enable-ecmult-static-precomputation="$STATICPRECOMPUTATION" --with-ecmult-gen-precision="$ECMULTGENPRECISION" \
|
2020-07-29 06:50:42 +00:00
|
|
|
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
|
2020-05-12 16:17:59 +00:00
|
|
|
--enable-module-schnorrsig="$SCHNORRSIG" \
|
2020-09-21 07:47:40 +00:00
|
|
|
--with-valgrind="$WITH_VALGRIND" \
|
2020-07-29 06:50:42 +00:00
|
|
|
--host="$HOST" $EXTRAFLAGS
|
2020-05-02 18:58:42 +00:00
|
|
|
|
2021-03-03 00:21:18 +00:00
|
|
|
# We have set "-j<n>" in MAKEFLAGS.
|
|
|
|
make
|
2021-02-26 16:36:34 +00:00
|
|
|
|
|
|
|
# Print information about binaries so that we can see that the architecture is correct
|
2021-04-17 17:57:16 +00:00
|
|
|
file *tests* || true
|
2021-10-17 16:08:06 +00:00
|
|
|
file bench* || true
|
2021-02-26 16:36:34 +00:00
|
|
|
file .libs/* || true
|
|
|
|
|
2021-05-17 15:19:01 +00:00
|
|
|
# This tells `make check` to wrap test invocations.
|
|
|
|
export LOG_COMPILER="$WRAPPER_CMD"
|
2020-12-22 15:42:08 +00:00
|
|
|
|
2021-05-17 15:19:01 +00:00
|
|
|
make "$BUILD"
|
2021-04-17 17:57:16 +00:00
|
|
|
|
2020-07-30 08:18:07 +00:00
|
|
|
if [ "$BENCH" = "yes" ]
|
2020-05-02 18:58:42 +00:00
|
|
|
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'
|
2021-05-17 15:19:01 +00:00
|
|
|
if [ -n "$WRAPPER_CMD" ]
|
2021-04-17 17:57:16 +00:00
|
|
|
then
|
2021-05-17 15:19:01 +00:00
|
|
|
EXEC="$EXEC $WRAPPER_CMD"
|
2021-04-17 17:57:16 +00:00
|
|
|
fi
|
2020-05-02 18:58:42 +00:00
|
|
|
{
|
|
|
|
$EXEC ./bench_ecmult
|
|
|
|
$EXEC ./bench_internal
|
2021-10-17 16:08:06 +00:00
|
|
|
$EXEC ./bench
|
2020-05-02 18:58:42 +00:00
|
|
|
} >> bench.log 2>&1
|
|
|
|
fi
|
2021-11-13 14:52:44 +00:00
|
|
|
|
2020-07-30 08:18:07 +00:00
|
|
|
if [ "$CTIMETEST" = "yes" ]
|
2020-05-02 18:58:42 +00:00
|
|
|
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
|
2020-05-02 18:58:42 +00:00
|
|
|
fi
|
2021-11-13 14:52:44 +00:00
|
|
|
|
|
|
|
# Rebuild precomputed files (if not cross-compiling).
|
|
|
|
if [ -z "$HOST" ]
|
|
|
|
then
|
|
|
|
make clean-precomp
|
|
|
|
make precomp
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check that no repo files have been modified by the build.
|
|
|
|
# (This fails for example if the precomp files need to be updated in the repo.)
|
|
|
|
git diff --exit-code
|