aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-04-09 13:00:53 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-04-09 13:00:53 +0000
commita8e42d985d55c416776a77051d633d4c05c783fa (patch)
treef635063f2aa2db161fdc3fc661968d3cb994e3ac
parent5f8df8485c77d69e7d72cc0c14c8fe423bf3d543 (diff)
downloadChibiOS-a8e42d985d55c416776a77051d633d4c05c783fa.tar.gz
ChibiOS-a8e42d985d55c416776a77051d633d4c05c783fa.tar.bz2
ChibiOS-a8e42d985d55c416776a77051d633d4c05c783fa.zip
Improved testing script for RT.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7877 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--test/rt/testbuild/go.sh173
-rw-r--r--test/rt/testbuild/readme.txt28
2 files changed, 78 insertions, 123 deletions
diff --git a/test/rt/testbuild/go.sh b/test/rt/testbuild/go.sh
index e5c8624d4..b09fcd4c3 100644
--- a/test/rt/testbuild/go.sh
+++ b/test/rt/testbuild/go.sh
@@ -5,7 +5,9 @@ XOPT="-ggdb -O0 -fomit-frame-pointer -DDELAY_BETWEEN_TESTS=0 -fprofile-arcs -fte
XDEFS=""
function clean() {
+ echo -n " * Cleaning..."
make clean > /dev/null
+ echo "OK"
}
function compile() {
@@ -32,14 +34,17 @@ function execute_test() {
function coverage() {
echo -n " * Coverage..."
- mkdir gcov 2> /dev/null
- if ! make gcov > gcovlog.txt 2> /dev/null
+ mkdir coverage 2> /dev/null
+ mkdir coverage/$1 2> /dev/null
+ echo "Configuration $2" > coverage/$1.txt
+ echo "----------------------------------------------------------------" >> coverage/$1.txt
+ if ! make gcov >> coverage/$1.txt 2> /dev/null
then
echo "failed"
clean
exit
fi
- mv -f *.gcov ./gcov
+ mv -f *.gcov ./coverage/$1
echo "OK"
}
@@ -54,10 +59,19 @@ function misra() {
echo "OK"
}
-function all() {
+function test() {
+ if [ -z "$2" ]
+ then
+ msg=$1": Default Settings"
+ XDEFS=
+ else
+ msg=$1": "$2
+ XDEFS=$2
+ fi
+ echo $msg
compile
execute_test
- coverage
+ coverage $1 "$msg"
misra
clean
}
@@ -69,121 +83,34 @@ function partial() {
clean
}
-echo "Default maximum settings"
-all
-
-echo "CH_CFG_OPTIMIZE_SPEED=FALSE"
-XDEFS=-DCH_CFG_OPTIMIZE_SPEED=FALSE
-partial
-
-echo "CH_CFG_TIME_QUANTUM=0"
-XDEFS=-DCH_CFG_TIME_QUANTUM=0
-partial
-
-echo "CH_CFG_USE_REGISTRY=FALSE"
-XDEFS=-DCH_CFG_USE_REGISTRY=FALSE
-partial
-
-echo "CH_CFG_USE_SEMAPHORES=FALSE CH_CFG_USE_MAILBOXES=FALSE"
-XDEFS="-DCH_CFG_USE_SEMAPHORES=FALSE -DCH_CFG_USE_MAILBOXES=FALSE"
-partial
-
-echo "CH_CFG_USE_SEMAPHORES_PRIORITY=TRUE"
-XDEFS=-DCH_CFG_USE_SEMAPHORES_PRIORITY=TRUE
-partial
-
-echo "CH_CFG_USE_MUTEXES=FALSE CH_CFG_USE_CONDVARS=FALSE"
-XDEFS="-DCH_CFG_USE_MUTEXES=FALSE -DCH_CFG_USE_CONDVARS=FALSE"
-partial
-
-echo "CH_CFG_USE_MUTEXES_RECURSIVE=TRUE"
-XDEFS=-DCH_CFG_USE_MUTEXES_RECURSIVE=TRUE
-partial
-
-echo "CH_CFG_USE_CONDVARS=FALSE"
-XDEFS=-DCH_CFG_USE_CONDVARS=FALSE
-partial
-
-echo "CH_CFG_USE_CONDVARS_TIMEOUT=FALSE"
-XDEFS=-DCH_CFG_USE_CONDVARS_TIMEOUT=FALSE
-partial
-
-echo "CH_CFG_USE_EVENTS=FALSE"
-XDEFS=-DCH_CFG_USE_EVENTS=FALSE
-partial
-
-echo "CH_CFG_USE_EVENTS_TIMEOUT=FALSE"
-XDEFS=-DCH_CFG_USE_EVENTS_TIMEOUT=FALSE
-partial
-
-echo "CH_CFG_USE_MESSAGES=FALSE"
-XDEFS=-DCH_CFG_USE_MESSAGES=FALSE
-partial
-
-echo "CH_CFG_USE_MESSAGES_PRIORITY=TRUE"
-XDEFS=-DCH_CFG_USE_MESSAGES_PRIORITY=TRUE
-partial
-
-echo "CH_CFG_USE_MAILBOXES=FALSE"
-XDEFS=-DCH_CFG_USE_MAILBOXES=FALSE
-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"
-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"
-partial
-
-echo "CH_CFG_USE_MEMPOOLS=FALSE"
-XDEFS="-DCH_CFG_USE_MEMPOOLS=FALSE"
-partial
-
-echo "CH_CFG_USE_HEAP=FALSE"
-XDEFS="-DCH_CFG_USE_HEAP=FALSE"
-partial
-
-echo "CH_CFG_USE_DYNAMIC=FALSE"
-XDEFS=-DCH_CFG_USE_DYNAMIC=FALSE
-partial
-
-#echo "CH_DBG_STATISTICS=TRUE"
-#XDEFS=-DCH_DBG_STATISTICS=TRUE
-#compile
-#execute_test
-#misra
-
-echo "CH_DBG_SYSTEM_STATE_CHECK=TRUE"
-XDEFS=-DCH_DBG_SYSTEM_STATE_CHECK=TRUE
-partial
-
-echo "CH_DBG_ENABLE_CHECKS=TRUE"
-XDEFS=-DCH_DBG_ENABLE_CHECKS=TRUE
-partial
-
-echo "CH_DBG_ENABLE_ASSERTS=TRUE"
-XDEFS=-DCH_DBG_ENABLE_ASSERTS=TRUE
-partial
-
-echo "CH_DBG_ENABLE_TRACE=TRUE"
-XDEFS=-DCH_DBG_ENABLE_TRACE=TRUE
-partial
-
-#echo "CH_DBG_ENABLE_STACK_CHECK=TRUE"
-#XDEFS=-DCH_DBG_ENABLE_STACK_CHECK=TRUE
-#compile
-#execute_test
-#misra
-
-echo "CH_DBG_FILL_THREADS=TRUE"
-XDEFS=-DCH_DBG_FILL_THREADS=TRUE
-partial
-
-echo "CH_DBG_THREADS_PROFILING=FALSE"
-XDEFS=-DCH_DBG_THREADS_PROFILING=FALSE
-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"
-partial
+test cfg1 ""
+test cfg2 "-DCH_CFG_OPTIMIZE_SPEED=FALSE"
+test cfg3 "-DCH_CFG_TIME_QUANTUM=0"
+test cfg4 "-DCH_CFG_USE_REGISTRY=FALSE"
+test cfg5 "-DCH_CFG_USE_SEMAPHORES=FALSE -DCH_CFG_USE_MAILBOXES=FALSE"
+test cfg6 "-DCH_CFG_USE_SEMAPHORES_PRIORITY=TRUE"
+test cfg7 "-DCH_CFG_USE_MUTEXES=FALSE -DCH_CFG_USE_CONDVARS=FALSE"
+test cfg8 "-DCH_CFG_USE_MUTEXES_RECURSIVE=TRUE"
+test cfg9 "-DCH_CFG_USE_CONDVARS=FALSE"
+test cfg10 "-DCH_CFG_USE_CONDVARS_TIMEOUT=FALSE"
+test cfg11 "-DCH_CFG_USE_EVENTS=FALSE"
+test cfg12 "-DCH_CFG_USE_EVENTS_TIMEOUT=FALSE"
+test cfg13 "-DCH_CFG_USE_MESSAGES=FALSE"
+test cfg14 "-DCH_CFG_USE_MESSAGES_PRIORITY=TRUE"
+test cfg15 "-DCH_CFG_USE_MAILBOXES=FALSE"
+test cfg16 "-DCH_CFG_USE_MEMCORE=FALSE -DCH_CFG_USE_MEMPOOLS=FALSE -DCH_CFG_USE_HEAP=FALSE -DCH_CFG_USE_DYNAMIC=FALSE"
+test cfg17 "-DCH_CFG_USE_MEMPOOLS=FALSE -DCH_CFG_USE_HEAP=FALSE -DCH_CFG_USE_DYNAMIC=FALSE"
+test cfg18 "-DCH_CFG_USE_MEMPOOLS=FALSE"
+test cfg19 "-DCH_CFG_USE_HEAP=FALSE"
+test cfg20 "-DCH_CFG_USE_DYNAMIC=FALSE"
+#test cfg21 "-DCH_DBG_STATISTICS=TRUE"
+test cfg22 "-DCH_DBG_SYSTEM_STATE_CHECK=TRUE"
+test cfg23 "-DCH_DBG_ENABLE_CHECKS=TRUE"
+test cfg24 "-DCH_DBG_ENABLE_ASSERTS=TRUE"
+test cfg25 "-DCH_DBG_ENABLE_TRACE=TRUE"
+#test cfg26 "-DCH_DBG_ENABLE_STACK_CHECK=TRUE"
+test cfg27 "-DCH_DBG_FILL_THREADS=TRUE"
+test cfg28 "-DCH_DBG_THREADS_PROFILING=FALSE"
+test cfg29 "-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"
+
+rm *log.txt 2> /dev/null
diff --git a/test/rt/testbuild/readme.txt b/test/rt/testbuild/readme.txt
new file mode 100644
index 000000000..aff565702
--- /dev/null
+++ b/test/rt/testbuild/readme.txt
@@ -0,0 +1,28 @@
+This test performs 5 distinct operations on the RT code base. Each phase
+writes a log file where errors can be found if the execution stops.
+
+Step 1: Build
+
+This step makes sure that there aren't compilation errors nor warnings in all
+the defined configurations.
+
+Step 2: Execute
+
+The test suite is executed in the simulator in order to make sure that all
+the defined test cases succeed in all the defined configurations.
+Coverage data is collected during the execution for use by step 3.
+
+Step 3: Coverage
+
+The utility gcov is ran on the generate data and the coverage information is
+stored in reports under ./coverage.
+
+Step 4: Analysis
+
+PC-Lint is run on the codebase in order to detect MISRA violations or other
+problems under the current analyser rules set (PC-Lint 9.0L is required).
+
+Step 5: Clearing
+
+The compilation products are cleared and the system is restored to original
+state except for the generated reports and logs.