Commits

camlspotter committed 6dba974

pa_ounit

Comments (0)

Files changed (1)

     veryclean: 
         rm -f *.cm* *.annot *.o *.a *.sp[io]t *.so *.exe *.byt *.opt *.run
 
+# Pa_ounit test
+# =======================================================================
 
+#| Test with Pa_ounit. Pretty version dependent.
+# Thinking from the implementation Pa_ounit_lib.Runtime, it should be
+# pretty unstable in future releases of Pa_ounit. Sigh.
+
+MyOCamlOUnitTest(LIB) =
+    name=ounittest_$(LIB)
+    $(name).ml:
+        section:
+            chan=$(fopen $@, w)
+            fprintln($(chan), module M = $(capitalize $(LIB)))
+            fprintln($(chan), let \(\) = Pa_ounit_lib.Runtime.summarize \(\))
+            close($(chan))
+
+    section:
+        OCAML_LIBS=$(LIB)
+        MyOCamlTestProgram($(name), $(name))
+
+    inline_tests.log: $(name)
+        println(Check inline_tests.log for test results)
+        ./$(name) inline-test-runner $(capitalize $(LIB)) -display -log -strict
+
+    .PHONY:test
+
+    test: inline_tests.log