Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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