forked from Imagelibrary/rtems
testsuites: Build the tests in parallel if make is asked too.
This commit is contained in:
@@ -4,43 +4,50 @@
|
|||||||
## It is a hack within many hacks and is designed to keep the source as clean
|
## It is a hack within many hacks and is designed to keep the source as clean
|
||||||
## as possible.
|
## as possible.
|
||||||
|
|
||||||
all-local:
|
define TESTDIR
|
||||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
.PHONY: $1
|
||||||
dot_seen=no; \
|
$1:
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
@+set fnord $(MAKEFLAGS); \
|
||||||
if test "$$target" = "all-local-am"; then \
|
subdir=$(1); \
|
||||||
|
target=`echo $(MAKECMDGOALS) | sed s/-recursive//`; \
|
||||||
|
if test "$$$$target" = "all-local-am"; then \
|
||||||
target="all-am"; \
|
target="all-am"; \
|
||||||
fi; \
|
fi; \
|
||||||
if test "$$target" = "all-local"; then \
|
if test "$$$$target" = "all-local"; then \
|
||||||
target="all"; \
|
target="all"; \
|
||||||
fi; \
|
fi; \
|
||||||
tcheck="$(top_srcdir)/../../tools/build/rtems-test-check-py"; \
|
tcheck="$(top_srcdir)/../../tools/build/rtems-test-check-py"; \
|
||||||
tdata="$(RTEMS_BSP)-testsuite.tcfg"; \
|
tdata="$(RTEMS_BSP)-testsuite.tcfg"; \
|
||||||
tincludes="$(top_srcdir)/../../c/src/lib/libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom:$(top_srcdir)/.."; \
|
tincludes="$(top_srcdir)/../../c/src/lib/libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom:$(top_srcdir)/.."; \
|
||||||
if test -f "$$tdata"; then \
|
if test -f "$$$$tdata"; then \
|
||||||
vtdata="$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom/$(RTEMS_BSP)-testsuite.tcfg"; \
|
vtdata="$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom/$(RTEMS_BSP)-testsuite.tcfg"; \
|
||||||
else \
|
else \
|
||||||
vtdata="all tests"; \
|
vtdata="all tests"; \
|
||||||
fi; \
|
fi; \
|
||||||
echo "BSP Testsuite Data: $$vtdata"; \
|
echo "BSP Testsuite Data: $$$$vtdata"; \
|
||||||
if test -f $$tcheck; then \
|
if test -f $$$$tcheck; then \
|
||||||
list=`$$tcheck exclude $(RTEMS_BSP) $$tdata $$tincludes $(_SUBDIRS)`; \
|
list=`$$$$tcheck exclude $(RTEMS_BSP) $$tdata $$$$tincludes $(_SUBDIRS)`; \
|
||||||
else \
|
else \
|
||||||
list=$(_SUBDIRS); \
|
list=$(_SUBDIRS); \
|
||||||
fi; \
|
fi; \
|
||||||
for subdir in $$list; do \
|
if test "$$$${list#*$$$$subdir}" != "$$$${list}"; then \
|
||||||
echo "Making $$target in $$subdir"; \
|
echo "Making $$$$target in $$$$subdir"; \
|
||||||
if test "$$subdir" != "."; then \
|
if test "$$$$subdir" != "."; then \
|
||||||
if test -f $$tcheck; then \
|
if test -f $$$$tcheck; then \
|
||||||
test_FLAGS=`$$tcheck flags $(RTEMS_BSP) $$tdata $$tincludes $$subdir`; \
|
test_FLAGS=`$$$$tcheck flags $(RTEMS_BSP) $$$$tdata $$$$tincludes $$$$subdir`; \
|
||||||
fi; \
|
fi; \
|
||||||
local_target="$$target"; \
|
local_target="$$$$target"; \
|
||||||
if test -z "$$test_FLAGS"; then \
|
if test -z "$$$$test_FLAGS"; then \
|
||||||
echo "BSP Testsuite Flags: $$subdir: PASS"; \
|
echo "BSP Testsuite Flags: $$$$subdir: PASS"; \
|
||||||
else \
|
else \
|
||||||
echo "BSP Testsuite Flags: $$subdir: $$test_FLAGS"; \
|
echo "BSP Testsuite Flags: $$$$subdir: $$$$test_FLAGS"; \
|
||||||
fi; \
|
fi; \
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) TEST_FLAGS="$$test_FLAGS" $$local_target) \
|
cd $$$$subdir; \
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
$(MAKE) $(AM_MAKEFLAGS) TEST_FLAGS="$$$$test_FLAGS" $$$$local_target; \
|
||||||
fi; \
|
fi; \
|
||||||
done; test -z "$$fail"
|
fi;
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach T,$(_SUBDIRS),$(eval $(call TESTDIR,$(strip $(T)))))
|
||||||
|
|
||||||
|
all-local: $(_SUBDIRS)
|
||||||
|
|||||||
Reference in New Issue
Block a user