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
master
Gabriel Scherer 2013-09-15 11:36:29 +00:00
parent c01593d18e
commit 23803c2515
1 changed files with 26 additions and 0 deletions

View File

@ -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";;