You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

travis.sh 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/sh
  2. set -e
  3. set -x
  4. if [ "$HOST" = "i686-linux-gnu" ]
  5. then
  6. export CC="$CC -m32"
  7. fi
  8. if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
  9. then
  10. export CC="gcc-9"
  11. fi
  12. ./configure \
  13. --enable-experimental="$EXPERIMENTAL" \
  14. --with-test-override-wide-multiply="$WIDEMUL" --with-bignum="$BIGNUM" --with-asm="$ASM" \
  15. --enable-ecmult-static-precomputation="$STATICPRECOMPUTATION" --with-ecmult-gen-precision="$ECMULTGENPRECISION" \
  16. --enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \
  17. --enable-module-schnorrsig="$SCHNORRSIG" \
  18. --with-valgrind="$WITH_VALGRIND" \
  19. --host="$HOST" $EXTRAFLAGS
  20. if [ -n "$BUILD" ]
  21. then
  22. make -j2 "$BUILD"
  23. fi
  24. if [ "$RUN_VALGRIND" = "yes" ]
  25. then
  26. make -j2
  27. # 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)
  28. valgrind --error-exitcode=42 ./tests 16
  29. valgrind --error-exitcode=42 ./exhaustive_tests
  30. fi
  31. if [ "$BENCH" = "yes" ]
  32. then
  33. if [ "$RUN_VALGRIND" = "yes" ]
  34. then
  35. # Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
  36. EXEC='./libtool --mode=execute valgrind --error-exitcode=42'
  37. else
  38. EXEC=
  39. fi
  40. # This limits the iterations in the benchmarks below to ITER(set in .travis.yml) iterations.
  41. export SECP256K1_BENCH_ITERS="$ITERS"
  42. {
  43. $EXEC ./bench_ecmult
  44. $EXEC ./bench_internal
  45. $EXEC ./bench_sign
  46. $EXEC ./bench_verify
  47. } >> bench.log 2>&1
  48. if [ "$RECOVERY" = "yes" ]
  49. then
  50. $EXEC ./bench_recover >> bench.log 2>&1
  51. fi
  52. if [ "$ECDH" = "yes" ]
  53. then
  54. $EXEC ./bench_ecdh >> bench.log 2>&1
  55. fi
  56. if [ "$SCHNORRSIG" = "yes" ]
  57. then
  58. $EXEC ./bench_schnorrsig >> bench.log 2>&1
  59. fi
  60. fi
  61. if [ "$CTIMETEST" = "yes" ]
  62. then
  63. ./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
  64. fi