本站源代码
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

26 行
583B

  1. # General
  2. WORKDIR = $(PWD)
  3. # Go parameters
  4. GOCMD = go
  5. GOTEST = $(GOCMD) test -v
  6. # Coverage
  7. COVERAGE_REPORT = coverage.txt
  8. COVERAGE_PROFILE = profile.out
  9. COVERAGE_MODE = atomic
  10. test-coverage:
  11. cd $(WORKDIR); \
  12. echo "" > $(COVERAGE_REPORT); \
  13. for dir in `find . -name "*.go" | grep -o '.*/' | sort | uniq`; do \
  14. $(GOTEST) $$dir -coverprofile=$(COVERAGE_PROFILE) -covermode=$(COVERAGE_MODE); \
  15. if [ $$? != 0 ]; then \
  16. exit 2; \
  17. fi; \
  18. if [ -f $(COVERAGE_PROFILE) ]; then \
  19. cat $(COVERAGE_PROFILE) >> $(COVERAGE_REPORT); \
  20. rm $(COVERAGE_PROFILE); \
  21. fi; \
  22. done; \
上海开阖软件有限公司 沪ICP备12045867号-1