Skip to content

Commit

Permalink
reftest: add test vor verbose-on
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Sep 26, 2023
1 parent 31de608 commit c25a4e1
Show file tree
Hide file tree
Showing 2 changed files with 262 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/reftests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,24 @@
%{targets}
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:var-option.test} %{read-lines:testing-env}))))

(rule
(alias reftest-verbose-on)
(action
(diff verbose-on.test verbose-on.out)))

(alias
(name reftest)
(deps (alias reftest-verbose-on)))

(rule
(targets verbose-on.out)
(deps root-N0REP0)
(package opam)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:verbose-on.test} %{read-lines:testing-env}))))

(rule
(alias reftest-with-dev-setup)
(action
Expand Down
244 changes: 244 additions & 0 deletions tests/reftests/verbose-on.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
N0REP0
### <pkg:foo.1>
opam-version: "2.0"
build: [ "echo" name ]
depends: "bar"
### <pkg:bar.1>
opam-version: "2.0"
build: [ "echo" name ]
depends: "baz"
### <pkg:baz.1>
opam-version: "2.0"
build: [ "echo" name ]
depends: "qux"
### <pkg:qux.1>
opam-version: "2.0"
build: [ "echo" name ]
### OPAMYES=1
### opam switch create verbose-on --empty
### : with --verbose-on option
### opam install foo
The following actions will be performed:
=== install 4 packages
- install bar 1 [required by foo]
- install baz 1 [required by bar]
- install foo 1
- install qux 1 [required by baz]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed qux.1
-> installed baz.1
-> installed bar.1
-> installed foo.1
Done.
### opam reinstall qux --verbose-on foo | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
-> installed bar.1
+ echo "foo" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/foo.1)
- foo
-> compiled foo.1
-> installed foo.1
Done.
### opam reinstall qux --verbose-on bar | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
+ echo "bar" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/bar.1)
- bar
-> compiled bar.1
-> installed bar.1
-> installed foo.1
Done.
### opam reinstall qux --verbose-on bar,qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+ echo "qux" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/qux.1)
- qux
-> compiled qux.1
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
+ echo "bar" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/bar.1)
- bar
-> compiled bar.1
-> installed bar.1
-> installed foo.1
Done.
### opam reinstall qux --verbose-on foo,bar,baz,qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+ echo "qux" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/qux.1)
- qux
-> compiled qux.1
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
+ echo "baz" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/baz.1)
- baz
-> compiled baz.1
-> installed baz.1
+ echo "bar" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/bar.1)
- bar
-> compiled bar.1
-> installed bar.1
+ echo "foo" (CWD=${BASEDIR}/OPAM/verbose-on/.opam-switch/build/foo.1)
- foo
-> compiled foo.1
-> installed foo.1
Done.
### : with OPAMVERBOSEON environment variable
### OPAMVERBOSEON=foo
### opam reinstall qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
-> installed bar.1
-> installed foo.1
Done.
### OPAMVERBOSEON=bar
### opam reinstall qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
-> installed bar.1
-> installed foo.1
Done.
### OPAMVERBOSEON=baz,qux
### opam reinstall qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
-> installed bar.1
-> installed foo.1
Done.
### OPAMVERBOSEON=foo,bar,baz,qux
### opam reinstall qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
-> installed bar.1
-> installed foo.1
Done.
### OPAMVERBOSEON=""
### opam reinstall qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
-> installed bar.1
-> installed foo.1
Done.
### OPAMVERBOSEON=3
### opam reinstall qux | sed-cmd echo
The following actions will be performed:
=== recompile 4 packages
- recompile bar 1 [uses baz]
- recompile baz 1 [uses qux]
- recompile foo 1 [uses bar]
- recompile qux 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed foo.1
-> removed bar.1
-> removed baz.1
-> removed qux.1
-> installed qux.1
-> installed baz.1
-> installed bar.1
-> installed foo.1
Done.

0 comments on commit c25a4e1

Please sign in to comment.