travis-test.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. return 0
  16. if [ "$version" == "jruby-1.7" ] ; then
  17. # No conformance tests yet -- JRuby is too broken to run them.
  18. bash --login -c \
  19. "rvm install $version && rvm use $version && rvm get head && \
  20. which ruby && \
  21. git clean -f && \
  22. gem install bundler && bundle && \
  23. rake test"
  24. elif [ "$version" == "ruby-2.6.0" ] ; then
  25. bash --login -c \
  26. "rvm install $version && rvm use $version && \
  27. which ruby && \
  28. git clean -f && \
  29. gem install bundler -v 1.17.3 && bundle && \
  30. rake test &&
  31. rake gc_test &&
  32. cd ../conformance && make ${RUBY_CONFORMANCE} &&
  33. cd ../ruby/compatibility_tests/v3.0.0 &&
  34. cp -R ../../lib lib && ./test.sh"
  35. else
  36. bash --login -c \
  37. "rvm install $version && rvm use $version && \
  38. which ruby && \
  39. git clean -f && \
  40. gem install bundler -v 1.17.3 && bundle && \
  41. rake test &&
  42. rake gc_test &&
  43. cd ../conformance && make ${RUBY_CONFORMANCE} &&
  44. cd ../ruby/compatibility_tests/v3.0.0 && ./test.sh"
  45. fi
  46. }
  47. test_version $1