Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 202 lines (175 sloc) 6.554 kb
4e3553f Modified for the demo
Fabrice Le Fessant authored
1 # never use /tmp
2 # should be absolute
3 TEST_DIR=/tmp
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
4 OPAM_ROOT = $(TEST_DIR)/OPAM.ROOT
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
5 OPAM_REPO = $(TEST_DIR)/OPAM.REPO
6 BIN = $(TEST_DIR)/OPAM.BIN
7 REPO = test
efb851f Thomas Gazagnaire [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 Thomas Gazagnaire [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 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
14 # To test GIT repo
15 OPAM_GIT = $(TEST_DIR)/OPAM.GIT
16
efb851f Thomas Gazagnaire [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
17 BINARIES = opam opam-server \
18 opam-rsync-init opam-rsync-update opam-rsync-download opam-rsync-upload \
e1744d3 Thomas Gazagnaire [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 Thomas Gazagnaire [tests] Add a test for optional dependencies
samoht authored
21 PACKAGES = P1-1 P1-2 P2 P3 P4 P5
f8dc221 Thomas Gazagnaire Add --root to ocp-get and ocp-get-server to change the default root path...
samoht authored
22
abc2630 Thomas Gazagnaire 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 Thomas Gazagnaire Add a --yes option to always answer yes to OPAM questions
samoht authored
25 OPAM = $(ENV) opam --yes --root $(OPAM_ROOT)
7f510c5 Thomas Gazagnaire Few makefile tweaks
samoht authored
26
abc2630 Thomas Gazagnaire 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 Thomas Gazagnaire Improve test Makefile
samoht authored
30
ec59f94 Thomas Gazagnaire [tests] make tests should test all the backends
samoht authored
31 .PHONY: all rsync server git
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
32
ec59f94 Thomas Gazagnaire [tests] make tests should test all the backends
samoht authored
33 all: rsync server git
34 @
35
36 run:
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
37 $(MAKE) fresh && \
989148e add a shortcut to the rule 'binaries'
Frédéric Tuong authored
38 $(MAKE) binaries && \
e1744d3 Thomas Gazagnaire [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 && \
44 $(MAKE) install && \
45 $(MAKE) list && \
7717946 Thomas Gazagnaire [tests] Add a test for optional dependencies
samoht authored
46 $(MAKE) install-opt && \
47 $(MAKE) list && \
e1744d3 Thomas Gazagnaire [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 fix the error when "opam list" after "opam switch"
Frédéric Tuong authored
53 $(MAKE) list
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
54
ec59f94 Thomas Gazagnaire [tests] make tests should test all the backends
samoht authored
55 rsync:
56 $(MAKE) REPOKIND=rsync run
57
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
58 server:
59 $(MAKE) fresh
60 $(MAKE) binaries
efb851f Thomas Gazagnaire [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
61 rm -rf $(OPAM_SERVER_ROOT)
62 ($(ENV) opam-server --root $(OPAM_SERVER_ROOT) & \
ec59f94 Thomas Gazagnaire [tests] make tests should test all the backends
samoht authored
63 (sleep 1 && $(MAKE) REPOKIND=server OPAM_REPO=$(OPAM_SERVER) run \
efb851f Thomas Gazagnaire [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
64 && killall opam-server || killall opam-server))
65
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
66 git:
ec59f94 Thomas Gazagnaire [tests] make tests should test all the backends
samoht authored
67 $(MAKE) REPOKIND=git run
7f510c5 Thomas Gazagnaire Few makefile tweaks
samoht authored
68
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
69 $(BINARIES_): $(BUILDS)
4e3553f Modified for the demo
Fabrice Le Fessant authored
70 mkdir -p $(BIN)
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
71 for bin in $(BINARIES); do \
72 cp ../_obuild/$$bin/$$bin.asm $(BIN)/$$bin ; \
73 done
1bcaf57 Thomas Gazagnaire New format for user provided files
samoht authored
74
989148e add a shortcut to the rule 'binaries'
Frédéric Tuong authored
75 binaries: $(BINARIES_)
76
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
77 init:
efb851f Thomas Gazagnaire [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
78 ifeq ($(REPOKIND),rsync)
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
79 mkdir -p $(OPAM_REPO)
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
80 mkdir $(OPAM_REPO)/opam
81 mkdir $(OPAM_REPO)/descr
efb851f Thomas Gazagnaire [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
82 endif
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
83 ifeq ($(REPOKIND), git)
84 rm -rf $(OPAM_REPO)
85 mkdir -p $(OPAM_REPO)
86 mkdir $(OPAM_REPO)/opam
87 mkdir $(OPAM_REPO)/descr
88 mkdir $(OPAM_REPO)/url
89 cd $(OPAM_REPO) && git init && \
90 touch README && git add README && \
91 git commit -a -m "Initial commit"
92 endif
efb851f Thomas Gazagnaire [tests] make tests-server runs the functional tests with an OPAM server ...
samoht authored
93 $(OPAM) init $(REPO) $(OPAM_REPO) --kind $(REPOKIND)
7f510c5 Thomas Gazagnaire Few makefile tweaks
samoht authored
94
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
95 upload: $(ARCHIVES)
96 ifeq ($(REPOKIND), git)
97 cp packages/P1-1.opam $(OPAM_REPO)/opam/P1.1.opam
98 cp packages/P1-1/README $(OPAM_REPO)/descr/P1.1
99 echo '$(OPAM_GIT)/P1-1' > $(OPAM_REPO)/url/P1.1
100 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P1"
101 cp packages/P2/README $(OPAM_REPO)/descr/P2.1
102 cp packages/P2.opam $(OPAM_REPO)/opam/P2.1.opam
103 echo '$(OPAM_GIT)/P2' > $(OPAM_REPO)/url/P2.1
104 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P2"
105 cp packages/P3.opam $(OPAM_REPO)/opam/P3.1~weird-version.test.opam
106 cp packages/P3/README $(OPAM_REPO)/descr/P3.1~weird-version.test
107 echo '$(OPAM_GIT)/P3' > $(OPAM_REPO)/url/P3.1~weird-version.test
108 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P3"
109 cp packages/P4-1.opam $(OPAM_REPO)/opam/P4.1.opam
110 cp packages/P4/README $(OPAM_REPO)/descr/P4.1
111 echo '$(OPAM_GIT)/P4' > $(OPAM_REPO)/url/P4.1
112 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P4"
7717946 Thomas Gazagnaire [tests] Add a test for optional dependencies
samoht authored
113 cp packages/P5.opam $(OPAM_REPO)/opam/P5.opam
114 cp packages/P5/README $(OPAM_REPO)/descr/P5
115 echo '$(OPAM_GIT)/P5' > $(OPAM_REPO)/url/P5
116 cd $(OPAM_REPO) && git add * && git commit -a -m "Adding P5"
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
117 rm -rf $(OPAM_GIT) && mkdir -p $(OPAM_GIT)
118 mkdir $(OPAM_GIT)/P1-1 && cp packages/P1-1/* $(OPAM_GIT)/P1-1/
119 mkdir $(OPAM_GIT)/P2 && cp packages/P2/* $(OPAM_GIT)/P2/
120 mkdir $(OPAM_GIT)/P3 && cp packages/P3/* $(OPAM_GIT)/P3/
121 mkdir $(OPAM_GIT)/P4 && cp packages/P4/* $(OPAM_GIT)/P4/
7717946 Thomas Gazagnaire [tests] Add a test for optional dependencies
samoht authored
122 mkdir $(OPAM_GIT)/P5 && cp packages/P5/* $(OPAM_GIT)/P5/
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
123 cd $(OPAM_GIT)/P1-1 && git init && git add * && git commit -a -m "initial commit"
124 cd $(OPAM_GIT)/P2 && git init && git add * && git commit -a -m "initial commit"
125 cd $(OPAM_GIT)/P3 && git init && git add * && git commit -a -m "initial commit"
126 cd $(OPAM_GIT)/P4 && git init && git add * && git commit -a -m "initial commit"
7717946 Thomas Gazagnaire [tests] Add a test for optional dependencies
samoht authored
127 cd $(OPAM_GIT)/P5 && git init && git add * && git commit -a -m "initial commit"
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
128 else
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
129 cd packages && \
130 $(OPAM) upload -opam P1-1.opam -descr P1-1/README -archive P1-1.tar.gz -repo $(REPO)
131 cd packages && \
132 $(OPAM) upload -opam P2.opam -descr P2/README -archive P2.tar.gz -repo $(REPO)
133 cd packages && \
134 $(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
135 cd packages && \
136 $(OPAM) upload -opam P4-1.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
7717946 Thomas Gazagnaire [tests] Add a test for optional dependencies
samoht authored
137 cd packages && \
138 $(OPAM) upload -opam P5.opam -descr P5/README -archive P5.tar.gz -repo $(REPO)
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
139 endif
f6f4b18 fix "opam list" (tests was wrong during the 'upgrade' rule)
Frédéric Tuong authored
140 $(OPAM) update # update the list of available packages with the one being updated
7f510c5 Thomas Gazagnaire Few makefile tweaks
samoht authored
141
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
142 list:
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
143 $(OPAM) list
7f510c5 Thomas Gazagnaire Few makefile tweaks
samoht authored
144
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
145 install-remove:
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
146 cd packages && $(OPAM) install P1
147 cd packages && $(OPAM) remove P1
a802765 Thomas Gazagnaire Add a simple remove tests
samoht authored
148
7717946 Thomas Gazagnaire [tests] Add a test for optional dependencies
samoht authored
149 install-opt:
150 cd packages && $(OPAM) install P5
151 cd packages && $(OPAM) install P2
152 cd packages && $(OPAM) remove P5
153 cd packages && $(OPAM) remove P2
154
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
155 install:
156 $(OPAM) install P1 && \
157 $(OPAM) install P2 && \
158 $(OPAM) install P3 && \
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
159 $(OPAM) install P4
a779ca3 Thomas Gazagnaire More tests
samoht authored
160
e1744d3 Thomas Gazagnaire [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 Thomas Gazagnaire 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 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
179 endif
f6f4b18 fix "opam list" (tests was wrong during the 'upgrade' rule)
Frédéric Tuong authored
180 $(OPAM) update # update the list of available packages with the one being updated
181
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
182 upgrade:
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
183 $(OPAM) upgrade
757fe55 Thomas Gazagnaire Add more tests
samoht authored
184
e1744d3 Thomas Gazagnaire [tests] Aslo test the git repository pluggins
samoht authored
185 downgrade:
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
186 $(OPAM) install P4.2
7e293d3 Finish the bootstrap (for the case we only consider the library part of ...
Frédéric Tuong authored
187
6b3599b Merge branch 'release-0.1' of github.com:OCamlPro/opam into release-0.1
Frédéric Tuong authored
188 switch:
7892d49 Towards the complete support of "opam switch".
Frédéric Tuong authored
189 mkdir -p /tmp/opam-archives && wget -P /tmp/opam-archives -qN http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-3.11.2.tar.gz
190 mkdir -p $(OPAM_ROOT)/compilers
191 cp packages/3.11.2.comp $(OPAM_ROOT)/compilers
192 $(OPAM) switch 3.11.2
193
5cf8b97 Thomas Gazagnaire Improve test Makefile
samoht authored
194 packages/%.tar.gz: packages/% packages/%/*
7f510c5 Thomas Gazagnaire Few makefile tweaks
samoht authored
195 cd packages && tar cz $* > $*.tar.gz
196
197 clean:
198 rm -f $(ARCHIVES)
199
200 fresh:
abc2630 Thomas Gazagnaire Clean-up the functional tests
samoht authored
201 rm -rf $(OPAM_ROOT) $(OPAM_REPO) $(BIN)
Something went wrong with that request. Please try again.