Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 245 lines (214 sloc) 7.862 kb
4e3553f Modified for the demo
Fabrice Le Fessant 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 Modified for the demo
Fabrice Le Fessant 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
28 ENV = OCAMLRUNPARAM=b OPAMDEBUG=1 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 Modified for the demo
Fabrice Le Fessant 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:
86 rm -rf $(OPAM_REPO)
87 mkdir -p $(OPAM_REPO)
88 mkdir $(OPAM_REPO)/opam
89 mkdir $(OPAM_REPO)/descr
f8132ef @samoht [tests] add a switch test
samoht authored
90 mkdir $(OPAM_REPO)/compilers
91 ifeq ($(REPOKIND), git)
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
92 mkdir $(OPAM_REPO)/url
93 cd $(OPAM_REPO) && git init && \
94 touch README && git add README && \
95 git commit -a -m "Initial commit"
96 endif
0ebf54c @samoht Only globals args starts by --, so rename --kind to -kind
samoht authored
97 $(OPAM) init $(REPO) $(OPAM_REPO) -kind $(REPOKIND)
7f510c5 @samoht Few makefile tweaks
samoht authored
98
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
99 upload: $(ARCHIVES)
100 ifeq ($(REPOKIND), git)
101 cp packages/P1-1.opam $(OPAM_REPO)/opam/P1.1.opam
102 cp packages/P1-1/README $(OPAM_REPO)/descr/P1.1
103 echo '$(OPAM_GIT)/P1-1' > $(OPAM_REPO)/url/P1.1
104 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P1"
105 cp packages/P2/README $(OPAM_REPO)/descr/P2.1
106 cp packages/P2.opam $(OPAM_REPO)/opam/P2.1.opam
107 echo '$(OPAM_GIT)/P2' > $(OPAM_REPO)/url/P2.1
108 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P2"
109 cp packages/P3.opam $(OPAM_REPO)/opam/P3.1~weird-version.test.opam
110 cp packages/P3/README $(OPAM_REPO)/descr/P3.1~weird-version.test
111 echo '$(OPAM_GIT)/P3' > $(OPAM_REPO)/url/P3.1~weird-version.test
112 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P3"
113 cp packages/P4-1.opam $(OPAM_REPO)/opam/P4.1.opam
114 cp packages/P4/README $(OPAM_REPO)/descr/P4.1
115 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.1
116 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4"
c37dcfa @samoht [tests] fix git tests
samoht authored
117 cp packages/P5.opam $(OPAM_REPO)/opam/P5.1.opam
118 cp packages/P5/README $(OPAM_REPO)/descr/P5.1
119 echo '$(OPAM_GIT)/P5' > $(OPAM_REPO)/url/P5.1
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
120 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P5"
f8132ef @samoht [tests] add a switch test
samoht authored
121 cp compilers/* $(OPAM_REPO)/compilers/
122 cd $(OPAM_REPO)/compilers && git add * && git commit -a -m "Adding compilers"
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
123 rm -rf $(OPAM_GIT) && mkdir -p $(OPAM_GIT)
124 mkdir $(OPAM_GIT)/P1-1 && cp packages/P1-1/* $(OPAM_GIT)/P1-1/
125 mkdir $(OPAM_GIT)/P2 && cp packages/P2/* $(OPAM_GIT)/P2/
126 mkdir $(OPAM_GIT)/P3 && cp packages/P3/* $(OPAM_GIT)/P3/
127 mkdir $(OPAM_GIT)/P4 && cp packages/P4/* $(OPAM_GIT)/P4/
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
128 mkdir $(OPAM_GIT)/P5 && cp packages/P5/* $(OPAM_GIT)/P5/
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
129 cd $(OPAM_GIT)/P1-1 && git init && git add * && git commit -a -m "initial commit"
130 cd $(OPAM_GIT)/P2 && git init && git add * && git commit -a -m "initial commit"
131 cd $(OPAM_GIT)/P3 && git init && git add * && git commit -a -m "initial commit"
132 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
133 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
134 else
abc2630 @samoht Clean-up the functional tests
samoht authored
135 cd packages && \
136 $(OPAM) upload -opam P1-1.opam -descr P1-1/README -archive P1-1.tar.gz -repo $(REPO)
137 cd packages && \
138 $(OPAM) upload -opam P2.opam -descr P2/README -archive P2.tar.gz -repo $(REPO)
139 cd packages && \
140 $(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
141 cd packages && \
142 $(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
143 cd packages && \
144 $(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
145 endif
f8132ef @samoht [tests] add a switch test
samoht authored
146 cp compilers/* $(OPAM_REPO)/compilers/
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
147 $(OPAM) update # update the list of available packages with the one being updated
7f510c5 @samoht Few makefile tweaks
samoht authored
148
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
149 list:
abc2630 @samoht Clean-up the functional tests
samoht authored
150 $(OPAM) list
7f510c5 @samoht Few makefile tweaks
samoht authored
151
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
152 install-remove:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
153 $(OPAM) install P1 &&\
154 $(CHECK) -l install-remove P1.1 &&\
155 $(OPAM) remove P1
a802765 @samoht Add a simple remove tests
samoht authored
156
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
157 install-opt:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
158 $(OPAM) install P5 &&\
159 $(CHECK) -l install-opt P1.1 P5.1 &&\
160 $(OPAM) install P2 &&\
161 $(CHECK) -l install-opt P1.1 P2.1 P5.1 &&\
162 $(OPAM) remove P5 &&\
163 $(OPAM) remove P2 &&\
164 $(OPAM) remove P1 &&\
165 $(CHECK) -l install-opt
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
166
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
167 install:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
168 $(OPAM) install P1 &&\
169 $(CHECK) -l install P1.1 &&\
170 $(OPAM) install P2 &&\
171 $(CHECK) -l install P1.1 P2.1 &&\
172 $(OPAM) install P3 &&\
173 $(CHECK) -l install P1.1 P2.1 P3.1~weird-version.test &&\
174 $(OPAM) install P4 &&\
175 $(CHECK) -l install P1.1 P2.1 P3.1~weird-version.test P4.1
a779ca3 @samoht More tests
samoht authored
176
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
177 upload-new:
178 ifeq ($(REPOKIND), git)
179 echo "(* new line *)" >> $(OPAM_GIT)/P1-1/p1.ml
180 cd $(OPAM_GIT)/P1-1 && git commit -a -m "a small change"
181 cp packages/P4-2.opam $(OPAM_REPO)/opam/P4.2.opam
182 cp packages/P4/README $(OPAM_REPO)/descr/P4.2
183 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.2
184 cp packages/P4-3.opam $(OPAM_REPO)/opam/P4.3.opam
185 cp packages/P4/README $(OPAM_REPO)/descr/P4.3
186 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.3
187 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4.2 and P4.3"
188 else
abc2630 @samoht Clean-up the functional tests
samoht authored
189 cd packages && \
190 $(OPAM) upload -opam P1-2.opam -descr P1-2/README -archive P1-2.tar.gz -repo $(REPO)
191 cd packages && \
192 $(OPAM) upload -opam P4-2.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
193 cd packages && \
194 $(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
195 endif
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
196 $(OPAM) update # update the list of available packages with the one being updated
197
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
198 upgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
199 $(OPAM) upgrade
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
200 ifeq ($(REPOKIND), git)
201 $(CHECK) -l upgrade P1.1 P2.1 P3.1~weird-version.test P4.3
202 else
203 $(CHECK) -l upgrade P1.2 P2.1 P3.1~weird-version.test P4.3
204 endif
757fe55 @samoht Add more tests
samoht authored
205
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
206 downgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
207 $(OPAM) install P4.2
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the…
samoht authored
208 $(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
209
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
210 switch-alias:
211 $(OPAM) remove P3.1~weird-version.test P4.2
212 $(CHECK) -l switch-alias P1.1 P2.1
213 $(OPAM) switch -alias test $(OCAMLVERSION) -clone
6ff4f04 @samoht Add compiler constraints
samoht authored
214 $(CHECK) -l switch-alias-test P1.1 P2.1
215 $(OPAM) switch 4.00.0
216 $(OPAM) install P1
217 $(CHECK) -l switch-alias-4.00 P1.1
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
218
0331597 @samoht [switch] env + package fields work as expected in compiler descriptio…
samoht authored
219 switch-env-packages:
6ff4f04 @samoht Add compiler constraints
samoht authored
220 $(OPAM) switch 3.12.1
0331597 @samoht [switch] env + package fields work as expected in compiler descriptio…
samoht authored
221 ifeq ($(REPOKIND), git)
222 $(CHECK) -l switch-env-packages P1.1 P2.1 P3.1~weird-version.test P4.3
223 else
224 $(CHECK) -l switch-env-packages P1.2 P2.1 P3.1~weird-version.test P4.3
225 endif
6ff4f04 @samoht Add compiler constraints
samoht authored
226 ./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
227
6b3599b @tuong Merge branch 'release-0.1' of github.com:OCamlPro/opam into release-0.1
tuong authored
228 switch:
f8132ef @samoht [tests] add a switch test
samoht authored
229 $(MAKE) fresh
230 $(MAKE) binaries
231 $(MAKE) init
232 $(MAKE) upload
233 $(MAKE) install
234 $(OPAM) switch -list
235 $(OPAM) switch -clone 3.12.1-byte
7892d49 @tuong Towards the complete support of "opam switch".
tuong authored
236
5cf8b97 @samoht Improve test Makefile
samoht authored
237 packages/%.tar.gz: packages/% packages/%/*
7f510c5 @samoht Few makefile tweaks
samoht authored
238 cd packages && tar cz $* > $*.tar.gz
239
240 clean:
241 rm -f $(ARCHIVES)
242
243 fresh:
abc2630 @samoht Clean-up the functional tests
samoht authored
244 rm -rf $(OPAM_ROOT) $(OPAM_REPO) $(BIN)
Something went wrong with that request. Please try again.