GO_BUILD_FLAGS ?= -trimpath GO_BUILD_LDFLAGS ?= -s -w GO_TEST_RACE_FLAGS ?=-race 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: 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 ${GO_TEST_RACE_FLAGS} ${VERBOSE} ${COVER} ${PKGS} .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 '