diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-04-07 14:44:09 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-04-07 14:44:09 +0000 |
commit | 7725e83be6ce927b05fb917a05b0d227a5be1058 (patch) | |
tree | ddd07fb15964bf7a2eab04b176cfa9e7ed561595 /test/rt | |
parent | 8375bae08bd24cd8a54ee08a164b8db5795cd294 (diff) | |
download | ChibiOS-7725e83be6ce927b05fb917a05b0d227a5be1058.tar.gz ChibiOS-7725e83be6ce927b05fb917a05b0d227a5be1058.tar.bz2 ChibiOS-7725e83be6ce927b05fb917a05b0d227a5be1058.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7871 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/rt')
-rw-r--r-- | test/rt/testbuild/Makefile | 10 | ||||
-rw-r--r-- | test/rt/testbuild/go.sh | 146 |
2 files changed, 70 insertions, 86 deletions
diff --git a/test/rt/testbuild/Makefile b/test/rt/testbuild/Makefile index a7ba780c2..c67c5fdb4 100644 --- a/test/rt/testbuild/Makefile +++ b/test/rt/testbuild/Makefile @@ -10,6 +10,8 @@ TRGT = mingw32-
CC = $(TRGT)gcc
AS = $(TRGT)gcc -x assembler-with-cpp
+AR = $(TRGT)ar
+COV = gcov
# List all default C defines here, like -D_DEBUG=1
DDEFS = -DSIMULATOR
@@ -95,7 +97,7 @@ ADEFS = $(DADEFS) $(UADEFS) OBJS = $(ASRC:.s=.o) $(SRC:.c=.o)
LIBS = $(DLIBS) $(ULIBS)
-LDFLAGS = -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
+LDFLAGS = -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch -lgcov $(LIBDIR)
ASFLAGS = -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
CPFLAGS = $(OPT) -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
@@ -117,12 +119,18 @@ all: $(OBJS) $(PROJECT).exe %exe: $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
+.PHONY: gcov
+gcov:
+ $(COV) -u -o $(CHIBIOS)/os/rt/src $(KERNSRC)
+
clean:
-rm -f $(OBJS)
-rm -f $(PROJECT).exe
-rm -f $(PROJECT).map
-rm -f $(SRC:.c=.c.bak)
-rm -f $(SRC:.c=.lst)
+ -rm -f $(SRC:.c=.gcno)
+ -rm -f $(SRC:.c=.gcda)
-rm -f $(ASRC:.s=.s.bak)
-rm -f $(ASRC:.s=.lst)
-rm -fR .dep
diff --git a/test/rt/testbuild/go.sh b/test/rt/testbuild/go.sh index ccb5465fb..e779f758f 100644 --- a/test/rt/testbuild/go.sh +++ b/test/rt/testbuild/go.sh @@ -1,11 +1,11 @@ #!/bin/bash export XOPT XDEFS -XOPT="-ggdb -O2 -fomit-frame-pointer -DDELAY_BETWEEN_TESTS=0" +XOPT="-ggdb -O2 -fomit-frame-pointer -DDELAY_BETWEEN_TESTS=0 -fprofile-arcs -ftest-coverage" XDEFS="" function clean() { - make clean > /dev/null + mingw32-make clean > /dev/null } function compile() { @@ -27,138 +27,128 @@ function execute_test() { clean exit fi - clean + echo "OK" +} + +function coverage() { + echo -n " * Coverage..." + mkdir gcov 2> /dev/null + if ! mingw32-make gcov > gcovlog.txt 2> /dev/null + then + echo "failed" + clean + exit + fi + mv -f *.gcov ./gcov echo "OK" } function misra() { echo -n " * Analysing..." - if ! make misra > misralog.txt + if ! mingw32-make misra > misralog.txt then echo "failed" + clean exit fi echo "OK" } +function all() { + compile + execute_test + coverage + misra + clean +} + +function partial() { + compile + execute_test + misra + clean +} + echo "Default maximum settings" -compile -execute_test -misra +all + +exit echo "CH_CFG_OPTIMIZE_SPEED=FALSE" XDEFS=-DCH_CFG_OPTIMIZE_SPEED=FALSE -compile -execute_test -misra +partial echo "CH_CFG_TIME_QUANTUM=0" XDEFS=-DCH_CFG_TIME_QUANTUM=0 -compile -execute_test -misra +partial echo "CH_CFG_USE_REGISTRY=FALSE" XDEFS=-DCH_CFG_USE_REGISTRY=FALSE -compile -execute_test -misra +partial echo "CH_CFG_USE_SEMAPHORES=FALSE CH_CFG_USE_MAILBOXES=FALSE" XDEFS="-DCH_CFG_USE_SEMAPHORES=FALSE -DCH_CFG_USE_MAILBOXES=FALSE" -compile -execute_test -misra +partial echo "CH_CFG_USE_SEMAPHORES_PRIORITY=TRUE" XDEFS=-DCH_CFG_USE_SEMAPHORES_PRIORITY=TRUE -compile -execute_test -misra +partial echo "CH_CFG_USE_MUTEXES=FALSE CH_CFG_USE_CONDVARS=FALSE" XDEFS="-DCH_CFG_USE_MUTEXES=FALSE -DCH_CFG_USE_CONDVARS=FALSE" -compile -execute_test -misra +partial echo "CH_CFG_USE_MUTEXES_RECURSIVE=TRUE" XDEFS=-DCH_CFG_USE_MUTEXES_RECURSIVE=TRUE -compile -execute_test -misra +partial echo "CH_CFG_USE_CONDVARS=FALSE" XDEFS=-DCH_CFG_USE_CONDVARS=FALSE -compile -execute_test -misra +partial echo "CH_CFG_USE_CONDVARS_TIMEOUT=FALSE" XDEFS=-DCH_CFG_USE_CONDVARS_TIMEOUT=FALSE -compile -execute_test -misra +partial echo "CH_CFG_USE_EVENTS=FALSE" XDEFS=-DCH_CFG_USE_EVENTS=FALSE -compile -execute_test -misra +partial echo "CH_CFG_USE_EVENTS_TIMEOUT=FALSE" XDEFS=-DCH_CFG_USE_EVENTS_TIMEOUT=FALSE -compile -execute_test -misra +partial echo "CH_CFG_USE_MESSAGES=FALSE" XDEFS=-DCH_CFG_USE_MESSAGES=FALSE -compile -execute_test -misra +partial echo "CH_CFG_USE_MESSAGES_PRIORITY=TRUE" XDEFS=-DCH_CFG_USE_MESSAGES_PRIORITY=TRUE -compile -execute_test -misra +partial echo "CH_CFG_USE_MAILBOXES=FALSE" XDEFS=-DCH_CFG_USE_MAILBOXES=FALSE -compile -execute_test -misra +partial echo "CH_CFG_USE_MEMCORE=FALSE CH_CFG_USE_MEMPOOLS=FALSE CH_CFG_USE_HEAP=FALSE CH_CFG_USE_DYNAMIC=FALSE" XDEFS="-DCH_CFG_USE_MEMCORE=FALSE -DCH_CFG_USE_MEMPOOLS=FALSE -DCH_CFG_USE_HEAP=FALSE -DCH_CFG_USE_DYNAMIC=FALSE" -compile -execute_test -misra +partial echo "CH_CFG_USE_MEMPOOLS=FALSE CH_CFG_USE_HEAP=FALSE CH_CFG_USE_DYNAMIC=FALSE" XDEFS="-DCH_CFG_USE_MEMPOOLS=FALSE -DCH_CFG_USE_HEAP=FALSE -DCH_CFG_USE_DYNAMIC=FALSE" -compile -execute_test -misra +partial echo "CH_CFG_USE_MEMPOOLS=FALSE" XDEFS="-DCH_CFG_USE_MEMPOOLS=FALSE" -compile -execute_test -misra +partial echo "CH_CFG_USE_HEAP=FALSE" XDEFS="-DCH_CFG_USE_HEAP=FALSE" -compile -execute_test -misra +partial echo "CH_CFG_USE_DYNAMIC=FALSE" XDEFS=-DCH_CFG_USE_DYNAMIC=FALSE -compile -execute_test -misra +partial #echo "CH_DBG_STATISTICS=TRUE" #XDEFS=-DCH_DBG_STATISTICS=TRUE @@ -168,27 +158,19 @@ misra echo "CH_DBG_SYSTEM_STATE_CHECK=TRUE" XDEFS=-DCH_DBG_SYSTEM_STATE_CHECK=TRUE -compile -execute_test -misra +partial echo "CH_DBG_ENABLE_CHECKS=TRUE" XDEFS=-DCH_DBG_ENABLE_CHECKS=TRUE -compile -execute_test -misra +partial echo "CH_DBG_ENABLE_ASSERTS=TRUE" XDEFS=-DCH_DBG_ENABLE_ASSERTS=TRUE -compile -execute_test -misra +partial echo "CH_DBG_ENABLE_TRACE=TRUE" XDEFS=-DCH_DBG_ENABLE_TRACE=TRUE -compile -execute_test -misra +partial #echo "CH_DBG_ENABLE_STACK_CHECK=TRUE" #XDEFS=-DCH_DBG_ENABLE_STACK_CHECK=TRUE @@ -198,18 +180,12 @@ misra echo "CH_DBG_FILL_THREADS=TRUE" XDEFS=-DCH_DBG_FILL_THREADS=TRUE -compile -execute_test -misra +partial echo "CH_DBG_THREADS_PROFILING=FALSE" XDEFS=-DCH_DBG_THREADS_PROFILING=FALSE -compile -execute_test -misra +partial echo "CH_DBG_SYSTEM_STATE_CHECK=TRUE CH_DBG_ENABLE_CHECKS=TRUE CH_DBG_ENABLE_ASSERTS=TRUE CH_DBG_ENABLE_TRACE=TRUE CH_DBG_FILL_THREADS=TRUE" XDEFS="-DCH_DBG_SYSTEM_STATE_CHECK=TRUE -DCH_DBG_ENABLE_CHECKS=TRUE -DCH_DBG_ENABLE_ASSERTS=TRUE -DCH_DBG_ENABLE_TRACE=TRUE -DCH_DBG_FILL_THREADS=TRUE" -compile -execute_test -misra +partial |