test/Makefile: use `gx deps find` for gx dependencies
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Apr 30, 2016 at 08:48 UTC
5b17654211a44f1ac176155e6b09f5ff659a31a4
1 file changed
+26
-10
test/Makefile
+26
-10
@@ -4,11 +4,11 @@ IPFS_ROOT = ../
4
IPFS_CMD = ../cmd/ipfs
5
RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
6
RANDOM_FILES_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random-files
7
-MULTIHASH_SRC = ../../../../gx/ipfs/QmYf7ng2hG5XBtJA3tN34DQ2GUN5HNksEw1rLDkmr6vGku/go-multihash
8
-IPTB_SRC = ../../../../gx/ipfs/QmccSTNEUYSJsDSHZj3uKS3pPYCRXCNxr4X8Ub1TQyKPsZ/iptb
7
POLLENDPOINT_SRC= ../thirdparty/pollEndpoint
8
GOSLEEP_SRC = ./dependencies/go-sleep
9
10
+GX_RELATIVE_PATH = ../../../../gx/ipfs
11
+
12
# User might want to override those on the command line
13
GOFLAGS =
14
@@ -26,6 +26,8 @@ bins: $(BINS)
26
27
find_go_files = $(shell find $(1) -name "*.go")
28
29
+# Non gx dependencies
30
+
31
bin/random: $(call find_go_files, $(RANDOM_SRC)) IPFS-BUILD-OPTIONS
32
@echo "*** installing $@ ***"
33
go build $(GOFLAGS) -o bin/random $(RANDOM_SRC)/random
@@ -34,10 +36,6 @@ bin/random-files:
36
@echo "*** installing $@ ***"
37
go build $(GOFLAGS) -o bin/random-files $(RANDOM_FILES_SRC)/random-files
38
37
-bin/multihash: $(call find_go_files, $(MULTIHASH_SRC)) IPFS-BUILD-OPTIONS
38
- @echo "*** installing $@ ***"
39
- go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
40
-
39
bin/ipfs: $(call find_go_files, $(IPFS_ROOT)) IPFS-BUILD-OPTIONS
40
@echo "*** installing $@ ***"
41
go build $(GOFLAGS) -o bin/ipfs $(IPFS_CMD)
@@ -46,14 +44,30 @@ bin/pollEndpoint: $(call find_go_files, $(POLLENDPOINT_SRC)) IPFS-BUILD-OPTIONS
44
@echo "*** installing $@ ***"
45
go build $(GOFLAGS) -o bin/pollEndpoint $(POLLENDPOINT_SRC)
46
49
-bin/iptb: $(call find_go_files, $(IPTB_SRC)) IPFS-BUILD-OPTIONS
50
- @echo "*** installing $@ ***"
51
- go build $(GOFLAGS) -o bin/iptb $(IPTB_SRC)
52
-
47
bin/go-sleep: $(call find_go_files, $(GOSLEEP_SRC)) IPFS-BUILD-OPTIONS
48
@echo "*** installing $@ ***"
49
go build $(GOFLAGS) -o bin/go-sleep $(GOSLEEP_SRC)
50
51
+# gx dependencies
52
+
53
+multihash_src:
54
+ $(eval MULTIHASH_HASH := $(shell cd .. && gx deps find go-multihash))
55
+ $(eval MULTIHASH_SRC := $(GX_RELATIVE_PATH)/$(MULTIHASH_HASH)/go-multihash)
56
+
57
+bin/multihash: multihash_src $(call find_go_files, $(MULTIHASH_SRC)) IPFS-BUILD-OPTIONS
58
+ @echo "*** installing $@ ***"
59
+ go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
60
+
61
+iptb_src:
62
+ $(eval IPTB_HASH := $(shell cd .. && gx deps find iptb))
63
+ $(eval IPTB_SRC := $(GX_RELATIVE_PATH)/$(IPTB_HASH)/iptb)
64
+
65
+bin/iptb: iptb_src $(call find_go_files, $(IPTB_SRC)) IPFS-BUILD-OPTIONS
66
+ @echo "*** installing $@ ***"
67
+ go build $(GOFLAGS) -o bin/iptb $(IPTB_SRC)
68
+
69
+# Tests
70
+
71
test: test_expensive
72
73
test_expensive: verify_gofmt
@@ -70,6 +84,8 @@ test_race: verify_gofmt
84
cd 3nodetest && make GOFLAGS=-race
85
cd dependencies && make GOFLAGS=-race
86
87
+# Misc
88
+
89
coverage: coverage_sharness
90
91
coverage_sharness: