diff options
| author | Peter Jones <pjones@redhat.com> | 2021-02-14 14:50:44 -0500 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2021-02-25 10:15:14 -0500 |
| commit | 9ca8e9a633501c3ec3c95d2576b795eee8d9b1cc (patch) | |
| tree | 00bb38ceba093b70cb1f54a85dac69c4e3de7532 /Makefile | |
| parent | 73322ba087d10d06b0656816bf4b7ba80b02c751 (diff) | |
| download | efi-boot-shim-9ca8e9a633501c3ec3c95d2576b795eee8d9b1cc.tar.gz efi-boot-shim-9ca8e9a633501c3ec3c95d2576b795eee8d9b1cc.zip | |
make 'make test' able to run unit test harnesses
This adds a couple of make targets to do unit tests that are linked to
libc:
test-FOO : builds and runs test-FOO for any test-FOO.c
test : builds and runs all test-FOO tests
Note that building and running this test does not quite work yet /on
this branch/. In order to do that, we need some cleanups and
reorganizing that I don't want to push just yet, which can be found on
https://github.com/rhboot/shim/tree/test-reorg
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -240,6 +240,17 @@ else $(PESIGN) -n certdb -i $< -c "shim" -s -o $@ -f endif +test : + @make -f include/test.mk EFI_INCLUDES="$(EFI_INCLUDES)" ARCH_DEFINES="$(ARCH_DEFINES)" all + +$(patsubst %.c,%,$(wildcard test-*.c)) : + @make -f include/test.mk EFI_INCLUDES="$(EFI_INCLUDES)" ARCH_DEFINES="$(ARCH_DEFINES)" $@ + +.PHONY : $(patsubst %.c,%,$(wildcard test-*.c)) test + +clean-test-objs: + @make -f include/test.mk EFI_INCLUDES="$(EFI_INCLUDES)" ARCH_DEFINES="$(ARCH_DEFINES)" clean + clean-shim-objs: $(MAKE) -C lib -f $(TOPDIR)/lib/Makefile clean @rm -rvf $(TARGET) *.o $(SHIM_OBJS) $(MOK_OBJS) $(FALLBACK_OBJS) $(KEYS) certdb $(BOOTCSVNAME) @@ -247,7 +258,7 @@ clean-shim-objs: @rm -vf Cryptlib/*.[oa] Cryptlib/*/*.[oa] @if [ -d .git ] ; then git clean -f -d -e 'Cryptlib/OpenSSL/*'; fi -clean: clean-shim-objs +clean: clean-shim-objs clean-test-objs $(MAKE) -C Cryptlib -f $(TOPDIR)/Cryptlib/Makefile clean $(MAKE) -C Cryptlib/OpenSSL -f $(TOPDIR)/Cryptlib/OpenSSL/Makefile clean |
