ci: Make test iterations configurable and tweak for sanitizer builds

This commit is contained in:
Tim Ruffing 2021-05-17 20:41:15 +02:00
parent 489ff5c20a
commit 02dcea1ad9
2 changed files with 12 additions and 3 deletions

View File

@ -13,7 +13,8 @@ env:
EXPERIMENTAL: no EXPERIMENTAL: no
CTIMETEST: yes CTIMETEST: yes
BENCH: yes BENCH: yes
ITERS: 2 TEST_ITERS:
BENCH_ITERS: 2
MAKEFLAGS: -j2 MAKEFLAGS: -j2
cat_logs_snippet: &CAT_LOGS cat_logs_snippet: &CAT_LOGS
@ -162,6 +163,7 @@ task:
memory: 1G memory: 1G
env: env:
WRAPPER_CMD: qemu-s390x WRAPPER_CMD: qemu-s390x
TEST_ITERS: 16
HOST: s390x-linux-gnu HOST: s390x-linux-gnu
WITH_VALGRIND: no WITH_VALGRIND: no
ECDH: yes ECDH: yes
@ -184,6 +186,7 @@ task:
memory: 1G memory: 1G
env: env:
WRAPPER_CMD: qemu-arm WRAPPER_CMD: qemu-arm
TEST_ITERS: 16
HOST: arm-linux-gnueabihf HOST: arm-linux-gnueabihf
WITH_VALGRIND: no WITH_VALGRIND: no
ECDH: yes ECDH: yes
@ -207,6 +210,7 @@ task:
memory: 1G memory: 1G
env: env:
WRAPPER_CMD: qemu-aarch64 WRAPPER_CMD: qemu-aarch64
TEST_ITERS: 16
HOST: aarch64-linux-gnu HOST: aarch64-linux-gnu
WITH_VALGRIND: no WITH_VALGRIND: no
ECDH: yes ECDH: yes
@ -227,6 +231,7 @@ task:
memory: 1G memory: 1G
env: env:
WRAPPER_CMD: wine64-stable WRAPPER_CMD: wine64-stable
TEST_ITERS: 16
HOST: x86_64-w64-mingw32 HOST: x86_64-w64-mingw32
WITH_VALGRIND: no WITH_VALGRIND: no
ECDH: yes ECDH: yes
@ -257,6 +262,7 @@ task:
env: env:
# 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) # 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)
WRAPPER_CMD: "valgrind --error-exitcode=42" WRAPPER_CMD: "valgrind --error-exitcode=42"
TEST_ITERS: 16
- name: "UBSan, ASan, LSan" - name: "UBSan, ASan, LSan"
env: env:
CFLAGS: "-fsanitize=undefined,address" CFLAGS: "-fsanitize=undefined,address"
@ -264,6 +270,7 @@ task:
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1" UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1" ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
LSAN_OPTIONS: "use_unaligned=1" LSAN_OPTIONS: "use_unaligned=1"
TEST_ITERS: 32
# Try to cover many configurations with just a tiny matrix. # Try to cover many configurations with just a tiny matrix.
matrix: matrix:
- env: - env:

View File

@ -32,6 +32,10 @@ file .libs/* || true
# This tells `make check` to wrap test invocations. # This tells `make check` to wrap test invocations.
export LOG_COMPILER="$WRAPPER_CMD" export LOG_COMPILER="$WRAPPER_CMD"
# This limits the iterations in the tests and benchmarks.
export SECP256K1_TEST_ITERS="$TEST_ITERS"
export SECP256K1_BENCH_ITERS="$BENCH_ITERS"
make "$BUILD" make "$BUILD"
if [ "$BENCH" = "yes" ] if [ "$BENCH" = "yes" ]
@ -42,8 +46,6 @@ then
then then
EXEC="$EXEC $WRAPPER_CMD" EXEC="$EXEC $WRAPPER_CMD"
fi fi
# This limits the iterations in the benchmarks below to ITER iterations.
export SECP256K1_BENCH_ITERS="$ITERS"
{ {
$EXEC ./bench_ecmult $EXEC ./bench_ecmult
$EXEC ./bench_internal $EXEC ./bench_internal