X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Fmake-grade;h=5f60fa3d1fe7edddbed270886228e6bd5881548a;hb=2f9044505b2103fb0f165341fcbeb3104289572e;hp=20e0cd9e3d7bf58b4787edbe4aa2b072297e57e1;hpb=a705e9ae16e14e24d313916a0c5402e175f8cce5;p=pintos-anon diff --git a/src/tests/make-grade b/src/tests/make-grade index 20e0cd9..5f60fa3 100755 --- a/src/tests/make-grade +++ b/src/tests/make-grade @@ -25,7 +25,7 @@ open (GRADING, '<', $grading_file) || die "$grading_file: open: $!\n"; while () { s/#.*//; next if /^\s*$/; - my ($max_pct, $rubric_suffix) = /^\s*(\d+)%\t(.*)/ or die; + my ($max_pct, $rubric_suffix) = /^\s*(\d+(?:\.\d+)?)%\t(.*)/ or die; my ($dir) = $rubric_suffix =~ /^(.*)\//; my ($rubric_file) = "$src_dir/$rubric_suffix"; open (RUBRIC, '<', $rubric_file) or die "$rubric_file: open: $!\n"; @@ -110,34 +110,43 @@ foreach my $name (keys (%verdicts)) { } } push (@overall, sprintf ("TOTAL TESTING SCORE: %.1f%%", $pct_actual)); +if (sprintf ("%.1f", $pct_actual) eq sprintf ("%.1f", $pct_possible)) { + push (@overall, "ALL TESTED PASSED -- PERFECT SCORE"); +} my (@divider) = ('', '- ' x 38, ''); print map ("$_\n", @overall, @divider, @summary, @divider, @rubrics); for my $test (@failures) { - open (RESULT, '<', "$test.result") or next; print map ("$_\n", @divider); print "DETAILS OF $test FAILURE:\n\n"; - my $first_line = ; - my ($cnt) = 0; - while () { - print; - $cnt++; + + if (open (RESULT, '<', "$test.result")) { + my $first_line = ; + my ($cnt) = 0; + while () { + print; + $cnt++; + } + close (RESULT); } - close (RESULT); - if ($cnt == 0) { - open (OUTPUT, '<', "$test.output") or next; - my ($panics) = 0; + if (open (OUTPUT, '<', "$test.output")) { + print "\nOUTPUT FROM $test:\n\n"; + + my ($panics, $boots) = (0, 0); while () { if (/PANIC/ && ++$panics > 2) { print "[...details of additional panic(s) omitted...]\n"; last; } print; + if (/Pintos booting/ && ++$boots > 1) { + print "[...details of reboot(s) omitted...]\n"; + last; + } } close (OUTPUT); } } -