From 5bd27a2ff2d5b32a4d6aa3115fda63127164d1e3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 8 Nov 2011 10:23:21 +0000 Subject: test/aggregate: not all Ruby implementations support "-n" well At least my year-old Rubinius installation does not --- test/aggregate.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/aggregate.rb b/test/aggregate.rb index b0a1a50..a495c52 100644 --- a/test/aggregate.rb +++ b/test/aggregate.rb @@ -1,14 +1,14 @@ -#!/usr/bin/ruby -n +#!/usr/bin/ruby # -*- encoding: binary -*- -BEGIN { $tests = $assertions = $failures = $errors = 0 } +$tests = $assertions = $failures = $errors = 0 -$_ =~ /(\d+) tests, (\d+) assertions, (\d+) failures, (\d+) errors/ or next -$tests += $1.to_i -$assertions += $2.to_i -$failures += $3.to_i -$errors += $4.to_i +STDIN.each_line do |l| + l =~ /(\d+) tests, (\d+) assertions, (\d+) failures, (\d+) errors/ or next + $tests += $1.to_i + $assertions += $2.to_i + $failures += $3.to_i + $errors += $4.to_i +end -END { - printf("\n%d tests, %d assertions, %d failures, %d errors\n", - $tests, $assertions, $failures, $errors) -} +printf("\n%d tests, %d assertions, %d failures, %d errors\n", + $tests, $assertions, $failures, $errors) -- cgit v1.2.3-24-ge0c7