Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 205 lines (178 sloc) 6.595 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
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM serv…
samoht authored
17 BINARIES = opam opam-server \
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 p…
samoht authored
22
abc2630 @samoht Clean-up the functional tests
samoht authored
23 # opam in the path should not be a requirement
24 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
25 OPAM = $(ENV) opam --yes --root $(OPAM_ROOT)
7f510c5 @samoht Few makefile tweaks
samoht authored
26
abc2630 @samoht Clean-up the functional tests
samoht authored
27 BINARIES_ = $(BINARIES:%=$(BIN)/%)
28 BUILDS = $(foreach bin, $(BINARIES), ../_obuild/$(bin)/$(bin).asm)
29 ARCHIVES = $(PACKAGES:%=packages/%.tar.gz)
5cf8b97 @samoht Improve test Makefile
samoht authored
30
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
31 .PHONY: all rsync server git
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
32
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
33 all: rsync server git
34 @
35
36 run:
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
37 $(MAKE) fresh && \
989148e @tuong add a shortcut to the rule 'binaries'
tuong authored
38 $(MAKE) binaries && \
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
39 $(MAKE) init && \
40 $(MAKE) list && \
41 $(MAKE) upload && \
42 $(MAKE) install-remove && \
43 $(MAKE) list && \
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
44 $(MAKE) install-opt && \
45 $(MAKE) list && \
1089c50 @samoht [test] fix the rsync & server tests. git tests are still broken
samoht authored
46 $(MAKE) install && \
47 $(MAKE) list && \
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
48 $(MAKE) upload-new && \
49 $(MAKE) list && \
50 $(MAKE) upgrade && \
51 $(MAKE) list && \
52 $(MAKE) downgrade && \
146a38d @tuong fix the error when "opam list" after "opam switch"
tuong authored
53 $(MAKE) list
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
54
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
55 rsync:
56 $(MAKE) REPOKIND=rsync run
57
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
58 server:
59 $(MAKE) fresh
60 $(MAKE) binaries
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM serv…
samoht authored
61 rm -rf $(OPAM_SERVER_ROOT)
62 ($(ENV) opam-server --root $(OPAM_SERVER_ROOT) & \
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
63 (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
64 && killall opam-server || killall opam-server))
65
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
66 git:
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
67 $(MAKE) REPOKIND=git run
7f510c5 @samoht Few makefile tweaks
samoht authored
68
abc2630 @samoht Clean-up the functional tests
samoht authored
69 $(BINARIES_): $(BUILDS)
4e3553f Modified for the demo
Fabrice Le Fessant authored
70 mkdir -p $(BIN)
abc2630 @samoht Clean-up the functional tests
samoht authored
71 for bin in $(BINARIES); do \
72 cp ../_obuild/$$bin/$$bin.asm $(BIN)/$$bin ; \
73 done
1bcaf57 @samoht New format for user provided files
samoht authored
74
989148e @tuong add a shortcut to the rule 'binaries'
tuong authored
75 binaries: $(BINARIES_)
76
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
77 init:
78 rm -rf $(OPAM_REPO)
79 mkdir -p $(OPAM_REPO)
80 mkdir $(OPAM_REPO)/opam
81 mkdir $(OPAM_REPO)/descr
f8132ef @samoht [tests] add a switch test
samoht authored
82 mkdir $(OPAM_REPO)/compilers
83 ifeq ($(REPOKIND), git)
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
84 mkdir $(OPAM_REPO)/url
85 cd $(OPAM_REPO) && git init && \
86 touch README && git add README && \
87 git commit -a -m "Initial commit"
88 endif
efb851f @samoht [tests] make tests-server runs the functional tests with an OPAM serv…
samoht authored
89 $(OPAM) init $(REPO) $(OPAM_REPO) --kind $(REPOKIND)
7f510c5 @samoht Few makefile tweaks
samoht authored
90
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
91 upload: $(ARCHIVES)
92 ifeq ($(REPOKIND), git)
93 cp packages/P1-1.opam $(OPAM_REPO)/opam/P1.1.opam
94 cp packages/P1-1/README $(OPAM_REPO)/descr/P1.1
95 echo '$(OPAM_GIT)/P1-1' > $(OPAM_REPO)/url/P1.1
96 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P1"
97 cp packages/P2/README $(OPAM_REPO)/descr/P2.1
98 cp packages/P2.opam $(OPAM_REPO)/opam/P2.1.opam
99 echo '$(OPAM_GIT)/P2' > $(OPAM_REPO)/url/P2.1
100 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P2"
101 cp packages/P3.opam $(OPAM_REPO)/opam/P3.1~weird-version.test.opam
102 cp packages/P3/README $(OPAM_REPO)/descr/P3.1~weird-version.test
103 echo '$(OPAM_GIT)/P3' > $(OPAM_REPO)/url/P3.1~weird-version.test
104 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P3"
105 cp packages/P4-1.opam $(OPAM_REPO)/opam/P4.1.opam
106 cp packages/P4/README $(OPAM_REPO)/descr/P4.1
107 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.1
108 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4"
c37dcfa @samoht [tests] fix git tests
samoht authored
109 cp packages/P5.opam $(OPAM_REPO)/opam/P5.1.opam
110 cp packages/P5/README $(OPAM_REPO)/descr/P5.1
111 echo '$(OPAM_GIT)/P5' > $(OPAM_REPO)/url/P5.1
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
112 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P5"
f8132ef @samoht [tests] add a switch test
samoht authored
113 cp compilers/* $(OPAM_REPO)/compilers/
114 cd $(OPAM_REPO)/compilers && git add * && git commit -a -m "Adding compilers"
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
115 rm -rf $(OPAM_GIT) && mkdir -p $(OPAM_GIT)
116 mkdir $(OPAM_GIT)/P1-1 && cp packages/P1-1/* $(OPAM_GIT)/P1-1/
117 mkdir $(OPAM_GIT)/P2 && cp packages/P2/* $(OPAM_GIT)/P2/
118 mkdir $(OPAM_GIT)/P3 && cp packages/P3/* $(OPAM_GIT)/P3/
119 mkdir $(OPAM_GIT)/P4 && cp packages/P4/* $(OPAM_GIT)/P4/
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
120 mkdir $(OPAM_GIT)/P5 && cp packages/P5/* $(OPAM_GIT)/P5/
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
121 cd $(OPAM_GIT)/P1-1 && git init && git add * && git commit -a -m "initial commit"
122 cd $(OPAM_GIT)/P2 && git init && git add * && git commit -a -m "initial commit"
123 cd $(OPAM_GIT)/P3 && git init && git add * && git commit -a -m "initial commit"
124 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
125 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
126 else
abc2630 @samoht Clean-up the functional tests
samoht authored
127 cd packages && \
128 $(OPAM) upload -opam P1-1.opam -descr P1-1/README -archive P1-1.tar.gz -repo $(REPO)
129 cd packages && \
130 $(OPAM) upload -opam P2.opam -descr P2/README -archive P2.tar.gz -repo $(REPO)
131 cd packages && \
132 $(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
133 cd packages && \
134 $(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
135 cd packages && \
136 $(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
137 endif
f8132ef @samoht [tests] add a switch test
samoht authored
138 cp compilers/* $(OPAM_REPO)/compilers/
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
139 $(OPAM) update # update the list of available packages with the one being updated
7f510c5 @samoht Few makefile tweaks
samoht authored
140
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
141 list:
abc2630 @samoht Clean-up the functional tests
samoht authored
142 $(OPAM) list
7f510c5 @samoht Few makefile tweaks
samoht authored
143
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
144 install-remove:
abc2630 @samoht Clean-up the functional tests
samoht authored
145 cd packages && $(OPAM) install P1
146 cd packages && $(OPAM) remove P1
a802765 @samoht Add a simple remove tests
samoht authored
147
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
148 install-opt:
149 cd packages && $(OPAM) install P5
150 cd packages && $(OPAM) install P2
151 cd packages && $(OPAM) remove P5
152 cd packages && $(OPAM) remove P2
1089c50 @samoht [test] fix the rsync & server tests. git tests are still broken
samoht authored
153 cd packages && $(OPAM) remove P1
7717946 @samoht [tests] Add a test for optional dependencies
samoht authored
154
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
155 install:
156 $(OPAM) install P1 && \
157 $(OPAM) install P2 && \
158 $(OPAM) install P3 && \
abc2630 @samoht Clean-up the functional tests
samoht authored
159 $(OPAM) install P4
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"
165 cp packages/P4-2.opam $(OPAM_REPO)/opam/P4.2.opam
166 cp packages/P4/README $(OPAM_REPO)/descr/P4.2
167 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.2
168 cp packages/P4-3.opam $(OPAM_REPO)/opam/P4.3.opam
169 cp packages/P4/README $(OPAM_REPO)/descr/P4.3
170 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.3
171 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4.2 and P4.3"
172 else
abc2630 @samoht Clean-up the functional tests
samoht authored
173 cd packages && \
174 $(OPAM) upload -opam P1-2.opam -descr P1-2/README -archive P1-2.tar.gz -repo $(REPO)
175 cd packages && \
176 $(OPAM) upload -opam P4-2.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
177 cd packages && \
178 $(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
179 endif
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
180 $(OPAM) update # update the list of available packages with the one being updated
181
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
182 upgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
183 $(OPAM) upgrade
757fe55 @samoht Add more tests
samoht authored
184
e1744d3 @samoht [tests] Aslo test the git repository pluggins
samoht authored
185 downgrade:
abc2630 @samoht Clean-up the functional tests
samoht authored
186 $(OPAM) install P4.2
7e293d3 @tuong Finish the bootstrap (for the case we only consider the library part …
tuong authored
187
6b3599b @tuong Merge branch 'release-0.1' of github.com:OCamlPro/opam into release-0.1
tuong authored
188 switch:
f8132ef @samoht [tests] add a switch test
samoht authored
189 $(MAKE) fresh
190 $(MAKE) binaries
191 $(MAKE) init
192 $(MAKE) upload
193 $(MAKE) install
194 $(OPAM) switch -list
195 $(OPAM) switch -clone 3.12.1-byte
7892d49 @tuong Towards the complete support of "opam switch".
tuong authored
196
5cf8b97 @samoht Improve test Makefile
samoht authored
197 packages/%.tar.gz: packages/% packages/%/*
7f510c5 @samoht Few makefile tweaks
samoht authored
198 cd packages && tar cz $* > $*.tar.gz
199
200 clean:
201 rm -f $(ARCHIVES)
202
203 fresh:
abc2630 @samoht Clean-up the functional tests
samoht authored
204 rm -rf $(OPAM_ROOT) $(OPAM_REPO) $(BIN)
Something went wrong with that request. Please try again.