3 # This script recalculates points according to grouping of testcases.
4 # This is no longer necessary, because the score table and report generators
5 # already know how to handle merging of groups, but we still keep it as an example.
7 @ARGV == 1 or die "Usage: mo-merge <task>\n";
9 foreach my $s (`ls -d testing/*/$task`) {
11 if (! -s "$s/points.old") {
13 rename "$s/points", "$s/points.old" or die "Rename $s/points failed: $!";
15 print "$s: NO POINTS?\n";
19 open X, "$s/points.old" or die;
24 my ($test, $subtest, $pts, $cmt) = /^(\d+)([a-z]*)\s+(\d+)\s*(.*)/ or die;
25 if (!exists($tests{$test}) || $tests{$test} > $pts) {
31 open X, ">$s/points" or die;
32 foreach my $test (sort { $a <=> $b } keys %tests) {
33 print X "$test $tests{$test} $cmts{$test}\n";