github.com/whyrusleeping/gx@v0.14.3/tests/Makefile (about)

     1  # Run tests
     2  #
     3  # Copyright (c) 2014 Christian Couder
     4  # MIT Licensed; see the LICENSE file in this repository.
     5  #
     6  
     7  # NOTE: run with TEST_VERBOSE=1 for verbose sharness tests.
     8  
     9  T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
    10  BINS = bin/gx bin/ipfs bin/go-sleep bin/pollEndpoint bin/jq bin/gx-test
    11  SHARNESS = lib/sharness/sharness.sh
    12  IPFS_VERSION = v0.4.8
    13  
    14  find_go_files = $(shell find $(1) -name "*.go")
    15  
    16  # User might want to override those on the command line
    17  GOFLAGS =
    18  
    19  all: aggregate
    20  
    21  clean: clean-test-results
    22  	@echo "*** $@ ***"
    23  	-rm -rf $(BINS)
    24  
    25  clean-test-results:
    26  	@echo "*** $@ ***"
    27  	-rm -rf test-results
    28  
    29  $(T): clean-test-results deps
    30  	@echo "*** $@ ***"
    31  	./$@
    32  
    33  aggregate: clean-test-results $(T)
    34  	@echo "*** $@ ***"
    35  	lib/test-aggregate-results.sh
    36  
    37  deps: $(SHARNESS) $(BINS)
    38  
    39  $(SHARNESS): FORCE
    40  	@echo "*** checking $@ ***"
    41  	lib/install-sharness.sh
    42  
    43  bin/gx: $(call find_go_files, ../)
    44  	go build -o bin/gx github.com/whyrusleeping/gx
    45  
    46  bin/ipfs:
    47  	mkdir -p bin
    48  	go get github.com/ipfs/ipfs-update
    49  	ipfs-update fetch $(IPFS_VERSION) --output=bin/ipfs
    50  
    51  bin/go-sleep:
    52  	go get -d github.com/chriscool/go-sleep
    53  	go build -o bin/go-sleep github.com/chriscool/go-sleep
    54  
    55  bin/pollEndpoint:
    56  	go get -d github.com/whyrusleeping/pollEndpoint
    57  	go build -o bin/pollEndpoint github.com/whyrusleeping/pollEndpoint
    58  
    59  bin/jq:
    60  	./scripts/install-jq.sh $(shell pwd)/bin
    61  
    62  bin/gx-test:
    63  	cp scripts/gx-test bin/
    64  
    65  race:
    66  	make GOFLAGS=-race all
    67  
    68  .PHONY: all clean $(T) aggregate FORCE