File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- bin
1+ bin
2+ coverage.txt
3+ profile.out
4+ coverage.out
Original file line number Diff line number Diff line change @@ -13,5 +13,4 @@ matrix:
1313 fast_finish : true
1414
1515script :
16- - go test
17- - go test --race
16+ - make test-coverage
Original file line number Diff line number Diff line change 1+ # general
2+ WORKDIR = $(PWD )
3+
14# build CLI
25LOCAL_TAG := $(shell git describe --tags --abbrev=0)
36LOCAL_BUILD := $(shell date +"% m-% d-% Y_% H_% M_% S")
47LOCAL_LDFLAGS = -s -X main.version=$(LOCAL_TAG ) -X main.build=$(LOCAL_BUILD )
58
9+ # coverage
10+ COVERAGE_REPORT = coverage.txt
11+ COVERAGE_PROFILE = profile.out
12+ COVERAGE_MODE = atomic
13+
614build-cli :
7- go build -o bin/graphiql -ldflags " $( LOCAL_LDFLAGS) " cmd/graphiql/main.go
15+ go build -o bin/graphiql -ldflags " $( LOCAL_LDFLAGS) " cmd/graphiql/main.go
16+
17+ test :
18+ go test -v ./...
19+
20+ test-coverage :
21+ @cd $(WORKDIR ) ; \
22+ echo " " > $(COVERAGE_REPORT ) ; \
23+ for dir in ` find . -name " *.go" | grep -o ' .*/' | sort | uniq` ; do \
24+ go test -v -race $$ dir -coverprofile=$(COVERAGE_PROFILE ) -covermode=$(COVERAGE_MODE ) ; \
25+ if [ $$ ? != 0 ]; then \
26+ exit 2; \
27+ fi ; \
28+ if [ -f $( COVERAGE_PROFILE) ]; then \
29+ cat $(COVERAGE_PROFILE ) >> $(COVERAGE_REPORT ) ; \
30+ rm $(COVERAGE_PROFILE ) ; \
31+ fi ; \
32+ done ; \
Original file line number Diff line number Diff line change 11# Golang GraphiQL
22[ ![ GitHub version] ( https://badge.fury.io/gh/friendsofgo%2Fgraphiql.svg )] ( https://badge.fury.io/gh/friendsofgo%2Fgraphiql )
33[ ![ Build Status] ( https://travis-ci.org/friendsofgo/graphiql.svg?branch=master )] ( https://travis-ci.org/friendsofgo/graphiql )
4+ [ ![ codecov] ( https://codecov.io/gh/aperezg/graphiql/branch/master/graph/badge.svg )] ( https://codecov.io/gh/aperezg/graphiql )
45[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/friendsofgo/graphiql )] ( https://goreportcard.com/report/github.com/friendsofgo/graphiql )
56[ ![ CDNJS] ( https://img.shields.io/cdnjs/v/graphiql.svg )] ( https://cdnjs.com/libraries/graphiql )
67[ ![ GoDoc] ( https://godoc.org/graphql.co/graphql?status.svg )] ( https://godoc.org/github.com/friendsofgo/graphiql )
You can’t perform that action at this time.
0 commit comments