Don't send checkpoints to stderr for the vmcore.ml test.
authorGordon Henriksen <gordonhenriksen@mac.com>
Wed, 11 Jun 2008 14:58:01 +0000 (14:58 +0000)
committerGordon Henriksen <gordonhenriksen@mac.com>
Wed, 11 Jun 2008 14:58:01 +0000 (14:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52218 91177308-0d34-0410-b5e6-96231b3b80d8

test/Bindings/Ocaml/vmcore.ml

index 637ef3532c54323779ceaa08f82b66f6ecee14aa..ffb69701c888d4c7234f93e18113c702922bc512 100644 (file)
@@ -13,20 +13,34 @@ open Llvm_bitwriter
 
 (* Tiny unit test framework - really just to help find which line is busted *)
 let exit_status = ref 0
 
 (* Tiny unit test framework - really just to help find which line is busted *)
 let exit_status = ref 0
+let suite_name = ref ""
+let group_name = ref ""
 let case_num = ref 0
 let case_num = ref 0
+let print_checkpoints = false
 
 let group name =
 
 let group name =
+  group_name := !suite_name ^ "/" ^ name;
   case_num := 0;
   case_num := 0;
-  prerr_endline ("  " ^ name ^ "...")
+  if print_checkpoints then
+    prerr_endline ("  " ^ name ^ "...")
 
 let insist cond =
   incr case_num;
 
 let insist cond =
   incr case_num;
-  if not cond then exit_status := 10;
-  prerr_endline ("    " ^ (string_of_int !case_num) ^ if cond then ""
-                                                              else " FAIL")
+  if not cond then
+    exit_status := 10;
+  match print_checkpoints, cond with
+  | false, true -> ()
+  | false, false ->
+      prerr_endline ("FAILED: " ^ !suite_name ^ "/" ^ !group_name ^ " #" ^ (string_of_int !case_num))
+  | true, true ->
+      prerr_endline ("    " ^ (string_of_int !case_num))
+  | true, false ->
+      prerr_endline ("    " ^ (string_of_int !case_num) ^ " FAIL")
 
 let suite name f =
 
 let suite name f =
-  prerr_endline (name ^ ":");
+  suite_name := name;
+  if print_checkpoints then
+    prerr_endline (name ^ ":");
   f ()
 
 
   f ()
 
 
@@ -245,7 +259,7 @@ let test_constants () =
   ignore (define_global "Const08" c m);
   insist ((vector_type i16_type 8) = (type_of c));
   
   ignore (define_global "Const08" c m);
   insist ((vector_type i16_type 8) = (type_of c));
   
-  (* RUN: grep {Const09.*\{ i16, i16, i32, i32 \} \{} < %t.ll
+  (* RUN: grep {Const09.*. i16, i16, i32, i32 . .} < %t.ll
    *)
   group "structure";
   let c = const_struct [| one; two; three; four |] in
    *)
   group "structure";
   let c = const_struct [| one; two; three; four |] in