Add unittest library creation.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 2 Dec 2008 15:35:38 +0000 (15:35 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 2 Dec 2008 15:35:38 +0000 (15:35 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1959 38d2e660-2303-0410-9eaa-f027e97ec537

Makefile
bertos/rules.mk
test/libunittest.mk [new file with mode: 0644]

index 1eb5c26ef7b0b8c2cadb3186275e2c535d4b1435..dcf43722414813244461632834b75d5dc7a2787c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,9 @@ default: all
 include bertos/config.mk
 
 #Include subtargets
-include examples/demo/demo.mk
+#include examples/demo/demo.mk
 #include examples/at91sam7s/at91sam7s.mk
 #include examples/triface/triface.mk
+include test/libunittest.mk
 
 include bertos/rules.mk
index 6f001f70d8f4286788bd8a13023c49cd0c122a04..ff8e7d674b72ecbc905e099a81c545ae28c731c6 100644 (file)
@@ -62,7 +62,7 @@ tags:
 
 # Run testsuite
 .PHONY: check
-check:
+check: $(OUTDIR)/libunittest.a
        $L "Running testsuite"
        $Q test/run_tests.sh
 
@@ -284,8 +284,8 @@ $$(OUTDIR)/$(1).rom: $$(OUTDIR)/$(1).elf
 
 endef
 
-# Generate build rules for all targets
-$(foreach t,$(TRG),$(eval $(call build_target,$(t))))
+# Generate build rules for all targets and libunittest
+$(foreach t,$(TRG) libunittest,$(eval $(call build_target,$(t))))
 
 # Generate Qt's moc files from headers
 # NOTE: moc totally sucks and can generate empty files for some error conditions,
diff --git a/test/libunittest.mk b/test/libunittest.mk
new file mode 100644 (file)
index 0000000..438f228
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+#
+# Makefile fragment for unit testing.
+#
+# Author: Francesco Sacchi <batt@develer.com>
+#
+
+# Set to 1 for debug builds
+libunittest_DEBUG = 1
+
+# Our target application
+#TRG += libunittest
+
+libunittest_CSRC = \
+       bertos/algo/ramp.c \
+       bertos/drv/timer.c \
+       bertos/fs/battfs.c \
+       bertos/kern/coop.c \
+       bertos/kern/idle.c \
+       bertos/kern/kfile.c \
+       bertos/kern/monitor.c \
+       bertos/kern/proc.c \
+       bertos/kern/signal.c \
+       bertos/mware/event.c \
+       bertos/mware/formatwr.c \
+       bertos/mware/hex.c \
+       bertos/mware/sprintf.c \
+       bertos/os/hptime.c \
+       #
+
+libunittest_CPPASRC = \
+       bertos/emul/switch.S \
+       #
+
+libunittest_CFLAGS = -O0 -g3 -ggdb -D"ARCH=(ARCH_EMUL | ARCH_UNITTEST)"