Permalink
Browse files

Few makefile tweaks

  • Loading branch information...
1 parent 86f0dde commit 7f510c50a650914aca24018e5788bb789a6d0e2b @samoht samoht committed Mar 7, 2012
Showing with 54 additions and 31 deletions.
  1. +5 −1 Makefile
  2. +18 −0 README.md
  3. +31 −0 tests/Makefile
  4. +0 −30 tests/packages/Makefile
View
6 Makefile
@@ -65,4 +65,8 @@ ocaml-re:
distclean:
rm -f *.tar.gz
rm -rf dose cudf extlib ocaml-pcre ocamlgraph
- rm -rf _obuild
+ rm -rf _obuild
+
+.PHONY: tests
+tests:
+ make -C tests
View
18 README.md
@@ -13,3 +13,21 @@ To compile `ocp-get`, simply run:
make
```
+## Tests
+
+In order to run the test you should run:
+
+```
+ocp-get-server --debug
+```
+
+This will run the server in debug mode. It will show the IP address it
+is listening to. You can open an other terminal and run:
+
+```
+make tests
+```
+
+WARNING: the tests will remove everything in `~/.opam` and
+'~/.opam-server`.
+
View
31 tests/Makefile
@@ -0,0 +1,31 @@
+# Make sure to have ocp-get-server running before launchin the tests
+OCPGET = ../ocp-get --debug
+LOCALHOST ?= 127.0.0.1
+PACKAGES = P1-1 P2-1 P3-1-weird.version P4-1
+
+ARCHIVES = $(PACKAGES:%=packages/%.tar.gz)
+.PHONY: all upload
+
+all: init upload info
+ @
+
+init: fresh
+ $(OCPGET) init $(LOCALHOST)
+
+upload: $(ARCHIVES) init
+ cd packages && ../$(OCPGET) upload P1.opam
+ cd packages && ../$(OCPGET) upload P2.opam
+ cd packages && ../$(OCPGET) upload P3.opam
+ cd packages && ../$(OCPGET) upload P4.opam
+
+info: upload
+ $(OCPGET) info
+
+packages/%.tar.gz: packages/%
+ cd packages && tar cz $* > $*.tar.gz
+
+clean:
+ rm -f $(ARCHIVES)
+
+fresh:
+ rm -rf ~/.opam ~/.opam-server
View
30 tests/packages/Makefile
@@ -1,30 +0,0 @@
-# Make sure to have ocp-get-server running before launchin the tests
-OCPGET = ../../ocp-get --debug
-LOCALHOST ?= 127.0.0.1
-ARCHIVES = P1-1.tar.gz P2-1.tar.gz P3-1-weird.version.tar.gz P4-1.tar.gz
-
-.PHONY: all upload
-
-all: init upload info
- @
-
-init: fresh
- $(OCPGET) init $(LOCALHOST)
-
-upload: $(ARCHIVES) init
- $(OCPGET) upload P1.opam
- $(OCPGET) upload P2.opam
- $(OCPGET) upload P3.opam
- $(OCPGET) upload P4.opam
-
-info: upload
- $(OCPGET) info
-
-%.tar.gz: %
- tar cz $^ > $@
-
-clean:
- rm -f $(ARCHIVES)
-
-fresh:
- rm -rf ~/.opam ~/.opam-server

0 comments on commit 7f510c5

Please sign in to comment.