From 54af1445789bd0398740a7bb2bd42caa4e84acbf Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 31 Oct 2023 10:46:47 +0000 Subject: [PATCH] WIP: wiki version of the test --- tests/reftests/dune.inc | 21 +++++++++ tests/reftests/env-dra27.win32.test | 67 +++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 tests/reftests/env-dra27.win32.test diff --git a/tests/reftests/dune.inc b/tests/reftests/dune.inc index 69497f6548a..305c043fa0f 100644 --- a/tests/reftests/dune.inc +++ b/tests/reftests/dune.inc @@ -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 diff --git a/tests/reftests/env-dra27.win32.test b/tests/reftests/env-dra27.win32.test new file mode 100644 index 00000000000..6890992f8d7 --- /dev/null +++ b/tests/reftests/env-dra27.win32.test @@ -0,0 +1,67 @@ +N0REP0 +### : dra27 setenv examples : +### opam switch create rewriting --empty +### +opam-version: "2.0" +### +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\ +### +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;