Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 88 lines (70 sloc) 2.427 kb
4e3553f Modified for the demo
Fabrice Le Fessant authored
1 # never use /tmp
2 # should be absolute
3 TEST_DIR=/tmp
abc2630 @samoht Clean-up the functional tests
samoht authored
4 OPAM_ROOT = $(TEST_DIR)/OPAM.CLIENT
5 OPAM_REPO = $(TEST_DIR)/OPAM.REPO
6 BIN = $(TEST_DIR)/OPAM.BIN
7 REPO = test
4e3553f Modified for the demo
Fabrice Le Fessant authored
8
abc2630 @samoht Clean-up the functional tests
samoht authored
9 BINARIES = opam opam-rsync-init opam-rsync-update opam-rsync-download opam-rsync-upload
10 PACKAGES = P1-1 P1-2 P2 P3 P4
f8dc221 @samoht Add --root to ocp-get and ocp-get-server to change the default root p…
samoht authored
11
abc2630 @samoht Clean-up the functional tests
samoht authored
12 # opam in the path should not be a requirement
13 ENV = OCAMLRUNPARAM=b OPAMDEBUG=1 OPAM_ROOT=$(OPAM_ROOT) PATH=$(BIN):$(PATH)
14 OPAM = $(ENV) opam --root $(OPAM_ROOT)
7f510c5 @samoht Few makefile tweaks
samoht authored
15
abc2630 @samoht Clean-up the functional tests
samoht authored
16 BINARIES_ = $(BINARIES:%=$(BIN)/%)
17 BUILDS = $(foreach bin, $(BINARIES), ../_obuild/$(bin)/$(bin).asm)
18 ARCHIVES = $(PACKAGES:%=packages/%.tar.gz)
5cf8b97 @samoht Improve test Makefile
samoht authored
19
7f510c5 @samoht Few makefile tweaks
samoht authored
20 .PHONY: all upload
21
d09171c @samoht 'opam info P' now lists available libraries and syntax extensions in P
samoht authored
22 all: fresh init upload list install upload-new upgrade downgrade remove
7f510c5 @samoht Few makefile tweaks
samoht authored
23 @
24
abc2630 @samoht Clean-up the functional tests
samoht authored
25 $(BINARIES_): $(BUILDS)
4e3553f Modified for the demo
Fabrice Le Fessant authored
26 mkdir -p $(BIN)
abc2630 @samoht Clean-up the functional tests
samoht authored
27 for bin in $(BINARIES); do \
28 cp ../_obuild/$$bin/$$bin.asm $(BIN)/$$bin ; \
29 done
1bcaf57 @samoht New format for user provided files
samoht authored
30
abc2630 @samoht Clean-up the functional tests
samoht authored
31 init: fresh $(BIN)/opam $(SCRIPTS:%=$(BIN)/%)
32 mkdir $(OPAM_REPO)
33 mkdir $(OPAM_REPO)/opam
34 mkdir $(OPAM_REPO)/descr
35 mkdir $(OPAM_REPO)/archive
36 $(OPAM) init $(REPO) $(OPAM_REPO)
7f510c5 @samoht Few makefile tweaks
samoht authored
37
38 upload: $(ARCHIVES) init
abc2630 @samoht Clean-up the functional tests
samoht authored
39 cd packages && \
40 $(OPAM) upload -opam P1-1.opam -descr P1-1/README -archive P1-1.tar.gz -repo $(REPO)
41 cd packages && \
42 $(OPAM) upload -opam P2.opam -descr P2/README -archive P2.tar.gz -repo $(REPO)
43 cd packages && \
44 $(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
45 cd packages && \
46 $(OPAM) upload -opam P4-1.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
47 $(OPAM) update # update the list of available packages with the one being updated
7f510c5 @samoht Few makefile tweaks
samoht authored
48
0acb675 @samoht 'ocp-get list' returns the list of available packages
samoht authored
49 list: upload
abc2630 @samoht Clean-up the functional tests
samoht authored
50 $(OPAM) list
7f510c5 @samoht Few makefile tweaks
samoht authored
51
a802765 @samoht Add a simple remove tests
samoht authored
52 remove: upload
abc2630 @samoht Clean-up the functional tests
samoht authored
53 cd packages && $(OPAM) install P1
54 cd packages && $(OPAM) remove P1
a802765 @samoht Add a simple remove tests
samoht authored
55
56 install: remove upload
abc2630 @samoht Clean-up the functional tests
samoht authored
57 $(OPAM) install P1
58 $(OPAM) install P2
59 $(OPAM) install P3
60 $(OPAM) install P4
a779ca3 @samoht More tests
samoht authored
61
62 upload-new: install
abc2630 @samoht Clean-up the functional tests
samoht authored
63 cd packages && \
64 $(OPAM) upload -opam P1-2.opam -descr P1-2/README -archive P1-2.tar.gz -repo $(REPO)
65 cd packages && \
66 $(OPAM) upload -opam P4-2.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
67 cd packages && \
68 $(OPAM) upload -opam P4-3.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
f6f4b18 @tuong fix "opam list" (tests was wrong during the 'upgrade' rule)
tuong authored
69 $(OPAM) update # update the list of available packages with the one being updated
70
40ddc96 @samoht The upgrade test proposes the good solution, but it fails just after …
samoht authored
71 upgrade: upload-new
abc2630 @samoht Clean-up the functional tests
samoht authored
72 $(OPAM) list
73 $(OPAM) upgrade
74 $(OPAM) list
757fe55 @samoht Add more tests
samoht authored
75
bac61a0 @samoht Version contraints + downgrade works
samoht authored
76 downgrade: upgrade
abc2630 @samoht Clean-up the functional tests
samoht authored
77 $(OPAM) install P4.2
78 $(OPAM) list
7e293d3 @tuong Finish the bootstrap (for the case we only consider the library part …
tuong authored
79
5cf8b97 @samoht Improve test Makefile
samoht authored
80 packages/%.tar.gz: packages/% packages/%/*
7f510c5 @samoht Few makefile tweaks
samoht authored
81 cd packages && tar cz $* > $*.tar.gz
82
83 clean:
84 rm -f $(ARCHIVES)
85
86 fresh:
abc2630 @samoht Clean-up the functional tests
samoht authored
87 rm -rf $(OPAM_ROOT) $(OPAM_REPO) $(BIN)
Something went wrong with that request. Please try again.