unittests: make: Fix unittests for branch changes

Changing between branches in git typically leaves directories empty and
does not remove them. If you have different unittests in different
branches this leads to an error in building them, since the current
configuration expects a Makefile in all `tests-*` directory. This change
configures Make to search for a Makefile in `tests-*` rather than just
assuming that there is one.
This commit is contained in:
Martine Lenders 2014-09-08 11:56:01 +02:00
parent 8503267ead
commit 4c6e17b39b

View File

@ -19,7 +19,7 @@ else ifeq ($(OUTPUT),COMPILER)
endif endif
ifeq (, $(filter tests-%, $(MAKECMDGOALS))) ifeq (, $(filter tests-%, $(MAKECMDGOALS)))
UNIT_TESTS := $(shell find -mindepth 1 -maxdepth 1 -type d -name 'tests-*' -printf '%f ') UNIT_TESTS := $(foreach d,$(wildcard tests-*/Makefile),$(shell dirname $(d)))
else else
UNIT_TESTS := $(filter tests-%, $(MAKECMDGOALS)) UNIT_TESTS := $(filter tests-%, $(MAKECMDGOALS))
endif endif