GO_BUILD_FLAGS ?= -trimpath GO_BUILD_LDFLAGS ?= -s -w all: test fq .PHONY: fq fq: CGO_ENABLED=0 go build -o fq -ldflags "${GO_BUILD_LDFLAGS}" ${GO_BUILD_FLAGS} . .PHONY: test test: testgo testjq testcli .PHONY: test-race test-race: testgo-race testjq testcli .PHONY: testgo # figure out all go pakges with test files testgo: PKGS=$(shell find . -name "*_test.go" | xargs -n 1 dirname | sort | uniq) testgo: go test -timeout 20m ${RACE} ${VERBOSE} ${COVER} ${PKGS} .PHONY: testgo-race testgo-race: RACE=-race testgo-race: testgo .PHONY: testjq testjq: fq @pkg/interp/testjq.sh ./fq pkg/interp/*_test.jq .PHONY: testcli testcli: fq @pkg/cli/test_exp.sh ./fq pkg/cli/test_repl.exp @pkg/cli/test_exp.sh ./fq pkg/cli/test_cli_ctrlc.exp @pkg/cli/test_exp.sh ./fq pkg/cli/test_cli_ctrld.exp .PHONY: cover cover: COVER=-cover -coverpkg=./... -coverprofile=cover.out cover: test go tool cover -html=cover.out -o cover.out.html cat cover.out.html | grep '