Skip to content

Instantly share code, notes, and snippets.

@mitchellh
Created January 21, 2019 23:41
Show Gist options
  • Save mitchellh/978171ebc23243aed0fd4d2828a071d6 to your computer and use it in GitHub Desktop.
Save mitchellh/978171ebc23243aed0fd4d2828a071d6 to your computer and use it in GitHub Desktop.
Makefile target to test all modules in a repo.
.PHONY: test
test:
@find ${CURRENT_DIR} -type f -name go.mod | xargs -n1 dirname | while read line ; do \
echo $${line} ; \
pushd $${line} >/dev/null ; \
go test ./... ; \
popd >/dev/null ; \
echo ; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment