From 13eea737f96b0d89f7420843b1c78433b6ff2ecc Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 20 Apr 2018 17:32:37 +0700 Subject: [PATCH 1/2] Don't use getenv_opt in configurator test --- test/blackbox-tests/test-cases/configurator/config/run.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/blackbox-tests/test-cases/configurator/config/run.ml b/test/blackbox-tests/test-cases/configurator/config/run.ml index 41bc97f0..ec2da3d1 100644 --- a/test/blackbox-tests/test-cases/configurator/config/run.ml +++ b/test/blackbox-tests/test-cases/configurator/config/run.ml @@ -1,9 +1,9 @@ module Configurator = Configurator.V1 let () = - begin match Sys.getenv_opt "DUNE_CONFIGURATOR" with - | None -> failwith "DUNE_CONFIGURATOR is not passed" - | Some _ -> print_endline "DUNE_CONFIGURATOR is present" + begin match Sys.getenv "DUNE_CONFIGURATOR" with + | exception Not_found -> failwith "DUNE_CONFIGURATOR is not passed" + | _ -> print_endline "DUNE_CONFIGURATOR is present" end; Configurator.main ~name:"config" (fun t -> match Configurator.ocaml_config_var t "version" with From 709385ed66fd6a50be4d9918d0fddd49d68e94ea Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 20 Apr 2018 17:32:48 +0700 Subject: [PATCH 2/2] Don't rely on "ext_exe" always being present It's not present in older OCaml, so we need to guess the ext_exe ourselves. --- test/blackbox-tests/cram.mll | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/blackbox-tests/cram.mll b/test/blackbox-tests/cram.mll index b5d57008..fc4f9b6c 100644 --- a/test/blackbox-tests/cram.mll +++ b/test/blackbox-tests/cram.mll @@ -46,7 +46,15 @@ and postprocess tbl b = parse ] in (* need to special case exe since we can only remove this extension in general *) - match var "ext_exe" with + match ( + match Configurator.ocaml_config_var config "ext_exe" with + | Some s -> s + | None -> + begin match Configurator.ocaml_config_var_exn config "system" with + | "Win32" -> ".exe" + | _ -> "" + end + ) with | "" -> exts | ext -> (ext, "") :: exts in