Skip to content

Commit fcfcb97

Browse files
ci: Simplify to use generic wrapper for QEMU, Valgrind, etc
1 parent de4157f commit fcfcb97

File tree

2 files changed

+11
-42
lines changed

2 files changed

+11
-42
lines changed

.cirrus.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ env:
55
ASM: no
66
BUILD: check
77
WITH_VALGRIND: yes
8-
RUN_VALGRIND: no
98
EXTRAFLAGS:
109
HOST:
1110
ECDH: no
@@ -162,9 +161,8 @@ task:
162161
cpu: 1
163162
memory: 1G
164163
env:
165-
QEMU_CMD: qemu-s390x
164+
WRAPPER_CMD: qemu-s390x
166165
HOST: s390x-linux-gnu
167-
BUILD:
168166
WITH_VALGRIND: no
169167
ECDH: yes
170168
RECOVERY: yes
@@ -185,9 +183,8 @@ task:
185183
cpu: 1
186184
memory: 1G
187185
env:
188-
QEMU_CMD: qemu-arm
186+
WRAPPER_CMD: qemu-arm
189187
HOST: arm-linux-gnueabihf
190-
BUILD:
191188
WITH_VALGRIND: no
192189
ECDH: yes
193190
RECOVERY: yes
@@ -209,9 +206,8 @@ task:
209206
cpu: 1
210207
memory: 1G
211208
env:
212-
QEMU_CMD: qemu-aarch64
209+
WRAPPER_CMD: qemu-aarch64
213210
HOST: aarch64-linux-gnu
214-
BUILD:
215211
WITH_VALGRIND: no
216212
ECDH: yes
217213
RECOVERY: yes
@@ -230,9 +226,8 @@ task:
230226
cpu: 1
231227
memory: 1G
232228
env:
233-
WINE_CMD: wine64-stable
229+
WRAPPER_CMD: wine64-stable
234230
HOST: x86_64-w64-mingw32
235-
BUILD:
236231
WITH_VALGRIND: no
237232
ECDH: yes
238233
RECOVERY: yes
@@ -260,7 +255,8 @@ task:
260255
matrix:
261256
- name: "Valgrind (memcheck)"
262257
env:
263-
RUN_VALGRIND: yes
258+
# 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)
259+
WRAPPER_CMD: "valgrind --error-exitcode=42"
264260
- name: "UBSan, ASan, LSan"
265261
env:
266262
CFLAGS: "-fsanitize=undefined,address"

ci/cirrus.sh

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,45 +29,18 @@ file *tests* || true
2929
file bench_* || true
3030
file .libs/* || true
3131

32-
if [ -n "$BUILD" ]
33-
then
34-
make "$BUILD"
35-
fi
36-
37-
if [ "$RUN_VALGRIND" = "yes" ]
38-
then
39-
# 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)
40-
valgrind --error-exitcode=42 ./tests 16
41-
valgrind --error-exitcode=42 ./exhaustive_tests
42-
fi
43-
44-
if [ -n "$QEMU_CMD" ]
45-
then
46-
$QEMU_CMD ./tests 16
47-
$QEMU_CMD ./exhaustive_tests
48-
fi
32+
# This tells `make check` to wrap test invocations.
33+
export LOG_COMPILER="$WRAPPER_CMD"
4934

50-
if [ -n "$WINE_CMD" ]
51-
then
52-
$WINE_CMD ./tests 16
53-
$WINE_CMD ./exhaustive_tests
54-
fi
35+
make "$BUILD"
5536

5637
if [ "$BENCH" = "yes" ]
5738
then
5839
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
5940
EXEC='./libtool --mode=execute'
60-
if [ -n "$QEMU_CMD" ]
61-
then
62-
EXEC="$EXEC $QEMU_CMD"
63-
fi
64-
if [ "$RUN_VALGRIND" = "yes" ]
65-
then
66-
EXEC="$EXEC valgrind --error-exitcode=42"
67-
fi
68-
if [ -n "$WINE_CMD" ]
41+
if [ -n "$WRAPPER_CMD" ]
6942
then
70-
EXEC="$WINE_CMD"
43+
EXEC="$EXEC $WRAPPER_CMD"
7144
fi
7245
# This limits the iterations in the benchmarks below to ITER iterations.
7346
export SECP256K1_BENCH_ITERS="$ITERS"

0 commit comments

Comments
 (0)