Permalink
Browse files

New testing infrastructure for ocamlbuild (PR#5755)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13170 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
1 parent 4031c86 commit 654be633f2dd3ae10b9a7bf1d9b309794fc2dc80 meyer committed Dec 29, 2012
Showing with 497 additions and 0 deletions.
  1. +59 −0 ocamlbuild/testsuite/level0.ml
  2. +438 −0 ocamlbuild/testsuite/ocamlbuild_test.ml
@@ -0,0 +1,59 @@
+#use "topfind";;
+#require "unix";;
+
+#use "ocamlbuild_test.ml";;
+
+module M = Match;;
+module T = Tree;;
+
+let _build = M.d "_build";;
+
+test "BasicNativeTree"
+ ~description:"Output tree for native compilation"
+ ~tree:(T.f "dummy.ml")
+ ~matching:(M.Exact
+ (_build
+ (M.lf
+ ["_digests";
+ "dummy.cmi";
+ "dummy.cmo";
+ "dummy.cmx";
+ "dummy.ml";
+ "dummy.ml.depends";
+ "dummy.native";
+ "dummy.o";
+ "_log"])))
+ ~targets:("dummy.native",[]);;
+
+test "BasicByteTree"
+ ~description:"Output tree for byte compilation"
+ ~tree:(T.f "dummy.ml")
+ ~matching:(M.Exact
+ (_build
+ (M.lf
+ ["_digests";
+ "dummy.cmi";
+ "dummy.cmo";
+ "dummy.ml";
+ "dummy.ml.depends";
+ "dummy.byte";
+ "_log"])))
+ ~targets:("dummy.byte",[]);;
+
+test "SeveralTargets"
+ ~description:"Several targets"
+ ~tree:(T.f "dummy.ml")
+ ~matching:(_build (M.lf ["dummy.byte"; "dummy.native"]))
+ ~targets:("dummy.byte",["dummy.native"]);;
+
+let alt_build_dir = "BuIlD2";;
+
+test "BuildDir"
+ ~options:[`build_dir alt_build_dir]
+ ~description:"Different build directory"
+ ~tree:(T.f "dummy.ml")
+ ~matching:(M.d alt_build_dir (M.lf ["dummy.byte"]))
+ ~targets:("dummy.byte",[]);;
+
+
+run ~root:"_test";;
Oops, something went wrong.

0 comments on commit 654be63

Please sign in to comment.