travis-test.sh 1.6 KB

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