Skip to content

Commit 9b79ad3

Browse files
rjboukit-ty-kate
authored andcommitted
reftest: add complete tests for the pin-depends feature
1 parent 248b82c commit 9b79ad3

File tree

5 files changed

+889
-1
lines changed

5 files changed

+889
-1
lines changed

master_changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ users)
152152
* Add a test showing the behaviour of nested extra-files [#6715 @kit-ty-kate]
153153
* Add opam file loading tests to `update.test` to demonstrate current behaviour of loading full repository instead of only changed files. [#6614 @arozovyk @rjbou @kit-ty-kate]
154154
* Fix `env.test` in cases where calling `env` inside of a script outputs a `__CF_USER_TEXT_ENCODING` environment variable that isn't present in `sh -c env` [#6719 @kit-ty-kate]
155+
* Add complete tests for the `pin-depends` feature [#6611 @rjbou]
155156

156157
### Engine
157158
* Fix gcc < 14.3 bug on mingw i686 [#6624 @kit-ty-kate]

src/client/opamSolution.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,8 @@ let confirmation ?ask requested solution =
10981098
in
10991099
ask <> Some true && OpamPackage.Name.Set.equal requested solution_packages ||
11001100
let stats = OpamSolver.stats solution in
1101-
OpamConsole.confirm "\nProceed with %s?" (OpamSolver.string_of_stats stats)
1101+
OpamConsole.confirm ~name:"proceed-actions" "\nProceed with %s?"
1102+
(OpamSolver.string_of_stats stats)
11021103

11031104
let run_hook_job t name ?(local=[]) ?(allow_stdout=false) w =
11041105
let shell_env = OpamEnv.get_full ~set_opamroot:true ~set_opamswitch:true ~force_path:true t in

tests/reftests/dune.inc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,48 @@
15531553
%{targets}
15541554
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:pat-sub.test} %{read-lines:testing-env}))))
15551555

1556+
(rule
1557+
(alias reftest-pin-depends-ignore)
1558+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1559+
(action
1560+
(diff pin-depends-ignore.test pin-depends-ignore.out)))
1561+
1562+
(alias
1563+
(name reftest)
1564+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1565+
(deps (alias reftest-pin-depends-ignore)))
1566+
1567+
(rule
1568+
(targets pin-depends-ignore.out)
1569+
(deps root-N0REP0)
1570+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1571+
(package opam)
1572+
(action
1573+
(with-stdout-to
1574+
%{targets}
1575+
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:pin-depends-ignore.test} %{read-lines:testing-env}))))
1576+
1577+
(rule
1578+
(alias reftest-pin-depends)
1579+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1580+
(action
1581+
(diff pin-depends.test pin-depends.out)))
1582+
1583+
(alias
1584+
(name reftest)
1585+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1586+
(deps (alias reftest-pin-depends)))
1587+
1588+
(rule
1589+
(targets pin-depends.out)
1590+
(deps root-N0REP0)
1591+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1592+
(package opam)
1593+
(action
1594+
(with-stdout-to
1595+
%{targets}
1596+
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:pin-depends.test} %{read-lines:testing-env}))))
1597+
15561598
(rule
15571599
(alias reftest-pin-depsonly-wtest-6501)
15581600
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))

0 commit comments

Comments
 (0)