From 26a04427651b145f2d9cead8d448228e56c72a2c Mon Sep 17 00:00:00 2001 From: batt Date: Tue, 2 Dec 2008 15:35:38 +0000 Subject: [PATCH] Add unittest library creation. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1959 38d2e660-2303-0410-9eaa-f027e97ec537 --- Makefile | 3 ++- bertos/rules.mk | 6 +++--- test/libunittest.mk | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 test/libunittest.mk diff --git a/Makefile b/Makefile index 1eb5c26e..dcf43722 100644 --- 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 diff --git a/bertos/rules.mk b/bertos/rules.mk index 6f001f70..ff8e7d67 100644 --- a/bertos/rules.mk +++ b/bertos/rules.mk @@ -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 index 00000000..438f2283 --- /dev/null +++ b/test/libunittest.mk @@ -0,0 +1,36 @@ +# +# Copyright 2008 Develer S.r.l. (http://www.develer.com/) +# +# Makefile fragment for unit testing. +# +# Author: Francesco Sacchi +# + +# 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)" -- 2.25.1