path: root/Makefile
diff options
authorMatt Fleming <matt.fleming@intel.com>2013-07-17 14:53:08 +0100
committerMatt Fleming <matt.fleming@intel.com>2013-07-23 14:58:41 +0100
commit82546447f46cab11f13380fe658b1f79cdd38654 (patch)
treef236c3eeddcab926f1dbba768c549f2cb61b9847 /Makefile
parent21f8596c58a9791e7ea1f4ba93be17eed60a05b6 (diff)
tests: Syslinux unit tests
Improve our faith in the validity of the Syslinux code by writing unit tests where possible. These should be used in addition to the regression tests - unit tests are a means of doing very fine-grained testing of code, whereas the regression tests are end-to-end tests that exercise abstract functionality. Unit tests run on your development machine and above all else, their execution time should be kept to a minimum to encourage repeated runs of the unit testsuite. The Syslinux header hierarchy has been reconstructed under tests/unittest/include. This allows us to reuse header files where appropriate by simply creating a file with the same name and including the original, e.g. tests/unittest/include/com32.h: #include <../../../com32/include/com32.h> Places where we need to override definitions (so that the tests build in a dev environment) obviously won't include the original header file, but such scenarios should be kept to a minimum, since you're not really testing any Syslinux code that way. To execute the collection of unit tests type, make unittest Sample output might look like, Executing unit tests Running library unit tests... [+] zonelist passed [+] movebits passed [+] memscan passed Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'Makefile')
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d90635af..e9c16545 100644
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ include $(MAKEDIR)/syslinux.mk
-include $(OBJDIR)/version.mk
private-targets = prerel unprerel official release burn isolinux.iso \
- preupload upload test
+ preupload upload test unittest regression
@@ -101,13 +101,17 @@ $(filter-out $(private-targets), $(MAKECMDGOALS)):
$(MAKE) -C $(OBJDIR) -f $(CURDIR)/Makefile SRC="$(topdir)" \
printf "Executing unit tests\n"
$(MAKE) -C com32/lib/syslinux/tests all
$(MAKE) -C tests SRC="$(topdir)/tests" OBJ="$(topdir)/tests" \
objdir=$(OBJDIR) \
-f $(topdir)/tests/Makefile all
+test: unittest regression
# Hook to add private Makefile targets for the maintainer.
-include $(topdir)/Makefile.private