Makefile: Add unit-tests help and targets list
Add unit-tests targets to help output. Add list-unit-tests target that lists all available unit-tests. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: I464a76cbea1f4afbc3fc772960787952e61b95b9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52293 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
dadcae63c6
commit
a4819b3c31
9
Makefile
9
Makefile
|
@ -114,16 +114,22 @@ NOCOMPILE:=1
|
||||||
endif
|
endif
|
||||||
ifneq ($(filter %clean lint% help% what-jenkins-does,$(MAKECMDGOALS)),)
|
ifneq ($(filter %clean lint% help% what-jenkins-does,$(MAKECMDGOALS)),)
|
||||||
NOMKDIR:=1
|
NOMKDIR:=1
|
||||||
|
UNIT_TEST:=1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter %-test %-tests,$(MAKECMDGOALS)),)
|
ifneq ($(filter help%, $(MAKECMDGOALS)), )
|
||||||
|
NOCOMPILE:=1
|
||||||
|
UNIT_TEST:=1
|
||||||
|
else
|
||||||
|
ifneq ($(filter %-test %-tests, $(MAKECMDGOALS)),)
|
||||||
ifneq ($(filter-out %-test %-tests, $(MAKECMDGOALS)),)
|
ifneq ($(filter-out %-test %-tests, $(MAKECMDGOALS)),)
|
||||||
$(error Cannot mix unit-tests targets with other targets)
|
$(error Cannot mix unit-tests targets with other targets)
|
||||||
endif
|
endif
|
||||||
UNIT_TEST:=1
|
UNIT_TEST:=1
|
||||||
NOCOMPILE:=
|
NOCOMPILE:=
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
$(xcompile): util/xcompile/xcompile
|
$(xcompile): util/xcompile/xcompile
|
||||||
rm -f $@
|
rm -f $@
|
||||||
|
@ -141,6 +147,7 @@ include $(TOPLEVEL)/Makefile.inc
|
||||||
include $(TOPLEVEL)/payloads/Makefile.inc
|
include $(TOPLEVEL)/payloads/Makefile.inc
|
||||||
include $(TOPLEVEL)/util/testing/Makefile.inc
|
include $(TOPLEVEL)/util/testing/Makefile.inc
|
||||||
-include $(TOPLEVEL)/site-local/Makefile.inc
|
-include $(TOPLEVEL)/site-local/Makefile.inc
|
||||||
|
include $(TOPLEVEL)/tests/Makefile.inc
|
||||||
real-all:
|
real-all:
|
||||||
@echo "Error: Expected config file ($(DOTCONFIG)) not present." >&2
|
@echo "Error: Expected config file ($(DOTCONFIG)) not present." >&2
|
||||||
@echo "Please specify a config file or run 'make menuconfig' to" >&2
|
@echo "Please specify a config file or run 'make menuconfig' to" >&2
|
||||||
|
|
|
@ -179,3 +179,18 @@ $(addprefix clean-,$(alltests)): clean-%:
|
||||||
|
|
||||||
clean-unit-tests:
|
clean-unit-tests:
|
||||||
rm -rf $(testobj)
|
rm -rf $(testobj)
|
||||||
|
|
||||||
|
list-unit-tests:
|
||||||
|
@echo "unit-tests:"
|
||||||
|
for t in $(sort $(alltests)); do \
|
||||||
|
echo " $$t"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
help-unit-tests help::
|
||||||
|
@echo '*** coreboot unit-tests targets ***'
|
||||||
|
@echo ' unit-tests - Run all unit-tests from tests/'
|
||||||
|
@echo ' clean-unit-tests - Remove unit-tests build artifacts'
|
||||||
|
@echo ' list-unit-tests - List all unit-tests'
|
||||||
|
@echo ' <unit-test> - Build and run single unit-test'
|
||||||
|
@echo ' clean-<unit-test> - Remove single unit-test build artifacts'
|
||||||
|
@echo
|
||||||
|
|
Loading…
Reference in New Issue