SHELL_SCRIPTS := $(sort $(wildcard shell_scripts/test_*.sh))
SHELL_TESTS    := $(filter-out shell_scripts/test_lib.sh,$(SHELL_SCRIPTS))

.PHONY: test count unit shell goreportcard

shell:
	@echo "Running shell integration tests..."
	@for script in $(SHELL_TESTS); do \
		echo ""; \
		echo "=== $$script ==="; \
		cd shell_scripts && bash $$(basename $$script) || exit 1; \
		cd ..; \
	done

unit:
	go test -cover ./...

goreportcard:
	goreportcard-cli

count:
	@echo "Go line count:"
	@find . -name "*.go" ! -name "*_test.go" | xargs wc -l | tail -1
	@echo "Test line count:"
	@find /home/david/go/src/skraak -name "*_test.go" | xargs wc -l | tail -1


test: shell unit goreportcard count