Skip to content

Commit e7e25a3

Browse files
committed
reftests: add check install test
1 parent c2e7718 commit e7e25a3

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed

tests/reftests/dune.inc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,27 @@
10071007
%{targets}
10081008
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:install-pgocaml.test} %{read-lines:testing-env}))))
10091009

1010+
(rule
1011+
(alias reftest-install)
1012+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1013+
(action
1014+
(diff install.test install.out)))
1015+
1016+
(alias
1017+
(name reftest)
1018+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1019+
(deps (alias reftest-install)))
1020+
1021+
(rule
1022+
(targets install.out)
1023+
(deps root-N0REP0)
1024+
(enabled_if (and (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))
1025+
(package opam)
1026+
(action
1027+
(with-stdout-to
1028+
%{targets}
1029+
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:install.test} %{read-lines:testing-env}))))
1030+
10101031
(rule
10111032
(alias reftest-json.unix)
10121033
(enabled_if (and (= %{os_type} "Unix") (or (<> %{env:TESTALL=1} 0) (= %{env:TESTN0REP0=0} 1))))

tests/reftests/install.test

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
N0REP0
2+
### <pkg:foo.1>
3+
opam-version: "2.0"
4+
### <pkg:bar.1>
5+
opam-version: "2.0"
6+
### <pkg:baz.1>
7+
opam-version: "2.0"
8+
### <pkg:top.1>
9+
opam-version: "2.0"
10+
depends: [
11+
"foo"
12+
("bar" | "baz")
13+
]
14+
### opam update
15+
16+
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
17+
[default] no changes from file://${BASEDIR}/REPO
18+
### opam switch create inst --empty
19+
### : test check installed :
20+
### opam install --check top
21+
Missing dependencies:
22+
bar baz foo
23+
# Return code 1 #
24+
### opam install foo
25+
The following actions will be performed:
26+
=== install 1 package
27+
- install foo 1
28+
29+
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
30+
-> installed foo.1
31+
Done.
32+
### opam install --check top
33+
Missing dependencies:
34+
bar baz
35+
# Return code 1 #
36+
### opam install bar
37+
The following actions will be performed:
38+
=== install 1 package
39+
- install bar 1
40+
41+
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
42+
-> installed bar.1
43+
Done.
44+
### opam install --check top
45+
All dependencies installed
46+
### opam remove bar
47+
The following actions will be performed:
48+
=== remove 1 package
49+
- remove bar 1
50+
51+
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
52+
-> removed bar.1
53+
Done.
54+
### opam install baz
55+
The following actions will be performed:
56+
=== install 1 package
57+
- install baz 1
58+
59+
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
60+
-> installed baz.1
61+
Done.
62+
### opam install --check top
63+
All dependencies installed
64+
### opam install bar
65+
The following actions will be performed:
66+
=== install 1 package
67+
- install bar 1
68+
69+
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
70+
-> installed bar.1
71+
Done.
72+
### opam install --check top
73+
All dependencies installed

0 commit comments

Comments
 (0)