travis-test.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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-9.2.11.1" ] ; then
  8. bash --login -c \
  9. "rvm install $version && rvm use $version && rvm get head && \
  10. which ruby && \
  11. git clean -f && \
  12. gem install bundler && bundle && \
  13. rake test &&
  14. rake gc_test &&
  15. cd ../conformance && make test_jruby &&
  16. cd ../ruby/compatibility_tests/v3.0.0 && ./test.sh"
  17. elif [ "$version" == "ruby-2.6.0" -o "$version" == "ruby-2.7.0" -o "$version" == "ruby-3.0.0" ] ; then
  18. bash --login -c \
  19. "rvm install $version && rvm use $version && \
  20. which ruby && \
  21. git clean -f && \
  22. gem install bundler -v 1.17.3 && bundle && \
  23. rake test &&
  24. rake gc_test &&
  25. cd ../conformance && make ${RUBY_CONFORMANCE} &&
  26. cd ../ruby/compatibility_tests/v3.0.0 &&
  27. cp -R ../../lib lib && ./test.sh"
  28. else
  29. # Recent versions of OSX have deprecated OpenSSL, so we have to explicitly
  30. # provide a path to the OpenSSL directory installed via Homebrew.
  31. bash --login -c \
  32. "rvm install $version --with-openssl-dir=`brew --prefix openssl` && \
  33. rvm use $version && \
  34. which ruby && \
  35. git clean -f && \
  36. gem install bundler -v 1.17.3 && bundle && \
  37. rake test &&
  38. rake gc_test &&
  39. cd ../conformance && make ${RUBY_CONFORMANCE} &&
  40. cd ../ruby/compatibility_tests/v3.0.0 && ./test.sh"
  41. fi
  42. }
  43. test_version $1