]> matita.cs.unibo.it Git - helm.git/commitdiff
added test script for typechecking URIs given on STDIN
authorStefano Zacchiroli <zack@upsilon.cc>
Fri, 29 Oct 2004 12:21:39 +0000 (12:21 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Fri, 29 Oct 2004 12:21:39 +0000 (12:21 +0000)
helm/gTopLevel/Makefile.in
helm/gTopLevel/typecheck_uri.ml [new file with mode: 0644]

index 42dd44be1f8f29971aceddcb33846da36806a712..4b44c3418cb0616a3430096a30dd05222c7aa7ca 100644 (file)
@@ -134,6 +134,10 @@ librarytest: testlibrary
        ./testlibrary -vars -varsprefix cic:/Coq index.txt 2>/dev/null >LOG
 librarytest.opt: testlibrary.opt
        ./testlibrary.opt -vars -varsprefix cic:/Coq index.txt 2>/dev/null >LOG
+typecheck_uri: typecheck_uri.ml
+       $(OCAMLFIND) ocamlc -thread -package helm-cic_proof_checking -linkpkg -o $@ $<
+typecheck_uri.opt: typecheck_uri.ml
+       $(OCAMLFIND) opt -thread -package helm-cic_proof_checking -linkpkg -o $@ $<
 
 MAIN = ./gTopLevel
 ARGS =
diff --git a/helm/gTopLevel/typecheck_uri.ml b/helm/gTopLevel/typecheck_uri.ml
new file mode 100644 (file)
index 0000000..e6df5cd
--- /dev/null
@@ -0,0 +1,23 @@
+
+
+open Printf
+
+let _ = Helm_registry.load_from "gTopLevel.conf.xml"
+
+let test_uri uri =
+  (try
+    Printf.printf "%s ... " uri;
+    let uri = UriManager.uri_of_string uri in
+    flush stdout;
+    ignore (CicTypeChecker.typecheck uri);
+    print_endline "ok";
+  with _ -> print_endline "failure");
+  flush stdout
+
+let _ =
+  try
+    while true do
+      test_uri (input_line stdin)
+    done
+  with End_of_file -> ()
+