travis-test.sh 1.36 KB
Newer Older
Tamir Duberstein's avatar
Tamir Duberstein committed
1
#!/usr/bin/env bash
2 3 4 5 6 7

# Exit on any error.
set -e

test_version() {
  version=$1
8

9
  RUBY_CONFORMANCE=test_ruby
10

Feng Xiao's avatar
Feng Xiao committed
11
  if [ "$version" == "jruby-1.7" ] ; then
12 13
    # No conformance tests yet -- JRuby is too broken to run them.
    bash --login -c \
14
      "rvm install $version && rvm use $version && rvm get head && \
15
       which ruby && \
16
       git clean -f && \
17 18
       gem install bundler && bundle && \
       rake test"
Paul Yang's avatar
Paul Yang committed
19 20 21 22 23 24 25 26
  elif [ "$version" == "ruby-2.6.0" ] ; then
    bash --login -c \
      "rvm install $version && rvm use $version && \
       which ruby && \
       git clean -f && \
       gem install bundler -v 1.17.3 && bundle && \
       rake test &&
       rake gc_test &&
27
       cd ../conformance && make ${RUBY_CONFORMANCE} &&
Paul Yang's avatar
Paul Yang committed
28 29
       cd ../ruby/compatibility_tests/v3.0.0 &&
       cp -R ../../lib lib && ./test.sh"
30
  else
31 32
    # Recent versions of OSX have deprecated OpenSSL, so we have to explicitly
    # provide a path to the OpenSSL directory installed via Homebrew.
33
    bash --login -c \
34 35
      "rvm install $version --with-openssl-dir=`brew --prefix openssl` && \
       rvm use $version && \
36
       which ruby && \
37
       git clean -f && \
Paul Yang's avatar
Paul Yang committed
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
}

46
test_version $1