Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 236 lines (206 sloc) 7.488 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 server ...
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 server ...
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 on...
samoht authored
17 BINARIES = opam opam-server opam-check \
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM server ...
samoht 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 \
20 opam-git-init opam-git-update opam-git-download opam-git-upload
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
21 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 path...
samoht authored
22
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
23 OCAMLVERSION = $(shell ocamlc -version)
24
abc2630 @samoht Clean-up the functional tests
samoht authored
25 # opam in the path should not be a requirement
26 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
27 OPAM = $(ENV) opam --yes --root $(OPAM_ROOT)
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the on...
samoht authored
28 CHECK = $(ENV) opam-check --root $(OPAM_ROOT)
7f510c5 @samoht Few makefile tweaks
samoht authored
29
abc2630 @samoht Clean-up the functional tests
samoht authored
30 BINARIES_ = $(BINARIES:%=$(BIN)/%)
31 BUILDS = $(foreach bin, $(BINARIES), ../_obuild/$(bin)/$(bin).asm)
32 ARCHIVES = $(PACKAGES:%=packages/%.tar.gz)
5cf8b97 @samoht Improve test Makefile
samoht authored
33
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
34 .PHONY: all rsync server git
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
35
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
36 all: rsync server git
37 @
38
39 run:
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
40 $(MAKE) fresh && \
989148e @tuong add a shortcut to the rule 'binaries'
tuong authored
41 $(MAKE) binaries && \
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
42 $(MAKE) init && \
43 $(MAKE) list && \
44 $(MAKE) upload && \
45 $(MAKE) install-remove && \
46 $(MAKE) list && \
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
47 $(MAKE) install-opt && \
48 $(MAKE) list && \
1089c50 @samoht [test] fix the rsync & server tests. git tests are still broken
samoht authored
49 $(MAKE) install && \
50 $(MAKE) list && \
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
51 $(MAKE) upload-new && \
52 $(MAKE) list && \
53 $(MAKE) upgrade && \
54 $(MAKE) list && \
55 $(MAKE) downgrade && \
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
56 $(MAKE) list && \
57 $(MAKE) switch-alias && \
58 $(MAKE) list && \
59 $(MAKE) switch-env
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
60
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
61 rsync:
62 $(MAKE) REPOKIND=rsync run
63
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
64 server:
65 $(MAKE) fresh
66 $(MAKE) binaries
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
67 rm -rf $(OPAM_SERVER_ROOT)
68 ($(ENV) opam-server --root $(OPAM_SERVER_ROOT) & \
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
69 (sleep 1 && $(MAKE) REPOKIND=server OPAM_REPO=$(OPAM_SERVER) run \
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
70 && killall opam-server || killall opam-server))
71
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
72 git:
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
73 $(MAKE) REPOKIND=git run
7f510c5 @samoht Few makefile tweaks
samoht authored
74
abc2630 @samoht Clean-up the functional tests
samoht authored
75 $(BINARIES_): $(BUILDS)
4e3553f Modified for the demo
Fabrice Le Fessant authored
76 mkdir -p $(BIN)
abc2630 @samoht Clean-up the functional tests
samoht authored
77 for bin in $(BINARIES); do \
78 cp ../_obuild/$$bin/$$bin.asm $(BIN)/$$bin ; \
79 done
1bcaf57 @samoht New format for user provided files
samoht authored
80
989148e @tuong add a shortcut to the rule 'binaries'
tuong authored
81 binaries: $(BINARIES_)
82
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
83 init:
84 rm -rf $(OPAM_REPO)
85 mkdir -p $(OPAM_REPO)
86 mkdir $(OPAM_REPO)/opam
87 mkdir $(OPAM_REPO)/descr
f8132ef @samoht [tests] add a switch test
samoht authored
88 mkdir $(OPAM_REPO)/compilers
89 ifeq ($(REPOKIND), git)
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
90 mkdir $(OPAM_REPO)/url
91 cd $(OPAM_REPO) && git init && \
92 touch README && git add README && \
93 git commit -a -m "Initial commit"
94 endif
0ebf54c @samoht Only globals args starts by --, so rename --kind to -kind
samoht authored
95 $(OPAM) init $(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)
99 cp packages/P1-1.opam $(OPAM_REPO)/opam/P1.1.opam
100 cp packages/P1-1/README $(OPAM_REPO)/descr/P1.1
101 echo '$(OPAM_GIT)/P1-1' > $(OPAM_REPO)/url/P1.1
102 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P1"
103 cp packages/P2/README $(OPAM_REPO)/descr/P2.1
104 cp packages/P2.opam $(OPAM_REPO)/opam/P2.1.opam
105 echo '$(OPAM_GIT)/P2' > $(OPAM_REPO)/url/P2.1
106 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P2"
107 cp packages/P3.opam $(OPAM_REPO)/opam/P3.1~weird-version.test.opam
108 cp packages/P3/README $(OPAM_REPO)/descr/P3.1~weird-version.test
109 echo '$(OPAM_GIT)/P3' > $(OPAM_REPO)/url/P3.1~weird-version.test
110 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P3"
111 cp packages/P4-1.opam $(OPAM_REPO)/opam/P4.1.opam
112 cp packages/P4/README $(OPAM_REPO)/descr/P4.1
113 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.1
114 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4"
c37dcfa @samoht [tests] fix git tests
samoht authored
115 cp packages/P5.opam $(OPAM_REPO)/opam/P5.1.opam
116 cp packages/P5/README $(OPAM_REPO)/descr/P5.1
117 echo '$(OPAM_GIT)/P5' > $(OPAM_REPO)/url/P5.1
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
118 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P5"
f8132ef @samoht [tests] add a switch test
samoht authored
119 cp compilers/* $(OPAM_REPO)/compilers/
120 cd $(OPAM_REPO)/compilers && git add * && git commit -a -m "Adding compilers"
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
121 rm -rf $(OPAM_GIT) && mkdir -p $(OPAM_GIT)
122 mkdir $(OPAM_GIT)/P1-1 && cp packages/P1-1/* $(OPAM_GIT)/P1-1/
123 mkdir $(OPAM_GIT)/P2 && cp packages/P2/* $(OPAM_GIT)/P2/
124 mkdir $(OPAM_GIT)/P3 && cp packages/P3/* $(OPAM_GIT)/P3/
125 mkdir $(OPAM_GIT)/P4 && cp packages/P4/* $(OPAM_GIT)/P4/
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
126 mkdir $(OPAM_GIT)/P5 && cp packages/P5/* $(OPAM_GIT)/P5/
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
127 cd $(OPAM_GIT)/P1-1 && git init && git add * && git commit -a -m "initial commit"
128 cd $(OPAM_GIT)/P2 && git init && git add * && git commit -a -m "initial commit"
129 cd $(OPAM_GIT)/P3 && git init && git add * && git commit -a -m "initial commit"
130 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
131 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
132 else
abc2630 @samoht Clean-up the functional tests
samoht authored
133 cd packages && \
134 $(OPAM) upload -opam P1-1.opam -descr P1-1/README -archive P1-1.tar.gz -repo $(REPO)
135 cd packages && \
136 $(OPAM) upload -opam P2.opam -descr P2/README -archive P2.tar.gz -repo $(REPO)
137 cd packages && \
138 $(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
139 cd packages && \
140 $(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
141 cd packages && \
142 $(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
143 endif
f8132ef @samoht [tests] add a switch test
samoht authored
144 cp compilers/* $(OPAM_REPO)/compilers/
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
145 $(OPAM) update # update the list of available packages with the one being updated
7f510c5 @samoht Few makefile tweaks
samoht authored
146
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
147 list:
abc2630 @samoht Clean-up the functional tests
samoht authored
148 $(OPAM) list
7f510c5 @samoht Few makefile tweaks
samoht authored
149
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
150 install-remove:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the on...
samoht authored
151 $(OPAM) install P1 &&\
152 $(CHECK) -l install-remove P1.1 &&\
153 $(OPAM) remove P1
a802765 @samoht Add a simple remove tests
samoht authored
154
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
155 install-opt:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the on...
samoht authored
156 $(OPAM) install P5 &&\
157 $(CHECK) -l install-opt P1.1 P5.1 &&\
158 $(OPAM) install P2 &&\
159 $(CHECK) -l install-opt P1.1 P2.1 P5.1 &&\
160 $(OPAM) remove P5 &&\
161 $(OPAM) remove P2 &&\
162 $(OPAM) remove P1 &&\
163 $(CHECK) -l install-opt
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
164
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
165 install:
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the on...
samoht authored
166 $(OPAM) install P1 &&\
167 $(CHECK) -l install P1.1 &&\
168 $(OPAM) install P2 &&\
169 $(CHECK) -l install P1.1 P2.1 &&\
170 $(OPAM) install P3 &&\
171 $(CHECK) -l install P1.1 P2.1 P3.1~weird-version.test &&\
172 $(OPAM) install P4 &&\
173 $(CHECK) -l install P1.1 P2.1 P3.1~weird-version.test P4.1
a779ca3 @samoht More tests
samoht authored
174
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
175 upload-new:
176 ifeq ($(REPOKIND), git)
177 echo "(* new line *)" >> $(OPAM_GIT)/P1-1/p1.ml
178 cd $(OPAM_GIT)/P1-1 && git commit -a -m "a small change"
179 cp packages/P4-2.opam $(OPAM_REPO)/opam/P4.2.opam
180 cp packages/P4/README $(OPAM_REPO)/descr/P4.2
181 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.2
182 cp packages/P4-3.opam $(OPAM_REPO)/opam/P4.3.opam
183 cp packages/P4/README $(OPAM_REPO)/descr/P4.3
184 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.3
185 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4.2 and P4.3"
186 else
abc2630 @samoht Clean-up the functional tests
samoht authored
187 cd packages && \
188 $(OPAM) upload -opam P1-2.opam -descr P1-2/README -archive P1-2.tar.gz -repo $(REPO)
189 cd packages && \
190 $(OPAM) upload -opam P4-2.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
191 cd packages && \
192 $(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
193 endif
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
194 $(OPAM) update # update the list of available packages with the one being updated
195
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
196 upgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
197 $(OPAM) upgrade
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the on...
samoht authored
198 ifeq ($(REPOKIND), git)
199 $(CHECK) -l upgrade P1.1 P2.1 P3.1~weird-version.test P4.3
200 else
201 $(CHECK) -l upgrade P1.2 P2.1 P3.1~weird-version.test P4.3
202 endif
757fe55 @samoht Add more tests
samoht authored
203
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
204 downgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
205 $(OPAM) install P4.2
ccf5fe4 @samoht [tests] explicitely verify that the installed versions are really the on...
samoht authored
206 $(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 of ...
tuong authored
207
d2b2ee1 @samoht [switch] Add some test-cases, the ENV things seems to work
samoht authored
208 switch-alias:
209 $(OPAM) remove P3.1~weird-version.test P4.2
210 $(CHECK) -l switch-alias P1.1 P2.1
211 $(OPAM) switch -alias test $(OCAMLVERSION) -clone
212 $(CHECK) -l switch-alias P1.1 P2.1
213 $(OPAM) switch -list
214
215 switch-env:
216 $(OPAM) switch dummy
217 $(OPAM) install P4
218
6b3599b @tuong Merge branch 'release-0.1' of github.com:OCamlPro/opam into release-0.1
tuong authored
219 switch:
f8132ef @samoht [tests] add a switch test
samoht authored
220 $(MAKE) fresh
221 $(MAKE) binaries
222 $(MAKE) init
223 $(MAKE) upload
224 $(MAKE) install
225 $(OPAM) switch -list
226 $(OPAM) switch -clone 3.12.1-byte
7892d49 @tuong Towards the complete support of "opam switch".
tuong authored
227
5cf8b97 @samoht Improve test Makefile
samoht authored
228 packages/%.tar.gz: packages/% packages/%/*
7f510c5 @samoht Few makefile tweaks
samoht authored
229 cd packages && tar cz $* > $*.tar.gz
230
231 clean:
232 rm -f $(ARCHIVES)
233
234 fresh:
abc2630 @samoht Clean-up the functional tests
samoht authored
235 rm -rf $(OPAM_ROOT) $(OPAM_REPO) $(BIN)
Something went wrong with that request. Please try again.