Skip to content

Commit

Permalink
Change travis.sh to check if variables are equal to yes instead of
Browse files Browse the repository at this point in the history
not-empty.
Before this, setting `VALGRIND=wat` was considered as true, and to make it
evaluate as false you had to unset the variable `VALGRIND=` but not it
checks if `VALGRIND=yes` and if it's not `yes` then it's evaluated to
false
  • Loading branch information
elichai committed Aug 3, 2020
1 parent 6034a04 commit ef37761
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ if [ -n "$BUILD" ]
then
make -j2 "$BUILD"
fi
if [ -n "$VALGRIND" ]
if [ "$VALGRIND" = "yes" ]
then
make -j2
# 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" ]
if [ "$BENCH" = "yes" ]
then
if [ -n "$VALGRIND" ]
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 @@ -56,7 +56,7 @@ then
$EXEC ./bench_ecdh >> bench.log 2>&1
fi
fi
if [ -n "$CTIMETEST" ]
if [ "$CTIMETEST" = "yes" ]
then
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
fi

0 comments on commit ef37761

Please sign in to comment.