Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 258 lines (227 sloc) 8.427 kB
4e3553f @OCamlPro-FabriceLeFessant Modified for the demo
OCamlPro-FabriceLeFessant authored
1 # never use /tmp
2 # should be absolute
3 TEST_DIR=/tmp
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
4 OPAM_ROOT = $(TEST_DIR)/OPAM.ROOT
abc2630 @samoht Clean-up the functional tests
samoht authored
5 OPAM_REPO = $(TEST_DIR)/OPAM.REPO
6 BIN = $(TEST_DIR)/OPAM.BIN
7 REPO = test
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM serv…
samoht authored
8 REPOKIND ?= rsync
4e3553f @OCamlPro-FabriceLeFessant Modified for the demo
OCamlPro-FabriceLeFessant authored
9
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM serv…
samoht authored
10 # To test OPAM server repositories
11 OPAM_SERVER_ROOT = $(TEST_DIR)/OPAM.SERVER
12 OPAM_SERVER = 127.0.0.1
13
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
14 # To test GIT repo
15 OPAM_GIT = $(TEST_DIR)/OPAM.GIT
16
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
17 BINARIES = opam opam-server opam-check \
e8d5296 @tuong fix tests, opam-curl-[...] binaries are not found
tuong authored
18 opam-rsync-init opam-rsync-update opam-rsync-download opam-rsync-upload \
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
19 opam-server-init opam-server-update opam-server-download opam-server-upload \
e8d5296 @tuong fix tests, opam-curl-[...] binaries are not found
tuong authored
20 opam-git-init opam-git-update opam-git-download opam-git-upload \
21 opam-curl-init opam-curl-update opam-curl-download opam-curl-upload
22
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
23 PACKAGES = P1-1 P1-2 P2 P3 P4 P5
f8dc221 @samoht Add --root to ocp-get and ocp-get-server to change the default root p…
samoht authored
24
46c067d @samoht Install a default "system" compiler description on init.
samoht authored
25 OCAMLVERSION = system
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
26
abc2630 @samoht Clean-up the functional tests
samoht authored
27 # opam in the path should not be a requirement
3dd8be7 @samoht OPAMDEBUG=1 means verbose mode / OPAMDEBUG=2 (or more) means debug (+…
samoht authored
28 ENV = OCAMLRUNPARAM=b OPAMDEBUG=2 OPAM_ROOT=$(OPAM_ROOT) PATH=$(BIN):$(PATH)
76b6c57 @samoht Add a --yes option to always answer yes to OPAM questions
samoht authored
29 OPAM = $(ENV) opam --yes --root $(OPAM_ROOT)
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
30 CHECK = $(ENV) opam-check --root $(OPAM_ROOT)
7f510c5 @samoht Few makefile tweaks
samoht authored
31
abc2630 @samoht Clean-up the functional tests
samoht authored
32 BINARIES_ = $(BINARIES:%=$(BIN)/%)
33 BUILDS = $(foreach bin, $(BINARIES), ../_obuild/$(bin)/$(bin).asm)
34 ARCHIVES = $(PACKAGES:%=packages/%.tar.gz)
5cf8b97 @samoht Improve test Makefile
samoht authored
35
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
36 .PHONY: all rsync server git
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
37
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
38 all: rsync server git
39 @
40
41 run:
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
42 $(MAKE) fresh && \
989148e @tuong add a shortcut to the rule 'binaries'
tuong authored
43 $(MAKE) binaries && \
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
44 $(MAKE) init && \
45 $(MAKE) list && \
46 $(MAKE) upload && \
47 $(MAKE) install-remove && \
48 $(MAKE) list && \
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
49 $(MAKE) install-opt && \
50 $(MAKE) list && \
1089c50 @samoht [test] fix the rsync & server tests. git tests are still broken
samoht authored
51 $(MAKE) install && \
52 $(MAKE) list && \
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
53 $(MAKE) upload-new && \
54 $(MAKE) list && \
55 $(MAKE) upgrade && \
56 $(MAKE) list && \
57 $(MAKE) downgrade && \
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
58 $(MAKE) list && \
59 $(MAKE) switch-alias && \
60 $(MAKE) list && \
0331597 @samoht [switch] env + package fields work as expected in compiler descriptio…
samoht authored
61 $(MAKE) switch-env-packages
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
62
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
63 rsync:
64 $(MAKE) REPOKIND=rsync run
65
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
66 server:
67 $(MAKE) fresh
68 $(MAKE) binaries
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM serv…
samoht authored
69 rm -rf $(OPAM_SERVER_ROOT)
70 ($(ENV) opam-server --root $(OPAM_SERVER_ROOT) & \
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
71 (sleep 1 && $(MAKE) REPOKIND=server OPAM_REPO=$(OPAM_SERVER) run \
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM serv…
samoht authored
72 && killall opam-server || killall opam-server))
73
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
74 git:
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
75 $(MAKE) REPOKIND=git run
7f510c5 @samoht Few makefile tweaks
samoht authored
76
abc2630 @samoht Clean-up the functional tests
samoht authored
77 $(BINARIES_): $(BUILDS)
4e3553f @OCamlPro-FabriceLeFessant Modified for the demo
OCamlPro-FabriceLeFessant authored
78 mkdir -p $(BIN)
abc2630 @samoht Clean-up the functional tests
samoht authored
79 for bin in $(BINARIES); do \
80 cp ../_obuild/$$bin/$$bin.asm $(BIN)/$$bin ; \
81 done
1bcaf57 @samoht New format for user provided files
samoht authored
82
989148e @tuong add a shortcut to the rule 'binaries'
tuong authored
83 binaries: $(BINARIES_)
84
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
85 init:
f565f11 @samoht Fix server backend tests
samoht authored
86 ifneq ($(REPOKIND), server)
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
87 rm -rf $(OPAM_REPO)
88 mkdir -p $(OPAM_REPO)
f565f11 @samoht Fix server backend tests
samoht authored
89 endif
f8132ef @samoht [tests] add a switch test
samoht authored
90 ifeq ($(REPOKIND), git)
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
91 cd $(OPAM_REPO) && git init && \
92 touch README && git add README && \
93 git commit -a -m "Initial commit"
94 endif
640a3ba @samoht Add an option to not install the base packages on init
samoht authored
95 $(OPAM) init -no-base-packages $(REPO) $(OPAM_REPO) -kind $(REPOKIND)
7f510c5 @samoht Few makefile tweaks
samoht authored
96
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
97 upload: $(ARCHIVES)
98 ifeq ($(REPOKIND), git)
f5a5e36 @samoht Tests for the git backend pass
samoht authored
99 mkdir -p $(OPAM_REPO)/packages/P1.1
100 cp packages/P1-1.opam $(OPAM_REPO)/packages/P1.1/opam
101 cp packages/P1-1/README $(OPAM_REPO)/packages/P1.1/descr
c2338e1 @samoht WIP. OPAM backend can now return a folder instead of an archive, on d…
samoht authored
102 echo '$(OPAM_GIT)/P1-1 git' > $(OPAM_REPO)/packages/P1.1/url
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
103 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P1"
f5a5e36 @samoht Tests for the git backend pass
samoht authored
104 mkdir -p $(OPAM_REPO)/packages/P2.1
105 cp packages/P2/README $(OPAM_REPO)/packages/P2.1/descr
106 cp packages/P2.opam $(OPAM_REPO)/packages/P2.1/opam
c2338e1 @samoht WIP. OPAM backend can now return a folder instead of an archive, on d…
samoht authored
107 echo '$(OPAM_GIT)/P2 git' > $(OPAM_REPO)/packages/P2.1/url
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
108 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P2"
f5a5e36 @samoht Tests for the git backend pass
samoht authored
109 mkdir -p $(OPAM_REPO)/packages/P3.1~weird-version.test
110 cp packages/P3.opam $(OPAM_REPO)/packages/P3.1~weird-version.test/opam
111 cp packages/P3/README $(OPAM_REPO)/packages/P3.1~weird-version.test/descr
c2338e1 @samoht WIP. OPAM backend can now return a folder instead of an archive, on d…
samoht authored
112 echo '$(OPAM_GIT)/P3 git' > $(OPAM_REPO)/packages/P3.1~weird-version.test/url
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
113 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P3"
f5a5e36 @samoht Tests for the git backend pass
samoht authored
114 mkdir -p $(OPAM_REPO)/packages/P4.1
115 cp packages/P4-1.opam $(OPAM_REPO)/packages/P4.1/opam
116 cp packages/P4/README $(OPAM_REPO)/packages/P4.1/descr
c2338e1 @samoht WIP. OPAM backend can now return a folder instead of an archive, on d…
samoht authored
117 echo '$(OPAM_GIT)/P4 git' > $(OPAM_REPO)/packages/P4.1/url
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
118 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4"
f5a5e36 @samoht Tests for the git backend pass
samoht authored
119 mkdir -p $(OPAM_REPO)/packages/P5.1
120 cp packages/P5.opam $(OPAM_REPO)/packages/P5.1/opam
121 cp packages/P5/README $(OPAM_REPO)/packages/P5.1/descr
c2338e1 @samoht WIP. OPAM backend can now return a folder instead of an archive, on d…
samoht authored
122 echo '$(OPAM_GIT)/P5 git' > $(OPAM_REPO)/packages/P5.1/url
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
123 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P5"
c2338e1 @samoht WIP. OPAM backend can now return a folder instead of an archive, on d…
samoht authored
124 mkdir -p $(OPAM_REPO)/compilers
f8132ef @samoht [tests] add a switch test
samoht authored
125 cp compilers/* $(OPAM_REPO)/compilers/
126 cd $(OPAM_REPO)/compilers && git add * && git commit -a -m "Adding compilers"
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
127 rm -rf $(OPAM_GIT) && mkdir -p $(OPAM_GIT)
128 mkdir $(OPAM_GIT)/P1-1 && cp packages/P1-1/* $(OPAM_GIT)/P1-1/
129 mkdir $(OPAM_GIT)/P2 && cp packages/P2/* $(OPAM_GIT)/P2/
130 mkdir $(OPAM_GIT)/P3 && cp packages/P3/* $(OPAM_GIT)/P3/
131 mkdir $(OPAM_GIT)/P4 && cp packages/P4/* $(OPAM_GIT)/P4/
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
132 mkdir $(OPAM_GIT)/P5 && cp packages/P5/* $(OPAM_GIT)/P5/
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
133 cd $(OPAM_GIT)/P1-1 && git init && git add * && git commit -a -m "initial commit"
134 cd $(OPAM_GIT)/P2 && git init && git add * && git commit -a -m "initial commit"
135 cd $(OPAM_GIT)/P3 && git init && git add * && git commit -a -m "initial commit"
136 cd $(OPAM_GIT)/P4 && git init && git add * && git commit -a -m "initial commit"
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
137 cd $(OPAM_GIT)/P5 && git init && git add * && git commit -a -m "initial commit"
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
138 else
abc2630 @samoht Clean-up the functional tests
samoht authored
139 cd packages && \
140 $(OPAM) upload -opam P1-1.opam -descr P1-1/README -archive P1-1.tar.gz -repo $(REPO)
141 cd packages && \
142 $(OPAM) upload -opam P2.opam -descr P2/README -archive P2.tar.gz -repo $(REPO)
143 cd packages && \
144 $(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
145 cd packages && \
146 $(OPAM) upload -opam P4-1.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
147 cd packages && \
148 $(OPAM) upload -opam P5.opam -descr P5/README -archive P5.tar.gz -repo $(REPO)
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
149 endif
c3d0d3b @tuong [tests-server] we now test the switch when REPOKIND = server.
tuong authored
150 ifeq ($(REPOKIND), server)
151 cp compilers/* $(OPAM_ROOT)/compilers/
152 else
f8132ef @samoht [tests] add a switch test
samoht authored
153 cp compilers/* $(OPAM_REPO)/compilers/
c3d0d3b @tuong [tests-server] we now test the switch when REPOKIND = server.
tuong authored
154 endif
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
155 $(OPAM) update # update the list of available packages with the one being updated
7f510c5 @samoht Few makefile tweaks
samoht authored
156
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
157 list:
abc2630 @samoht Clean-up the functional tests
samoht authored
158 $(OPAM) list
7f510c5 @samoht Few makefile tweaks
samoht authored
159
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
160 install-remove:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
161 $(OPAM) install P1 &&\
162 $(CHECK) -l install-remove P1.1 &&\
163 $(OPAM) remove P1
a802765 @samoht Add a simple remove tests
samoht authored
164
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
165 install-opt:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
166 $(OPAM) install P5 &&\
167 $(CHECK) -l install-opt P1.1 P5.1 &&\
168 $(OPAM) install P2 &&\
169 $(CHECK) -l install-opt P1.1 P2.1 P5.1 &&\
170 $(OPAM) remove P5 &&\
171 $(OPAM) remove P2 &&\
172 $(OPAM) remove P1 &&\
173 $(CHECK) -l install-opt
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
174
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
175 install:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
176 $(OPAM) install P1 &&\
177 $(CHECK) -l install P1.1 &&\
178 $(OPAM) install P2 &&\
179 $(CHECK) -l install P1.1 P2.1 &&\
180 $(OPAM) install P3 &&\
181 $(CHECK) -l install P1.1 P2.1 P3.1~weird-version.test &&\
182 $(OPAM) install P4 &&\
183 $(CHECK) -l install P1.1 P2.1 P3.1~weird-version.test P4.1
a779ca3 @samoht More tests
samoht authored
184
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
185 upload-new:
186 ifeq ($(REPOKIND), git)
187 echo "(* new line *)" >> $(OPAM_GIT)/P1-1/p1.ml
188 cd $(OPAM_GIT)/P1-1 && git commit -a -m "a small change"
f5a5e36 @samoht Tests for the git backend pass
samoht authored
189 mkdir $(OPAM_REPO)/packages/P4.2
190 cp packages/P4-2.opam $(OPAM_REPO)/packages/P4.2/opam
191 cp packages/P4/README $(OPAM_REPO)/packages/P4.2/descr
192 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/packages/P4.2/url
193 mkdir $(OPAM_REPO)/packages/P4.3
194 cp packages/P4-3.opam $(OPAM_REPO)/packages/P4.3/opam
195 cp packages/P4/README $(OPAM_REPO)/packages/P4.3/descr
196 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/packages/P4.3/url
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
197 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4.2 and P4.3"
198 else
abc2630 @samoht Clean-up the functional tests
samoht authored
199 cd packages && \
200 $(OPAM) upload -opam P1-2.opam -descr P1-2/README -archive P1-2.tar.gz -repo $(REPO)
201 cd packages && \
202 $(OPAM) upload -opam P4-2.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
203 cd packages && \
204 $(OPAM) upload -opam P4-3.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
205 endif
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
206 $(OPAM) update # update the list of available packages with the one being updated
207
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
208 upgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
209 $(OPAM) upgrade
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
210 ifeq ($(REPOKIND), git)
211 $(CHECK) -l upgrade P1.1 P2.1 P3.1~weird-version.test P4.3
212 else
213 $(CHECK) -l upgrade P1.2 P2.1 P3.1~weird-version.test P4.3
214 endif
757fe55 @samoht Add more tests
samoht authored
215
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
216 downgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
217 $(OPAM) install P4.2
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
218 $(CHECK) -l downgrade P1.1 P2.1 P3.1~weird-version.test P4.2
7e293d3 @tuong Finish the bootstrap (for the case we only consider the library part …
tuong authored
219
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
220 switch-alias:
221 $(OPAM) remove P3.1~weird-version.test P4.2
222 $(CHECK) -l switch-alias P1.1 P2.1
640a3ba @samoht Add an option to not install the base packages on init
samoht authored
223 $(OPAM) switch -alias test $(OCAMLVERSION) -clone -no-base-packages
6ff4f04 @samoht Add compiler constraints
samoht authored
224 $(CHECK) -l switch-alias-test P1.1 P2.1
225 $(OPAM) switch 4.00.0
226 $(OPAM) install P1
227 $(CHECK) -l switch-alias-4.00 P1.1
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
228
0331597 @samoht [switch] env + package fields work as expected in compiler descriptio…
samoht authored
229 switch-env-packages:
6ff4f04 @samoht Add compiler constraints
samoht authored
230 $(OPAM) switch 3.12.1
0331597 @samoht [switch] env + package fields work as expected in compiler descriptio…
samoht authored
231 ifeq ($(REPOKIND), git)
232 $(CHECK) -l switch-env-packages P1.1 P2.1 P3.1~weird-version.test P4.3
233 else
234 $(CHECK) -l switch-env-packages P1.2 P2.1 P3.1~weird-version.test P4.3
235 endif
6ff4f04 @samoht Add compiler constraints
samoht authored
236 ./test-TEST.sh $(OPAM_ROOT)/3.12.1/build/P4.3/P4.env "1"
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
237
6b3599b @tuong Merge branch 'release-0.1' of github.com:OCamlPro/opam into release-0.1
tuong authored
238 switch:
f8132ef @samoht [tests] add a switch test
samoht authored
239 $(MAKE) fresh
240 $(MAKE) binaries
241 $(MAKE) init
242 $(MAKE) upload
243 $(MAKE) install
244 $(OPAM) switch -list
245 $(OPAM) switch -clone 3.12.1-byte
7892d49 @tuong Towards the complete support of "opam switch".
tuong authored
246
5cf8b97 @samoht Improve test Makefile
samoht authored
247 packages/%.tar.gz: packages/% packages/%/*
7f510c5 @samoht Few makefile tweaks
samoht authored
248 cd packages && tar cz $* > $*.tar.gz
249
250 clean:
251 rm -f $(ARCHIVES)
252
253 fresh:
f565f11 @samoht Fix server backend tests
samoht authored
254 rm -rf $(OPAM_ROOT) $(BIN)
255 ifneq ($(REPOKIND), server)
256 rm -rf $(OPAM_REPO)
257 endif
Something went wrong with that request. Please try again.