Remove -ocamlv arg from cram tests

The ocamlc config is passesd courtesy of configurator anyway
This commit is contained in:
Rudi Grinberg 2018-04-18 23:14:32 +07:00
parent 13b770962d
commit 6819749550
2 changed files with 13 additions and 20 deletions

View File

@ -91,14 +91,10 @@ and postprocess tbl b = parse
~f:(fun x -> (test, parse_version x))))) ~f:(fun x -> (test, parse_version x)))))
let () = let () =
let ocaml_version = ref None in
let skip_versions = ref [] in let skip_versions = ref [] in
let expect_test = ref None in let expect_test = ref None in
let args = let args =
[ "-ocamlv" [ "-skip-versions"
, Arg.String (fun s -> ocaml_version := Some (parse_version s))
, "Version of ocaml being used"
; "-skip-versions"
, Arg.String (fun s -> skip_versions := parse_skip_versions s) , Arg.String (fun s -> skip_versions := parse_skip_versions s)
, "Comma separated versions of ocaml where to skip test" , "Comma separated versions of ocaml where to skip test"
; "-test" ; "-test"
@ -110,11 +106,13 @@ and postprocess tbl b = parse
match !expect_test with match !expect_test with
| None -> raise (Arg.Bad "expect test file must be passed") | None -> raise (Arg.Bad "expect test file must be passed")
| Some p -> p in | Some p -> p in
begin match !ocaml_version, !skip_versions with let ocaml_version =
| None, [] -> () Configurator.ocaml_config_var_exn configurator "version"
| None, _::_ -> raise (Arg.Bad "provide -ocaml along with -skip-versions") |> parse_version in
| Some v, skip -> begin
if List.exists skip ~f:(fun (op, v') -> test op v v') then exit 0 if List.exists !skip_versions ~f:(fun (op, v') ->
test op ocaml_version v') then
exit 0
end; end;
Test_common.run_expect_test expect_test ~f:(fun file_contents lexbuf -> Test_common.run_expect_test expect_test ~f:(fun file_contents lexbuf ->
let items = file lexbuf in let items = file lexbuf in

View File

@ -175,8 +175,7 @@
(action (action
(chdir test-cases/odoc (chdir test-cases/odoc
(progn (progn
(run ${exe:cram.exe} -ocamlv ${ocaml_version} -skip-versions 4.02.3 (run ${exe:cram.exe} -skip-versions 4.02.3 -test run.t)
-test run.t)
(diff? run.t run.t.corrected)))))) (diff? run.t run.t.corrected))))))
(alias (alias
@ -196,8 +195,7 @@
(action (action
(chdir test-cases/multiple-private-libs (chdir test-cases/multiple-private-libs
(progn (progn
(run ${exe:cram.exe} -ocamlv ${ocaml_version} -skip-versions 4.02.3 (run ${exe:cram.exe} -skip-versions 4.02.3 -test run.t)
-test run.t)
(diff? run.t run.t.corrected)))))) (diff? run.t run.t.corrected))))))
(alias (alias
@ -207,8 +205,7 @@
(action (action
(chdir test-cases/ppx-rewriter (chdir test-cases/ppx-rewriter
(progn (progn
(run ${exe:cram.exe} -ocamlv ${ocaml_version} -skip-versions 4.02.3 (run ${exe:cram.exe} -skip-versions 4.02.3 -test run.t)
-test run.t)
(diff? run.t run.t.corrected)))))) (diff? run.t run.t.corrected))))))
(alias (alias
@ -359,8 +356,7 @@
(action (action
(chdir test-cases/odoc-unique-mlds (chdir test-cases/odoc-unique-mlds
(progn (progn
(run ${exe:cram.exe} -ocamlv ${ocaml_version} -skip-versions 4.02.3 (run ${exe:cram.exe} -skip-versions 4.02.3 -test run.t)
-test run.t)
(diff? run.t run.t.corrected)))))) (diff? run.t run.t.corrected))))))
(alias (alias
@ -410,8 +406,7 @@
(action (action
(chdir test-cases/output-obj (chdir test-cases/output-obj
(progn (progn
(run ${exe:cram.exe} -ocamlv ${ocaml_version} -skip-versions <4.06.0 (run ${exe:cram.exe} -skip-versions <4.06.0 -test run.t)
-test run.t)
(diff? run.t run.t.corrected)))))) (diff? run.t run.t.corrected))))))
(alias (alias