Skip to content

Commit

Permalink
[SECP256K1] Check if variable=yes instead of if var is set in travis
Browse files Browse the repository at this point in the history
Summary:
```
Right now travis.sh checks if VALGRIND and CTIMETEST are set or not, but
in travis.yml we explictly set them to yes so I think it's more
intuitive to check if they're equal to yes such that setting
CTIMETEST=no(or anything other than "yes") will disable the test.

pointed out by @real-or-random here: #696 (comment)
```

Backport of secp256k1 [[bitcoin-core/secp256k1#782 | PR782]].

Includes the missing CTIMETEST variable for s390x.

Depends on D7630.

Test Plan: Run the Travis build.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7631
  • Loading branch information
elichai authored and Fabcien committed Sep 29, 2020
1 parent b0c5519 commit 46c5de3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/secp256k1/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ env:
- BIGNUM=no
- BIGNUM=no ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes MULTISET=yes
- BIGNUM=no STATICPRECOMPUTATION=no
- AUTOTOOLS_TARGET=distcheck CMAKE_TARGET=install CTIMETEST= BENCH=
- AUTOTOOLS_TARGET=distcheck CMAKE_TARGET=install CTIMETEST=no BENCH=no
- AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DDETERMINISTIC CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DDETERMINISTIC
- AUTOTOOLS_EXTRA_FLAGS=CFLAGS=-O0 CMAKE_EXTRA_FLAGS=-DCMAKE_BUILD_TYPE=Debug CTIMETEST=
- AUTOTOOLS_TARGET=check-java CMAKE_TARGET=check-secp256k1-java JNI=yes ECDH=yes EXPERIMENTAL=yes CTIMETEST= BENCH=
- AUTOTOOLS_EXTRA_FLAGS=CFLAGS=-O0 CMAKE_EXTRA_FLAGS=-DCMAKE_BUILD_TYPE=Debug CTIMETEST=no
- AUTOTOOLS_TARGET=check-java CMAKE_TARGET=check-secp256k1-java JNI=yes ECDH=yes EXPERIMENTAL=yes CTIMETEST=no BENCH=no
- ECMULTGENPRECISION=2
- ECMULTGENPRECISION=8
- VALGRIND=yes
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
# S390x build (big endian system)
- dist: focal
compiler: gcc
env: HOST=s390x-unknown-linux-gnu OPENSSL_TESTS=no ECDH=yes RECOVERY=yes EXPERIMENTAL=yes MULTISET=yes CTIMETEST=
env: HOST=s390x-unknown-linux-gnu OPENSSL_TESTS=no ECDH=yes RECOVERY=yes EXPERIMENTAL=yes MULTISET=yes CTIMETEST=no
arch: s390x
addons:
apt:
Expand Down
8 changes: 4 additions & 4 deletions src/secp256k1/travis/build_autotools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ trap 'print_logs' ERR

make -j2 $AUTOTOOLS_TARGET

if [ -n "$VALGRIND" ]; then
if [ "$VALGRIND" = "yes" ]; then
# 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)
valgrind --error-exitcode=42 ./tests 16
valgrind --error-exitcode=42 ./exhaustive_tests
fi

if [ -n "$BENCH" ]; then
if [ -n "$VALGRIND" ]; then
if [ "$BENCH" = "yes" ]; then
if [ "$VALGRIND" = "yes" ]; then
# Using the local `libtool` because on macOS the system's libtool has
# nothing to do with GNU libtool
EXEC='./libtool --mode=execute valgrind --error-exitcode=42';
Expand All @@ -91,7 +91,7 @@ if [ -n "$BENCH" ]; then
$EXEC ./bench_multiset >> bench.log 2>&1
fi
fi
if [ -n "$CTIMETEST" ]; then
if [ "$CTIMETEST" = "yes" ]; then
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
fi

Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/travis/build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ${CMAKE_COMMAND} -GNinja .. \

ninja $CMAKE_TARGET

if [ -n "$VALGRIND" ]; then
if [ "$VALGRIND" = "yes" ]; then
# 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)
Expand Down

0 comments on commit 46c5de3

Please sign in to comment.