protobuf/ruby/travis-test.sh
Paul Yang cd5f49d094 Fix ruby segment fault (#3708)
* Fix ruby segment fault

1) rb_ary_new cannot be called during allocate function. During allocate
fucntion, the containing object hasn't been marked and rb_ary_new may
invoke gc to collect containing object.
2) The global map should be marked before allocating it. Otherwise it
may be garbage collected.

* Add test

* Remove commented code

* Fix grammer error
2017-10-03 17:28:49 -07:00

30 lines
732 B
Bash
Executable File

#!/usr/bin/env bash
# Exit on any error.
set -e
test_version() {
version=$1
if [ "$version" == "jruby-1.7" ] ; then
# No conformance tests yet -- JRuby is too broken to run them.
bash --login -c \
"rvm install $version && rvm use $version && rvm get head && \
which ruby && \
git clean -f && \
gem install bundler && bundle && \
rake test"
else
bash --login -c \
"rvm install $version && rvm use $version && \
which ruby && \
git clean -f && \
gem install bundler && bundle && \
rake test &&
rake gc_test &&
cd ../conformance && make test_ruby &&
cd ../ruby/compatibility_tests/v3.0.0 && ./test.sh"
fi
}
test_version $1