diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile
index 728c3b5d8c07805c768eb3064bb81e5d7416eadf..b3c97fc25d4e8cf87560f9bc9f124ecfb2a4cc72 100644
--- a/tests/unittests/Makefile
+++ b/tests/unittests/Makefile
@@ -19,7 +19,7 @@ else ifeq ($(OUTPUT),COMPILER)
 endif
 
 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
     UNIT_TESTS := $(filter tests-%, $(MAKECMDGOALS))
 endif