Skip to content

Commit

Permalink
WIP: wiki version of the test
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Oct 31, 2023
1 parent 4e323f7 commit 54af144
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/reftests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,27 @@
%{targets}
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-006.test} %{read-lines:testing-env}))))

(rule
(alias reftest-env-dra27.win32)
(enabled_if (= %{os_type} "Win32"))
(action
(diff env-dra27.win32.test env-dra27.win32.out)))

(alias
(name reftest)
(enabled_if (= %{os_type} "Win32"))
(deps (alias reftest-env-dra27.win32)))

(rule
(targets env-dra27.win32.out)
(deps root-N0REP0)
(enabled_if (= %{os_type} "Win32"))
(package opam)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:env-dra27.win32.test} %{read-lines:testing-env}))))

(rule
(alias reftest-env)
(action
Expand Down
67 changes: 67 additions & 0 deletions tests/reftests/env-dra27.win32.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
N0REP0
### : dra27 setenv examples :
### opam switch create rewriting --empty
### <pkg:msvs-detect.1>
opam-version: "2.0"
### <pkg:msvs-detect.1:msvs-detect.config>
opam-version: "2.0"
variables {
tools-bin: "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\\"
}
### opam install msvs-detect -v
The following actions will be performed:
=== install 1 package
- install msvs-detect 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed msvs-detect.1
Done.
### opam var msvs-detect:tools-bin
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\
### <pkg:setenv-dra27.1>
opam-version: "2.0"
# Some (semi)-hypothetical updates
setenv: [
# Splits msvs-detect:tools-bin
# [ PATH += msvs-detect:tools-bin ]
# Doesn't split msvs-detect:tools-bin (because it's in a string constant)
[ PATH += "%{msvs-detect:tools-bin}%" ]
[ MANPATH += "/home/dra/manual/man" ]
[ PKG_CONFIG_PATH += "%{lib}%/pkgconfig" ]
# All converted with cygpath
# [ PKG_CONFIG_PATH += msvs-detect:tools-bin ]
# One mass conversion with cygpath
[ PKG_CONFIG_CONFIG += "%{msvs-detect:tools-bin}%" ]
[ OCAMLPATH += "%{lib}%" ]
[ CI = "/home/ci/config" ]
[ FOO = "this does not require/allow a rewrite entry" ]
]
# All requiring x-env-path-rewrite
x-env-path-rewrite: [
[ PATH (":" {os != "win32"} | ";" {os = "win32"}) ("target" {os != "win32"} | "target-quoted" {os = "win32"}) ]
[ MANPATH ":" "host" ]
[ PKG_CONFIG_PATH ":" "host" ]
[ CAML_LD_LIBRARY_PATH (":" {os != "win32"} | ";") "target" ]
[ OCAMLPATH (":" {os != "win32" & os != "cygwin"} | ";" {os = "win32" | os = "cygwin"}) "target" ]
[ CI false ]
]
### opam install setenv-dra27 -v
The following actions will be performed:
=== install 1 package
- install setenv-dra27 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed setenv-dra27.1
Done.
### opam var lib
${BASEDIR}/OPAM/rewriting/lib
### opam env
OPAM_LAST_ENV='${BASEDIR}/OPAM/rewriting/.opam-switch/last-env/env-0c6b79cef4e7c50ae192e1b697108dd6-0'; export OPAM_LAST_ENV;
OPAM_SWITCH_PREFIX='${BASEDIR}/OPAM/rewriting'; export OPAM_SWITCH_PREFIX;
PKG_CONFIG_PATH='${BASEDIR}/OPAM/rewriting/lib/pkgconfig'; export PKG_CONFIG_PATH;
PKG_CONFIG_CONFIG='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\'; export PKG_CONFIG_CONFIG;
OCAMLPATH='${BASEDIR}/OPAM/rewriting/lib'; export OCAMLPATH;
CI='/home/ci/config'; export CI;
FOO='this does not require/allow a rewrite entry'; export FOO;
MANPATH='/home/dra/manual/man:${BASEDIR}/OPAM/rewriting/man'; export MANPATH;
PATH='${BASEDIR}/OPAM/rewriting/bin: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\:/home/dra/opam-4/_build/install/default/bin:/home/dra/.opam/dev-4.14/bin:/home/dra/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/dra/.dotnet/tools'; export PATH;

0 comments on commit 54af144

Please sign in to comment.