Sha256: c8a0ad4f9c079b9a8489bdbe4c86f2a2701451ce1236519968137fb66241230c

Contents?: true

Size: 1.92 KB

Versions: 6

Compression:

Stored size: 1.92 KB

Contents

#! /usr/bin/env bash
#
#  script to run tests on all relevant rubies, and valgrind on supported rubies.
#  outputs tests to `test.log` and valgrind output to `valgrind.log`.
#
#  requires `rvm` to be installed. sorry about that, multiruby dudes.
#

RUBIES="ruby-1.9.3-p194 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"
TEST_LOG=test.log
VALGRIND_LOG=valgrind.log

# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
    source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
    source "/usr/local/rvm/scripts/rvm"
else
    echo "ERROR: An RVM installation was not found.\n"
fi

> $TEST_LOG
> $VALGRIND_LOG
set -o errexit

function rvm_use {
    current_ruby=$1
    rvm use "${1}@nokogiri" --create
}

function generate_parser_and_tokenizer {
    old_ruby=$current_ruby
    rvm_use ruby-1.8.7-p357
    bundle exec rake generate 2>&1 > /dev/null
    rvm_use $old_ruby
}

function clean {
    bundle exec rake clean clobber 2>&1 > /dev/null
}

function compile {
    echo "** compiling ..."
    # generate_parser_and_tokenizer
    bundle exec rake compile 2>&1 > /dev/null
}

for ruby in $RUBIES ; do
    rvm_use ${ruby}
    if gem list bundler | fgrep -v 1.1.rc 2>&1 > /dev/null ; then
        gem install bundler
    fi
    bundle install --quiet --local || bundle install
    clean
done

for ruby in $RUBIES ; do
    rvm_use ${ruby}
    echo -e "**\n** testing nokogiri on ${ruby}\n**" | tee -a $TEST_LOG
    clean
    compile
    echo "** running tests ..."
    bundle exec rake test 2>&1 | tee -a $TEST_LOG
    clean
done

for ruby in $RUBIES ; do
    if [[ ! $ruby =~ "jruby" ]] ; then
        rvm_use ${ruby}
        echo -e "**\n** nokogiri prerelease: ${ruby}\n**" | tee -a $VALGRIND_LOG
        clean
        compile
        echo "** running valgrind on tests ..."
        bundle exec rake test:valgrind 2>&1 | tee -a $VALGRIND_LOG
        clean
    fi
done

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nokogiri-1.5.6.rc2 test_all
nokogiri-1.5.6.rc2-x86-mswin32-60 test_all
nokogiri-1.5.6.rc2-x86-mingw32 test_all
nokogiri-1.5.6.rc2-java test_all
nokogiri-1.5.6.rc1 test_all
nokogiri-1.5.6.rc1-java test_all