travis-test.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env bash
  2. # Exit on any error.
  3. set -e
  4. test_version() {
  5. version=$1
  6. RUBY_CONFORMANCE=test_ruby
  7. if [ "$version" == "jruby-1.7" ] ; then
  8. # No conformance tests yet -- JRuby is too broken to run them.
  9. bash --login -c \
  10. "rvm install $version && rvm use $version && rvm get head && \
  11. which ruby && \
  12. git clean -f && \
  13. gem install bundler && bundle && \
  14. rake test"
  15. elif [ "$version" == "ruby-2.6.0" -o "$version" == "ruby-2.7.0" ] ; then
  16. bash --login -c \
  17. "rvm install $version && rvm use $version && \
  18. which ruby && \
  19. git clean -f && \
  20. gem install bundler -v 1.17.3 && bundle && \
  21. rake test &&
  22. rake gc_test &&
  23. cd ../conformance && make ${RUBY_CONFORMANCE} &&
  24. cd ../ruby/compatibility_tests/v3.0.0 &&
  25. cp -R ../../lib lib && ./test.sh"
  26. else
  27. # Recent versions of OSX have deprecated OpenSSL, so we have to explicitly
  28. # provide a path to the OpenSSL directory installed via Homebrew.
  29. bash --login -c \
  30. "rvm install $version --with-openssl-dir=`brew --prefix openssl` && \
  31. rvm use $version && \
  32. which ruby && \
  33. git clean -f && \
  34. gem install bundler -v 1.17.3 && bundle && \
  35. rake test &&
  36. rake gc_test &&
  37. cd ../conformance && make ${RUBY_CONFORMANCE} &&
  38. cd ../ruby/compatibility_tests/v3.0.0 && ./test.sh"
  39. fi
  40. }
  41. test_version $1