Skip to content

Commit

Permalink
A hacky way to run all the builds in the travis "matrix".
Browse files Browse the repository at this point in the history
Not currently loading `.travis.yml`.

Found I had to additionally ignore `Gemfile.minitest.1.4.1` and
`Gemfile.test-unit.latest`. Not sure why I had to do the former, but the
latter is because a new version of `test-unit` is out which is currently
not supported by `mocha`.
  • Loading branch information
floehopper committed Jul 13, 2012
1 parent 9c7dde2 commit 1d8a8f3
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions build-matrix.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env ruby

def execute(*commands)
commands.each do |command|
system(command)
unless $?.success?
message = [
"Executing shell command failed.",
" Command: #{command}",
" Status: #{$?.exitstatus}"
].join("\n")
raise message
end
end
end

def reset_bundle
execute(
"rm -rf .bundle/gems",
"rm -rf gemfiles/.bundle/gems",
"rm -f *.lock",
"rm -f gemfiles/*.lock"
)
end

def run(gemfile)
ENV["BUNDLE_GEMFILE"] = gemfile
ENV["MOCHA_OPTIONS"] = "debug"
reset_bundle
execute(
"bundle install --gemfile=#{gemfile}",
"bundle exec rake test"
)
end

EXCLUDED_MINITEST_GEMFILES = [
"gemfiles/Gemfile.minitest.1.3.0",
"gemfiles/Gemfile.minitest.1.4.0",
"gemfiles/Gemfile.minitest.1.4.1",
"gemfiles/Gemfile.minitest.1.4.2",
"gemfiles/Gemfile.test-unit.latest",
]

reset_bundle
Dir["gemfiles/Gemfile.*"].each do |gemfile|
next if (RUBY_VERSION == "1.9.3") && EXCLUDED_MINITEST_GEMFILES.include?(gemfile)
p [RUBY_VERSION, gemfile]
run(gemfile)
end

0 comments on commit 1d8a8f3

Please sign in to comment.