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