#!/usr/bin/env bash # Exit on any error. set -e proc test_version { global version := $1 if test $version == "jruby-1.7" { # 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 && cd ../conformance && make test_ruby" } } test_version $1 (CommandList children: [ (C {(set)} {(-e)}) (FuncDef name: test_version body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:version) op: Equal rhs: {($ VSub_Number "$1")} spids: [19] ) ] spids: [19] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$version"))} {(Lit_Other "=") (Lit_Other "=")} {(DQ (jruby-1.7))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(bash)} {(--login)} {(-c)} { (DQ ("rvm install ") ($ VSub_Name "$version") (" && rvm use ") ($ VSub_Name "$version") (" && rvm get head && ") (" which ruby && ") (" git clean -f && ") (" gem install bundler && bundle && ") (" rake test") ) } ) ] spids: [-1 42] ) ] else_action: [ (C {(bash)} {(--login)} {(-c)} { (DQ ("rvm install ") ($ VSub_Name "$version") (" && rvm use ") ($ VSub_Name "$version") (" && ") (" which ruby && ") (" git clean -f && ") (" gem install bundler && bundle && ") (" rake test &&\n") (" cd ../conformance && make test_ruby") ) } ) ] spids: [74 103] ) ] spids: [16] ) spids: [12 15] ) (C {(test_version)} {($ VSub_Number "$1")}) ] )