Count test cases
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 14 Sep 2018 13:22:31 +0000 (09:22 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 14 Sep 2018 13:22:31 +0000 (09:22 -0400)
compiler/src/lib/tiger/tiger_test.ml

index 89376a3..fdab310 100644 (file)
@@ -180,6 +180,7 @@ let run tests =
         let output_value = Some produced in
         (execution_status, output_status, output_value)
   in
+  let test_case_count = ref 0 in
   List.iter tests ~f:(
     fun
       { name
@@ -189,6 +190,7 @@ let run tests =
       ; is_error_expected_semant
       }
     ->
+      incr test_case_count;
       let (stat_lex_exe, stat_lex_out_cmp, _) =
         run_pass
           ~f:pass_lexing
@@ -224,9 +226,12 @@ let run tests =
   );
   p "%s" bar_end; p_ln ();
   p "%s"
-    (match !failure_count with
-    | 0 -> status_pass ()
-    | _ -> status_fail () ~info:(s "%d failures" !failure_count)
+    ( let info =
+        s "%d failures in %d test cases" !failure_count !test_case_count
+      in
+      match !failure_count with
+      | 0 -> status_pass () ~info
+      | _ -> status_fail () ~info
     );
     p_ln ();
   p "%s" bar_end; p_ln ();
This page took 0.020825 seconds and 4 git commands to generate.