Skip to content

Commit

Permalink
Fix the Rakefile so that test suites will still complete if individua…
Browse files Browse the repository at this point in the history
…l files bail out.
  • Loading branch information
treed committed Aug 27, 2009
1 parent ad14323 commit 8d2377f
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions Rakefile
Expand Up @@ -34,6 +34,8 @@ $toomany_files = []
$issue_counts = Hash.new(0)
$issue_lacks = 0
$i_l_files = []
$comp_fails = 0
$c_f_files = []
$pl = false
$start = Time.now
$meta = Hash.new
Expand All @@ -46,6 +48,7 @@ def clean?
return false if $missing > 0
return false if $toomany > 0
return false if $issue_lacks > 0
return false if $comp_fails > 0
return true
end

Expand Down Expand Up @@ -96,7 +99,13 @@ def test(file, name="")
unless File.exists?('cardinal.pbc')
Task['cardinal.pbc'].invoke
end
parrot("t/#{file}", "t/#{pir_file}", "cardinal.pbc", "pir")
begin
parrot("t/#{file}", "t/#{pir_file}", "cardinal.pbc", "pir")
rescue RuntimeError
File.open("t/#{pir_file}",'w') do |f|
f.write(".sub main :main\nsay 'FAILED TO COMPILE'\n.end")
end
end
end
puts "named #{name}" if DEBUG
task name => [:config, "t/#{pir_file}", "cardinal.pbc", "Test.pir"] do |t|
Expand Down Expand Up @@ -187,7 +196,13 @@ def run_test(file,name="")
$toomany_files += [file]
end
else
result = "Complete failure... no plan given"
if plan =~ /FAILED TO COMPILE/
result = "Complete failure... failed to compile."
$comp_fails += 1
$c_f_files += [file]
else
result = "Complete failure... no plan given"
end
$failures += 1
end
report_file.close if $report
Expand Down Expand Up @@ -502,6 +517,14 @@ namespace :test do |ns|
puts " #{file}"
end
end
$pl = $comp_fails > 1
unless $c_f_files.empty?
puts " There #{were} #{$comp_fails} #{pl "file"} that completely failed to compile:"
$c_f_files.uniq!
$c_f_files.each do |file|
puts " #{file}"
end
end
puts " -- CLEAN FOR COMMIT --" if clean?
end

Expand Down

0 comments on commit 8d2377f

Please sign in to comment.