Refactor tests, integrate debug break points

This commit is contained in:
Alexander Neumann
2015-01-14 17:32:37 +01:00
parent 7f9e81431f
commit 7af11eaaae
4 changed files with 53 additions and 28 deletions

View File

@@ -1,16 +1,33 @@
.PHONY: clean all test
.PHONY: clean all test release debug
FLAGS=
#FLAGS+=-race
GOFLAGS=
#GOFLAGS+=-race
test:
all: release test
release:
for dir in cmd/* ; do \
(cd "$$dir"; go build $(FLAGS)) \
test -f "$$dir/Makefile" && \
(GOFLAGS="$(GOFLAGS)" make -C "$$dir") \
done
test/run.sh cmd/restic/restic cmd/dirdiff/dirdiff
debug:
for dir in cmd/* ; do \
test -f "$$dir/Makefile" && \
(GOFLAGS="$(GOFLAGS)" make -C "$$dir" debug) \
done
test: release debug
go test -v ./...
test/run.sh cmd/restic:cmd/dirdiff
test-%: test/test-%.sh
echo $*
test/run.sh cmd/restic:cmd/dirdiff "test/$@.sh"
clean:
go clean
for dir in cmd/* ; do \
(cd "$$dir"; go clean) \
test -f "$$dir/Makefile" && \
(make -C "$$dir" clean) \
done