From 23803c25154c331938f752569ea64fbe76035454 Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Sun, 15 Sep 2013 11:36:29 +0000 Subject: [PATCH] ocamlbuild testsuite: test -no-plugin and -just-plugin The second test currently fails, because the plugin is not build if no target is passed. This will be fixed shortly. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- ocamlbuild/testsuite/internal.ml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ocamlbuild/testsuite/internal.ml b/ocamlbuild/testsuite/internal.ml index d050d8cca..38f4aecba 100644 --- a/ocamlbuild/testsuite/internal.ml +++ b/ocamlbuild/testsuite/internal.ml @@ -215,4 +215,30 @@ let () = test "ModularPlugin3" ~matching:[M.f "main.byte"] ~targets:("main.byte",[]) ();; +let () = test "PluginCompilation1" + ~description:"check that the plugin is not compiled when -no-plugin is passed" + ~options:[`no_ocamlfind; `no_plugin] + ~tree:[T.f "main.ml" ~content:"let x = 1"; + T.f "myocamlbuild.ml" ~content:"prerr_endline \"foo\";;"] + ~matching:[_build [M.Not (M.f "myocamlbuild")]] + ~targets:("main.byte",[]) ();; + +let () = test "PluginCompilation2" + ~description:"check that the plugin is compiled when -just-plugin is passed" + ~options:[`no_ocamlfind; `just_plugin] + ~tree:[T.f "main.ml" ~content:"let x = 1"; + T.f "myocamlbuild.ml" ~content:"print_endline \"foo\";;"] + ~matching:[_build [M.f "myocamlbuild"]] + ~targets:("", []) ();; + +let () = test "PluginCompilation3" + ~description:"check that the plugin is not executed \ + when -just-plugin is passed" + ~options:[`no_ocamlfind; `quiet; `just_plugin] + ~tree:[T.f "main.ml" ~content:"let x = 1"; + T.f "myocamlbuild.ml" ~content:"print_endline \"foo\";;"] + (* if the plugin were executed we'd get "foo" in failing_msg *) + ~failing_msg:"" + ~targets:("main,byte", []) ();; + run ~root:"_test_internal";;