travis-test.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. bash --login -c \
  36. "rvm install $version && rvm use $version && \
  37. which ruby && \
  38. git clean -f && \
  39. gem install bundler -v 1.17.3 && bundle && \
  40. rake test &&
  41. rake gc_test &&
  42. cd ../conformance && make ${RUBY_CONFORMANCE} &&
  43. cd ../ruby/compatibility_tests/v3.0.0 && ./test.sh"
  44. fi
  45. }
  46. test_version $1