3 # Copyright 2005 Develer S.r.l. (http://www.develer.com/)
4 # Copyright 2008 Bernie Innocenti <bernie@codewiz.org>
7 # Author: Bernie Innocenti <bernie@codewiz.org>
10 # Testsuite output level:
14 # 3 - execution output
19 #FIXME: -Ibertos/emul should not be needed
20 CFLAGS="-W -Wall -Wextra -Wundef -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wsign-compare -Wmissing-noreturn \
21 -O0 -g3 -ggdb -Ibertos -Ibertos/emul -std=gnu99 -fno-builtin -D_DEBUG -DARCH=(ARCH_EMUL|ARCH_UNITTEST) \
22 -DCPU_FREQ=(12288000UL) -ffunction-sections -fdata-sections -Wl,--gc-sections"
27 TESTS=${TESTS:-`find . \
28 \( -name .svn -prune -o -name .git -prune -o -name .hg -prune \) \
29 -o -name "*_test.c" -print` }
42 bertos/mware/formatwr.c
44 bertos/mware/sprintf.c
46 bertos/struct/kfile_fifo.c
48 bertos/struct/hashtable.c
50 bertos/emul/diskio_emul.c
53 bertos/emul/switch_ctx_emul.S
54 bertos/mware/ini_reader.c
55 bertos/emul/kfile_posix.c
56 bertos/algo/crc_ccitt.c
58 bertos/struct/kfile_mem.c
61 bertos/net/nmeap/src/nmeap01.c
63 bertos/cfg/kfile_debug.c
65 bertos/io/kblock_ram.c
66 bertos/io/kblock_file.c
72 [ "$VERBOSE" -ge 2 ] && buildout='/dev/stdout'
73 [ "$VERBOSE" -ge 3 ] && runout='/dev/stdout'
75 # Needed to get build/exec result code rather than tee's
78 rm -rf "${TESTOUT}.old"
79 if [ -d "${TESTOUT}" ] ; then
80 mv -f "${TESTOUT}" "$TESTOUT.old"
85 name="`basename $src | sed -e 's/\.cpp$//' -e 's/\.c$//'`"
86 testdir="./$TESTOUT/$name"
91 PREPARECMD="test/parsetest.py $src"
92 BUILDCMD="$CC -I$testdir $CFLAGS $src $SRC_LIST -o $exe"
93 export testdir name cfgdir
95 [ $VERBOSE -gt 0 ] && echo "Preparing $name..."
96 [ $VERBOSE -gt 4 ] && echo " $PREPARECMD"
97 if $PREPARECMD 2>&1 | tee >$buildout $testdir/$name.prep; then
98 [ $VERBOSE -gt 0 ] && echo "Building $name..."
99 [ $VERBOSE -gt 4 ] && echo " $BUILDCMD"
100 if $BUILDCMD 2>&1 | tee >$buildout $testdir/$name.build; then
101 [ $VERBOSE -gt 0 ] && echo "Running $name..."
102 if ! $exe 2>&1 | tee >$runout $testdir/$name.out; then
103 echo "FAILED [RUN]: $name"
106 echo "FAILED [BUILD]: $name"
109 echo "FAILED [PREPARING]: $name"