Skip to content

Commit

Permalink
Use it to enhance the BASEDIR / OPAMTMP detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Nov 8, 2023
1 parent 1437d22 commit c111084
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/reftests/env-dra27.win32.test
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ CI = /home/ci/config norewrite Updated\ by\ package\ setenv-dra27
FOO = this\ does\ not\ require/allow\ a\ rewrite\ entry ; target Updated\ by\ package\ setenv-dra27
MANPATH =: ${BASEDIR}/OPAM/rewriting/man Current\ opam\ switch\ man\ dir
PATH =+= ${BASEDIR}/OPAM/rewriting/bin Binary\ dir\ for\ opam\ switch\ rewriting
### opam env | grep PKG_CONFIG | '/tmp/build_[^/]*/opam-reftest-[^/]*/' -> '${BASEDIR}/'
### opam env | grep PKG_CONFIG
PKG_CONFIG_PATH='/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.38.33030/bin/HostX64/x64;C:/Program Files/Microsoft Visual Studio/2022/Preview/Common7/IDE/VC/VCPackages;C:/Program Files/Microsoft Visual Studio/2022/Preview/Common7/Tools/:/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Preview/Common7/Tools/:/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Preview/Common7/IDE/VC/VCPackages:/cygdrive/c/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.38.33030/bin/HostX64/x64:${BASEDIR}/OPAM/rewriting/lib/pkgconfig'; export PKG_CONFIG_PATH;
10 changes: 7 additions & 3 deletions tests/reftests/run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 '-'])],
Expand Down

0 comments on commit c111084

Please sign in to comment.