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 -Ibertos/net/lwip/src/include -Ibertos/net/lwip/src/include/ipv4 -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` }
34 bertos/algo/crc_ccitt.c
36 bertos/algo/fletcher32.c
45 bertos/mware/formatwr.c
47 bertos/mware/sprintf.c
49 bertos/struct/kfile_fifo.c
51 bertos/struct/hashtable.c
52 bertos/struct/bitarray.c
54 bertos/emul/diskio_emul.c
57 bertos/emul/switch_ctx_emul.S
58 bertos/mware/ini_reader.c
59 bertos/emul/kfile_posix.c
60 bertos/struct/kfile_mem.c
63 bertos/net/nmeap/src/nmeap01.c
66 bertos/cfg/kfile_debug.c
68 bertos/io/kblock_ram.c
69 bertos/io/kblock_posix.c
72 bertos/sec/cipher/blowfish.c
73 bertos/sec/cipher/aes.c
74 bertos/sec/kdf/pbkdf1.c
75 bertos/sec/kdf/pbkdf2.c
76 bertos/sec/hash/sha1.c
78 bertos/sec/hash/ripemd.c
85 [ "$VERBOSE" -ge 2 ] && buildout='/dev/stdout'
86 [ "$VERBOSE" -ge 3 ] && runout='/dev/stdout'
88 # Needed to get build/exec result code rather than tee's
91 rm -rf "${TESTOUT}.old"
92 if [ -d "${TESTOUT}" ] ; then
93 mv -f "${TESTOUT}" "$TESTOUT.old"
98 name="`basename $src | sed -e 's/\.cpp$//' -e 's/\.c$//'`"
99 testdir="./$TESTOUT/$name"
100 cfgdir="$testdir/cfg"
104 PREPARECMD="test/parsetest.py $src"
105 BUILDCMD="$CC -I$testdir $CFLAGS $src $SRC_LIST -o $exe"
106 export testdir name cfgdir
108 [ $VERBOSE -gt 0 ] && echo "Preparing $name..."
109 [ $VERBOSE -gt 4 ] && echo " $PREPARECMD"
110 if $PREPARECMD 2>&1 | tee -a >>$buildout $testdir/$name.prep; then
111 [ $VERBOSE -gt 0 ] && echo "Building $name..."
112 [ $VERBOSE -gt 4 ] && echo " $BUILDCMD"
113 if $BUILDCMD 2>&1 | tee -a >>$buildout $testdir/$name.build; then
114 [ $VERBOSE -gt 0 ] && echo "Running $name..."
115 if ! $exe 2>&1 | tee -a >>$runout $testdir/$name.out; then
116 echo "FAILED [RUN]: $name"
117 cat $testdir/$name.out
121 echo "FAILED [BUILD]: $name"
122 cat $testdir/$name.build
126 echo "FAILED [PREPARING]: $name"
127 cat $testdir/$name.prep