awesome-compose/Makefile
Chad Metcalf e059c77a47
Allow testing for just examples with changed files.
The full test suite takes a long time to test. Generally changes in this
repo only will change one project. So lets find the directories with
changes and only test those. By default we will compare against
origin/master which should cover testing PRs. If you're doing
development and want to test your current changes you could do:

BASE_REF=HEAD make test-changed

Or if you're testing against your fork:

BASE_REF=myremote/branch make test-changed

Signed-off-by: Chad Metcalf <chad@docker.com>
2020-08-09 15:09:04 -07:00

15 lines
467 B
Makefile

.phony: test-all test-changed update-tests
BASE_REF ?= origin/master
all: test-changed
test-all:
@bats -T $(shell find . -name test.bats| sort )
test-changed:
@bats -T $(shell git diff --name-status ${BASE_REF} | awk '{print $2}' | xargs dirname | uniq | grep -v -E '^(\.|lib)' | xargs -I% echo -n " %/test.bats" )
update-tests:
@find . -maxdepth 1 -type d -not -path '*/\.*' -not -path '.' -not -path './lib' -exec cp ./lib/test.bats.example {}/test.bats \;