Skip to content
This repository
Newer
Older
100755 78 lines (67 sloc) 1.97 kb
e56964ce »
2012-02-27 `prerelease` script helps determine the worthiness of a commit for re…
1 #! /usr/bin/env bash
2 #
3 # script to run tests on all relevant rubies, and valgrind on supported rubies.
4 # outputs tests to `test.log` and valgrind output to `valgrind.log`.
5 #
6 # requires `rvm` to be installed. sorry about that, multiruby dudes.
7 #
8
bd65c806 »
2012-06-23 testing more specific versions of rubies, so we can test jruby in bot…
9 RUBIES="ruby-1.9.3-p0 jruby-1.6.5.1 jruby-1.6.7.2 ree-1.8.7-2011.12 ruby-1.9.2-p290 ruby-1.8.7-p357"
e56964ce »
2012-02-27 `prerelease` script helps determine the worthiness of a commit for re…
10 TEST_LOG=test.log
11 VALGRIND_LOG=valgrind.log
12
13 # Load RVM into a shell session *as a function*
14 if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
15 source "$HOME/.rvm/scripts/rvm"
16 elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
17 source "/usr/local/rvm/scripts/rvm"
18 else
19 echo "ERROR: An RVM installation was not found.\n"
20 fi
21
22 > $TEST_LOG
23 > $VALGRIND_LOG
24 set -o errexit
25
26 function rvm_use {
27 current_ruby=$1
28 rvm use "${1}@nokogiri" --create
29 }
30
31 function generate_parser_and_tokenizer {
32 old_ruby=$current_ruby
bd65c806 »
2012-06-23 testing more specific versions of rubies, so we can test jruby in bot…
33 rvm_use ruby-1.8.7-p357
e56964ce »
2012-02-27 `prerelease` script helps determine the worthiness of a commit for re…
34 bundle exec rake generate 2>&1 > /dev/null
35 rvm_use $old_ruby
36 }
37
38 function clean {
39 bundle exec rake clean clobber 2>&1 > /dev/null
40 }
41
42 function compile {
43 echo "** compiling ..."
bd65c806 »
2012-06-23 testing more specific versions of rubies, so we can test jruby in bot…
44 # generate_parser_and_tokenizer
e56964ce »
2012-02-27 `prerelease` script helps determine the worthiness of a commit for re…
45 bundle exec rake compile 2>&1 > /dev/null
46 }
47
48 for ruby in $RUBIES ; do
49 rvm_use ${ruby}
50 if gem list bundler | fgrep -v 1.1.rc 2>&1 > /dev/null ; then
51 gem install bundler --pre
52 fi
53 bundle install --quiet --local || bundle install
54 clean
55 done
56
57 for ruby in $RUBIES ; do
58 rvm_use ${ruby}
0b396598 »
2012-03-22 Improved test_all output.
59 echo -e "**\n** testing nokogiri on ${ruby}\n**" | tee -a $TEST_LOG
e56964ce »
2012-02-27 `prerelease` script helps determine the worthiness of a commit for re…
60 clean
61 compile
62 echo "** running tests ..."
bd65c806 »
2012-06-23 testing more specific versions of rubies, so we can test jruby in bot…
63 bundle exec rake test 2>&1 | tee -a $TEST_LOG
e56964ce »
2012-02-27 `prerelease` script helps determine the worthiness of a commit for re…
64 clean
65 done
66
67 for ruby in $RUBIES ; do
68 if [[ ! $ruby =~ "jruby" ]] ; then
69 rvm_use ${ruby}
0b396598 »
2012-03-22 Improved test_all output.
70 echo -e "**\n** nokogiri prerelease: ${ruby}\n**" | tee -a $VALGRIND_LOG
e56964ce »
2012-02-27 `prerelease` script helps determine the worthiness of a commit for re…
71 clean
72 compile
73 echo "** running valgrind on tests ..."
74 bundle exec rake test:valgrind 2>&1 | tee -a $VALGRIND_LOG
75 clean
76 fi
77 done
Something went wrong with that request. Please try again.