aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2017-07-19 18:17:29 -0700
committerGitHub <noreply@github.com>2017-07-19 18:17:29 -0700
commitd32430055414762d8c62db5595b461b3087ea760 (patch)
treed37a0569947deca92591bd996cd8df738101a3df /Makefile
parent8f4830c7715e5719780f195ce3400b8768c30688 (diff)
parent16ec9949f831efd21c78d5f0cb589c40cbbeea33 (diff)
Merge pull request #27 from google/tests
coveralls: Adding Travis CI integration
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 15 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index e2f0bd9..4ebbe32 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,7 @@ override GO_FLAGS += --ldflags '$(GO_LINK_FLAGS)'
.PHONY: default all
default: $(NAME)
-all: gen update format lint default test
+all: update format lint default test
$(NAME): $(SRC_FILES)
go build $(GO_FLAGS) -o $(NAME) $(CMD_PKG)
@@ -110,11 +110,18 @@ update:
@govendor remove +unused
# Format all the Go and C code
-.PHONY: format
+.PHONY: format format-check
format:
@gofmt -l -s -w $(GO_FILES)
@clang-format -i -style=Google $(C_FILES)
+format-check:
+ @gofmt -s -d $(GO_FILES) \
+ | ./input_fail.py "Incorrectly formatted Go files. Run \"make format\"."
+ @clang-format -i -style=Google -output-replacements-xml $(C_FILES) \
+ | grep "<replacement " \
+ | ./input_fail.py "Incorrectly formatted C files. Run \"make format\"."
+
# Run lint rules (skipping generated files)
.PHONY: lint
lint:
@@ -155,14 +162,12 @@ test-teardown:
sudo rmdir $(MOUNT)
rm -f $(IMAGE)
-##### Commands for Travis CI #####
+##### Travis CI Commands
+.PHONY: travis-setup travis-script
+travis-install: go-tools test-setup
+ go get -u github.com/mattn/goveralls
-.PHONY: check
-check: lint default test
+travis-script: lint format-check default
+ goveralls -service=travis-ci
@govendor list +missing +external +unused \
| ./input_fail.py "Incorrect vendored dependencies. Run \"make update\"."
- @gofmt -s -d $(GO_FILES) \
- | ./input_fail.py "Incorrectly formatted Go files. Run \"make format\"."
- @clang-format -i -style=Google -output-replacements-xml $(C_FILES) \
- | grep "<replacement " \
- | ./input_fail.py "Incorrectly formatted C files. Run \"make format\"."