Skip to content

Instantly share code, notes, and snippets.

@foreversmart
Created July 25, 2017 09:58
Show Gist options
  • Save foreversmart/41a0dfbcbd93b5ccc5b8df19c0825075 to your computer and use it in GitHub Desktop.
Save foreversmart/41a0dfbcbd93b5ccc5b8df19c0825075 to your computer and use it in GitHub Desktop.
define deep_test
$(eval current = $(subst ...,,$(1)))
$(eval files = $(wildcard src/$(current)*/))
$(eval testFiles = $(filter %_test.go, $(files)))
$(if $(testFiles),go test $(current))
$(eval packages = $(filter %/, $(files)))
$(if $(packages),$(foreach package,$(packages),$(call deep_test,$(subst src/,,$(package))...)))
endef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment