Skip to content

Commit

Permalink
Test correctness is socially constructed.
Browse files Browse the repository at this point in the history
  • Loading branch information
evan committed Sep 7, 2012
1 parent 0f0402d commit ffe1b23
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
35 changes: 27 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,42 @@ task :valgrind do
exec("ruby #{File.dirname(__FILE__)}/test/profile/valgrind.rb")
end

def with_vms(cmd)
["/usr/bin/ruby", "/opt/local/bin/ruby1.9", "/usr/local/rubinius/1.2.4/bin/rbx"].each do |vm|
bindir = vm.split("/")[0..-2].join("/")
puts "#{vm} #{cmd} started"
if File.exist?("#{bindir}/rake") && system("bash --norc --noprofile -c 'export PATH=#{bindir}:/bin:/usr/bin && which rake && #{bindir}/rake clean && #{bindir}/rake compile && #{bindir}/rake #{cmd}'")
puts "#{vm} #{cmd} complete"
def with_vm(vm, cmd)
bindir = vm.split("/")[0..-2].join("/")
puts "#{vm} #{cmd} started"
if !File.exist?("#{bindir}/rake")
puts "#{vm} not found"
exit(1)
elsif system("bash --norc --noprofile -c 'export PATH=#{bindir}:/bin:/usr/bin && which rake && #{bindir}/rake clean && #{bindir}/rake compile'")
puts "#{vm} compiled"
if system("bash --norc --noprofile -c 'export PATH=#{bindir}:/bin:/usr/bin && #{bindir}/rake #{cmd}'")
puts "#{vm} #{cmd} success (1st try)"
elsif system("bash --norc --noprofile -c 'export PATH=#{bindir}:/bin:/usr/bin && #{bindir}/rake #{cmd}'")
puts "#{vm} #{cmd} success (2nd try)"
else
puts "#{vm} #{cmd} failed"
exit(1)
end
else
puts "#{vm} compilation failed"
exit(1)
end
end

task :test_all do
with_vms("test")
task :test_18 do
with_vm("/usr/bin/ruby", "test")
end

task :test_19 do
with_vm("/opt/local/bin/ruby1.9", "test")
end

task :test_rbx do
with_vm("/usr/local/rubinius/1.2.4/bin/rbx", "test")
end

task :test_all => [:test_18, :test_19, :test_rbx]

task :prerelease => [:test_all]

task :benchmark_all do
Expand Down
Loading

0 comments on commit ffe1b23

Please sign in to comment.