expecting errors
authorJason Etheridge <jason@esilibrary.com>
Wed, 5 Mar 2014 16:23:00 +0000 (11:23 -0500)
committerJason Etheridge <jason@esilibrary.com>
Wed, 5 Mar 2014 16:23:00 +0000 (11:23 -0500)
Tighten down the handling of expected errors, and communicate when there is a
mismatch (in addition to Failing the section).

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
qa/test_output_webifier.pl

index 9304de6..11a8463 100755 (executable)
@@ -144,9 +144,15 @@ sub print_pass_or_fail {
     my $subpage = shift;
     my $exception = {}; # keyed on subpage, value = # of expected errors
     $exception{'Installing Evergreen pre-requisites'} = 3;
+    if (! defined $exception{$subpage}) {
+        $exception{$subpage} = 0;
+    }
     #print "subpage = <$subpage> error_count = $error_count\n";
-    if ($error_count && $error_count > $exception{$subpage} ) {
+    if ($error_count && $error_count != $exception{$subpage} ) {
         print MAIN_PAGE ' - <span class="fail">Failed</span>';
+        if ($exception{$subpage} > 0) {
+            print MAIN_PAGE " - Expected $exception{$subpage} errors but encountered $error_count."
+        }
         print PASS_FAIL "Failed\n";
     } else {
         if ($subpage_count) {