From e9c70b68bbd5955d0de3e7bd7a69c53e6ebdd678 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 8 Nov 2023 09:37:51 +0000 Subject: [PATCH] Use it to enhance the BASEDIR / OPAMTMP detection --- master_changes.md | 1 + tests/reftests/run.ml | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/master_changes.md b/master_changes.md index 781aa9469f6..f09c2195d00 100644 --- a/master_changes.md +++ b/master_changes.md @@ -99,6 +99,7 @@ users) ### Engine * Set `SHELL` to `/bin/sh` in Windows to ensure `opam env` commands are consistent [#5723 @dra27] + * Substitution for `BASEDIR` and `OPAMTMP` now recognise the directory with either forward-slashes, back-slashes, or converted to Cygwin notation (i.e. C:\cygwin64\tmp\..., C:/cygwin64/tmp/..., or /tmp/...) [#5723 @dra27] ## Github Actions diff --git a/tests/reftests/run.ml b/tests/reftests/run.ml index 89f70ded413..06ddcb87ca8 100644 --- a/tests/reftests/run.ml +++ b/tests/reftests/run.ml @@ -541,6 +541,11 @@ let parse_command = Parse.command let common_filters ?opam dir = let tmpdir = OpamSystem.real_path (Filename.get_temp_dir_name ()) in let open Re in + let dir_to_regex dir = + if Sys.win32 then + [str dir; str (OpamSystem.back_to_forward dir); str (OpamSystem.apply_cygpath dir)] + else + [str dir] in [ seq [ bol; alt [ str "#=== ERROR"; @@ -554,11 +559,10 @@ let common_filters ?opam dir = GrepV; seq [bol; str cmd_prompt], Sed "##% "; - alt [str dir; str (OpamSystem.back_to_forward dir)], + alt (dir_to_regex dir), Sed "${BASEDIR}"; seq [ - alt [str tmpdir; - str (OpamSystem.back_to_forward tmpdir)]; + alt (dir_to_regex tmpdir); rep (set "/\\"); str "opam-"; rep1 (alt [xdigit; char '-'])],