From 61b1ce91f9676e6f81ea961a6e9d1b45ce3d1233 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 25 Mar 2007 17:54:40 +0000 Subject: [PATCH] Added a simple script for grouping of test cases. --- bin/mo-merge-tests | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 bin/mo-merge-tests diff --git a/bin/mo-merge-tests b/bin/mo-merge-tests new file mode 100755 index 0000000..0396a77 --- /dev/null +++ b/bin/mo-merge-tests @@ -0,0 +1,32 @@ +#!/usr/bin/perl + +@ARGV == 1 or die "Usage: mo-merge \n"; +my $task = $ARGV[0]; +foreach my $s (`ls -d testing/*/$task`) { + chomp $s; + if (! -s "$s/points.old") { + if (-s "$s/points") { + rename "$s/points", "$s/points.old" or die "Rename $s/points failed: $!"; + } else { + print "$s: NO POINTS?\n"; + next; + } + } + open X, "$s/points.old" or die; + my %tests = (); + my %cmts = (); + while () { + chomp; + my ($test, $subtest, $pts, $cmt) = /^(\d+)([a-z]*)\s+(\d+)\s*(.*)/ or die; + if (!exists($tests{$test}) || $tests{$test} > $pts) { + $tests{$test} = $pts; + $cmts{$test} = $cmt; + } + } + close X; + open X, ">$s/points" or die; + foreach my $test (sort { $a <=> $b } keys %tests) { + print X "$test $tests{$test} $cmts{$test}\n"; + } + close X; +} -- 2.39.5