Skip to content

Commit b6807d9

Browse files
committed
Move travis script into a standalone sh file
1 parent f39f99b commit b6807d9

File tree

2 files changed

+65
-26
lines changed

2 files changed

+65
-26
lines changed

.travis.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ env:
2626
- BIGNUM=no ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes
2727
- BIGNUM=no STATICPRECOMPUTATION=no
2828
- BUILD=distcheck CTIMETEST= BENCH=
29-
- EXTRAFLAGS=CPPFLAGS=-DDETERMINISTIC
30-
- EXTRAFLAGS=CFLAGS=-O0
29+
- CPPFLAGS=-DDETERMINISTIC
30+
- CFLAGS=-O0 CTIMETEST=
3131
- ECMULTGENPRECISION=2
3232
- ECMULTGENPRECISION=8
3333
matrix:
@@ -74,35 +74,16 @@ matrix:
7474
- compiler: gcc
7575
env:
7676
- BIGNUM=no ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
77-
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests CPPFLAGS=-DVALGRIND" BUILD=
77+
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
7878
- compiler: gcc
7979
env: # The same as above but without endomorphism.
80-
- BIGNUM=no ENDOMORPHISM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
81-
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests CPPFLAGS=-DVALGRIND" BUILD=
80+
- BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
81+
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS=-DVALGRIND BUILD=
8282

8383
before_script: ./autogen.sh
8484

85-
script:
86-
- if [ -n "$HOST" ]; then export USE_HOST="--host=$HOST"; fi
87-
- if [ "x$HOST" = "xi686-linux-gnu" ]; then export CC="$CC -m32"; fi
88-
- ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-asm=$ASM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --with-ecmult-gen-precision=$ECMULTGENPRECISION --enable-module-ecdh=$ECDH --enable-module-recovery=$RECOVERY $EXTRAFLAGS $USE_HOST
89-
- if [ -n "$BUILD" ]; then make -j2 $BUILD; fi
90-
- # travis_wait extends the 10 minutes without output allowed (https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received)
91-
- # 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)
92-
- if [ -n "$VALGRIND" ]; then
93-
make -j2 &&
94-
travis_wait 30 valgrind --error-exitcode=42 ./tests 16 &&
95-
travis_wait 30 valgrind --error-exitcode=42 ./exhaustive_tests;
96-
fi
97-
- if [ -n "$BENCH" ]; then
98-
if [ -n "$VALGRIND" ]; then EXEC='libtool --mode=execute valgrind --error-exitcode=42'; else EXEC= ; fi &&
99-
$EXEC ./bench_ecmult &>> bench.log && $EXEC ./bench_internal &>> bench.log && $EXEC ./bench_sign &>> bench.log && $EXEC ./bench_verify &>> bench.log &&
100-
if [ "$RECOVERY" == "yes" ]; then $EXEC ./bench_recover &>> bench.log; fi &&
101-
if [ "$ECDH" == "yes" ]; then $EXEC ./bench_ecdh &>> bench.log; fi;
102-
fi
103-
- if [ -n "$CTIMETEST" ]; then
104-
libtool --mode=execute valgrind ./valgrind_ctime_test &> valgrind_ctime_test.log;
105-
fi
85+
# travis_wait extends the 10 minutes without output allowed (https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received)
86+
script: travis_wait 30 ./contrib/travis.sh
10687

10788
after_script:
10889
- cat ./tests.log

contrib/travis.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -x
5+
6+
if [ -n "$HOST" ]
7+
then
8+
export USE_HOST="--host=$HOST"
9+
fi
10+
if [ "$HOST" = "i686-linux-gnu" ]
11+
then
12+
export CC="$CC -m32"
13+
fi
14+
15+
./configure \
16+
--enable-experimental="$EXPERIMENTAL" --enable-endomorphism="$ENDOMORPHISM" \
17+
--with-field="$FIELD" --with-bignum="$BIGNUM" --with-asm="$ASM" --with-scalar="$SCALAR" \
18+
--enable-ecmult-static-precomputation="$STATICPRECOMPUTATION" --with-ecmult-gen-precision="$ECMULTGENPRECISION" \
19+
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" "$EXTRAFLAGS" "$USE_HOST"
20+
21+
if [ -n "$BUILD" ]
22+
then
23+
make -j2 "$BUILD"
24+
fi
25+
if [ -n "$VALGRIND" ]
26+
then
27+
make -j2
28+
# 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)
29+
valgrind --error-exitcode=42 ./tests 16
30+
valgrind --error-exitcode=42 ./exhaustive_tests
31+
fi
32+
if [ -n "$BENCH" ]
33+
then
34+
if [ -n "$VALGRIND" ]
35+
then
36+
EXEC='libtool --mode=execute valgrind --error-exitcode=42'
37+
else
38+
EXEC=
39+
fi
40+
{
41+
$EXEC ./bench_ecmult
42+
$EXEC ./bench_internal
43+
$EXEC ./bench_sign
44+
$EXEC ./bench_verify
45+
} >> bench.log 2>&1
46+
if [ "$RECOVERY" = "yes" ]
47+
then
48+
$EXEC ./bench_recover >> bench.log 2>&1
49+
fi
50+
if [ "$ECDH" = "yes" ]
51+
then
52+
$EXEC ./bench_ecdh >> bench.log 2>&1
53+
fi
54+
fi
55+
if [ -n "$CTIMETEST" ]
56+
then
57+
libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
58+
fi

0 commit comments

Comments
 (0)