diff --git a/master_changes.md b/master_changes.md index cbc6f39abd5..f0684e2580b 100644 --- a/master_changes.md +++ b/master_changes.md @@ -104,6 +104,27 @@ users) ## Reftests ### Tests + * cli versioning: untie output from current major version [#6045 @rjbou] + * Set `opam-version` to 2.2 for some conflict message tests based on opam repository to stabilise their output [#6045 @rjbou] + * [BUG]: head -c is not posix compliant. Use cut -b instead. [#5989 @madroach] + * Add bad cudf package name encoding (dose3 lib) [#6055 @rjbou] + * Add test for filter operators in opam file [#5642 @rjbou] + * Update init test to make it no repo [#5327 @rjbou] + * Add a test in admin cache for hash cache [#6103 @rjbou] + * Add admin cache test [#6068 @rjbou] + * env: Add a test for `build-env` overwrites build env opam environment variables [#5377 @rjbou] + * clean: Add to check cleaning of sources directories [#5474 @rjbou] + * Add reftest for `--verbose-on` option [#5682 @rjbou] + * Add a test for --deps-only setting direct dependencies as root packages [#6125 @rjbou] + * Add a test file for `opam install --check` [#6121 @kit-ty-kate] + * Add reinstall test for delayed removal of packages [#6139 @rjbou] + * Add a test showing the behaviour of `opam list --latests-only` [#5375 @kit-ty-kate] + * Add a test filtering mechanism [#6105 @Keryan-dev] + * Add a package fetching test [#6146 @rjbou] + * Add a test showing the behaviour of `opam switch list-available` [#6098 @kit-ty-kate] + * Add a test for git packages with submodules [#6132 @kit-ty-kate] + * Add basic test for `install --check` [#6122 @rjbou] + * Add a sandbox usage test [#6165 @rjbou] ### Engine diff --git a/tests/reftests/dune.inc b/tests/reftests/dune.inc index 643bbb93218..395d32284b5 100644 --- a/tests/reftests/dune.inc +++ b/tests/reftests/dune.inc @@ -1574,6 +1574,27 @@ %{targets} (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:resolve-variables.test} %{read-lines:testing-env})))) +(rule + (alias reftest-sandbox.unix) + (enabled_if (and (= %{os_type} "Unix") (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1)))) + (action + (diff sandbox.unix.test sandbox.unix.out))) + +(alias + (name reftest) + (enabled_if (and (= %{os_type} "Unix") (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1)))) + (deps (alias reftest-sandbox.unix))) + +(rule + (targets sandbox.unix.out) + (deps root-N0REP0) + (enabled_if (and (= %{os_type} "Unix") (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1)))) + (package opam) + (action + (with-stdout-to + %{targets} + (run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:sandbox.unix.test} %{read-lines:testing-env})))) + (rule (alias reftest-shared-fetch) (enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1)))) diff --git a/tests/reftests/sandbox.unix.test b/tests/reftests/sandbox.unix.test new file mode 100644 index 00000000000..e9b228b2bb9 --- /dev/null +++ b/tests/reftests/sandbox.unix.test @@ -0,0 +1,35 @@ +N0REP0 +### +opam-version: "2.0" +build: [ "echo" "SUCCESS" "|" "tee" "check-write" ] +### +opam-version: "2.0" +build: [ "opam" "option" "jobs=4" "--cli=2.1"] +### +opam-version: "2.0" +build: [ "opam" "config" "var" "prefix" ] +### +opam-version: "2.0" +build: [ "sh" "-c" "echo > /tmp/ech" ] +### +opam-version: "2.0" +build: [ "sh" "-c" "echo > $TMPDIR/ech" ] +### opam switch create sdbx --empty +### OPAMVERBOSE=2 +### opam install echo | grep "^\(\\+\|-) " | sed-cmd echo ++ echo "SUCCESS" "|" "tee" "check-write" (CWD=${BASEDIR}/OPAM/sdbx/.opam-switch/build/echo.1) +- SUCCESS | tee check-write +### opam install option | grep "^\(\\+\|-) " | sed-cmd opam ++ opam "option" "jobs=4" "--cli=2.1" (CWD=${BASEDIR}/OPAM/sdbx/.opam-switch/build/option.1) +- 'opam option jobs=4 --cli=2.1' failed. +- Fatal error: +- ${OPAM}: "open" failed on ${BASEDIR}/OPAM/config.lock: Read-only file system +- No changes have been performed +# Return code 31 # +### opam install var | grep "^\(\\+\|-) " | sed-cmd opam ++ opam "config" "var" "prefix" (CWD=${BASEDIR}/OPAM/sdbx/.opam-switch/build/var.1) +- ${BASEDIR}/OPAM/sdbx +### opam install tmp | grep "^\(\\+\|-) " | sed-cmd sh ++ sh "-c" "echo > /tmp/ech" (CWD=${BASEDIR}/OPAM/sdbx/.opam-switch/build/tmp.1) +### opam install tmpdir | grep "^\(\\+\|-) " | sed-cmd sh ++ sh "-c" "echo > $TMPDIR/ech" (CWD=${BASEDIR}/OPAM/sdbx/.opam-switch/build/tmpdir.1)