Skip to content

Commit c93a8d9

Browse files
committed
Add running benchmarks regularly and under valgrind in travis
1 parent 60f3d4d commit c93a8d9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ compiler:
1111
- gcc
1212
env:
1313
global:
14-
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ECMULTGENPRECISION=auto ASM=no BUILD=check EXTRAFLAGS= HOST= ECDH=no RECOVERY=no EXPERIMENTAL=no CTIMETEST=yes
14+
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ECMULTGENPRECISION=auto ASM=no BUILD=check EXTRAFLAGS= CPPFLAGS=-DITERS=1 HOST= ECDH=no RECOVERY=no EXPERIMENTAL=no CTIMETEST=yes BENCH=yes
1515
matrix:
1616
- SCALAR=32bit RECOVERY=yes
1717
- SCALAR=32bit FIELD=32bit ECDH=yes EXPERIMENTAL=yes
@@ -26,7 +26,7 @@ env:
2626
- BIGNUM=no ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes
2727
- BIGNUM=no STATICPRECOMPUTATION=no
2828
- BUILD=distcheck CTIMETEST=
29-
- EXTRAFLAGS=CPPFLAGS=-DDETERMINISTIC
29+
- CPPFLAGS="-DDETERMINISTIC -DITERS=1"
3030
- EXTRAFLAGS=CFLAGS=-O0
3131
- ECMULTGENPRECISION=2
3232
- ECMULTGENPRECISION=8
@@ -74,18 +74,18 @@ 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 -DITERS=1" BUILD=
7878
- compiler: gcc
7979
env: # The same as above but without endomorphism.
8080
- BIGNUM=no ENDOMORPHISM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes
81-
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests CPPFLAGS=-DVALGRIND" BUILD=
81+
- VALGRIND=yes EXTRAFLAGS="--disable-openssl-tests" CPPFLAGS="-DVALGRIND -DITERS=1" BUILD=
8282

8383
before_script: ./autogen.sh
8484

8585
script:
8686
- if [ -n "$HOST" ]; then export USE_HOST="--host=$HOST"; fi
8787
- 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
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 CPPFLAGS="$CPPFLAGS" $EXTRAFLAGS $USE_HOST
8989
- if [ -n "$BUILD" ]; then make -j2 $BUILD; fi
9090
- # 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)
9191
- # 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)
@@ -94,6 +94,12 @@ script:
9494
travis_wait 30 valgrind --error-exitcode=42 ./tests 16 &&
9595
travis_wait 30 valgrind --error-exitcode=42 ./exhaustive_tests;
9696
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
97103
- if [ -n "$CTIMETEST" ]; then
98104
libtool --mode=execute valgrind ./valgrind_ctime_test &> valgrind_ctime_test.log;
99105
fi
@@ -102,3 +108,4 @@ after_script:
102108
- cat ./tests.log
103109
- cat ./exhaustive_tests.log
104110
- cat ./valgrind_ctime_test.log
111+
- cat ./bench.log

0 commit comments

Comments
 (0)