summaryrefslogtreecommitdiff
path: root/Makefile.custom
diff options
context:
space:
mode:
authorBartosz Golaszewski2014-06-22 16:30:41 +0200
committerDenys Vlasenko2014-06-22 16:30:41 +0200
commit3ed81cf0529145d04299c4cd48b1aaab2fe36193 (patch)
treef8d40bf4c55c9dadba0773543048a5d69b695002 /Makefile.custom
parent5d2e409ef8224dc32fde59702e8ec90b231441ed (diff)
downloadbusybox-3ed81cf0529145d04299c4cd48b1aaab2fe36193.zip
busybox-3ed81cf0529145d04299c4cd48b1aaab2fe36193.tar.gz
unit-tests: implement the unit-testing framework
This set of patches adds a simple unit-testing framework to Busybox unit-tests: add some helper macros for unit-test framework implementation unit-tests: implement the unit-testing framework unit-tests: add basic documentation on writing the unit test cases unit-tests: modify the Makefile 'test' target to run unit-tests too unit-tests: add two example test cases unit-tests: modify the existing strrstr test code to use the unit-test framework Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'Makefile.custom')
-rw-r--r--Makefile.custom4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile.custom b/Makefile.custom
index 8c95ef2..f8a1283 100644
--- a/Makefile.custom
+++ b/Makefile.custom
@@ -55,7 +55,11 @@ endif
# (cp -pPR is POSIX-compliant (cp -dpR or cp -a would not be))
.PHONY: check
.PHONY: test
+ifeq ($(CONFIG_UNIT_TEST),y)
+UNIT_CMD = ./busybox unit
+endif
check test: busybox busybox.links
+ $(UNIT_CMD)
test -d $(objtree)/testsuite || cp -pPR $(srctree)/testsuite $(objtree)
bindir=$(objtree) srcdir=$(srctree)/testsuite \
$(SHELL) -c "cd $(objtree)/testsuite && $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)"