1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 11:52:21 +08:00

moved sharness tests to a subdir.

kept bin in place
This commit is contained in:
Juan Batiz-Benet
2015-01-07 07:06:59 -08:00
parent 8307572777
commit cecfa45745
17 changed files with 58 additions and 40 deletions

View File

@ -35,10 +35,10 @@ test_go_expensive:
go test ./...
test_sharness_short:
cd test/ && make
cd test/sharness/ && make
test_sharness_expensive:
cd test/ && TEST_EXPENSIVE=1 make
cd test/sharness/ && TEST_EXPENSIVE=1 make
test_all_commits:
@echo "testing all commits between origin/master..HEAD"

3
test/.gitignore vendored
View File

@ -1,5 +1,2 @@
lib/sharness/
bin/ipfs
bin/random
test-results/
trash directory.*.sh/

View File

@ -1,45 +1,25 @@
# Run tests
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
# NOTE: run with TEST_VERBOSE=1 for verbose sharness tests.
BINS = bin/random bin/ipfs
IPFS_ROOT = ../
IPFS_CMD = ../cmd/ipfs
RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
SHARNESS = lib/sharness/sharness.sh
RANDOMSRC = Godeps/_workspace/src/github.com/jbenet/go-random/random
all: deps
all: clean deps $(T) aggregate
deps: bins
clean:
@echo "*** $@ ***"
-rm -rf test-results
rm $(BINS)
$(T):
@echo "*** $@ ***"
./$@
bins: $(BINS)
aggregate:
@echo "*** $@ ***"
lib/test-aggregate-results.sh
bin/random: $(RANDOM_SRC)/**/*.go
go build -o bin/random $(RANDOM_SRC)/random
deps: $(SHARNESS) ipfs random
bin/ipfs: $(IPFS_ROOT)/**/*.go
go build -o bin/ipfs $(IPFS_CMD)
$(SHARNESS):
@echo "*** installing $@ ***"
lib/install-sharness.sh
test_sharness:
cd sharness && make
# phony to ensure we re-build it every time we run tests
ipfs:
@echo "*** installing $@ ***"
mkdir -p bin
cd ../cmd/ipfs && go build
cp ../cmd/ipfs/ipfs bin/ipfs
random:
@echo "*** installing $@ ***"
mkdir -p bin
go build -o bin/random ../$(RANDOMSRC)
.PHONY: all clean $(T) aggregate ipfs random
.PHONY: all clean

3
test/sharness/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
lib/sharness/
test-results/
trash directory.*.sh/

37
test/sharness/Makefile Normal file
View File

@ -0,0 +1,37 @@
# Run tests
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
# NOTE: run with TEST_VERBOSE=1 for verbose sharness tests.
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
BINS = bin/random bin/ipfs
SHARNESS = lib/sharness/sharness.sh
all: clean deps $(T) aggregate
clean:
@echo "*** $@ ***"
-rm -rf test-results
$(T):
@echo "*** $@ ***"
./$@
aggregate:
@echo "*** $@ ***"
lib/test-aggregate-results.sh
deps: $(SHARNESS) $(BINS)
$(SHARNESS):
@echo "*** installing $@ ***"
lib/install-sharness.sh
bin/%:
@echo "*** installing $@ ***"
cd .. && make $@
.PHONY: all clean $(T) aggregate

1
test/sharness/bin Symbolic link
View File

@ -0,0 +1 @@
../bin