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 -O0 -g3 -ggdb -Ibertos -Ibertos/emul -std=gnu99 -fno-builtin -D_DEBUG -DARCH=(ARCH_EMUL|ARCH_UNITTEST) -DCPU_FREQ=(12288000UL)"
25 TESTS=${TESTS:-`find . \
26 \( -name .svn -prune -o -name .git -prune -o -name .hg -prune \) \
27 -o -name "*_test.c" -print` }
30 SRC_LIST="bertos/algo/ramp.c bertos/drv/kdebug.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/kern/sem.c bertos/mware/event.c bertos/mware/formatwr.c bertos/mware/hex.c bertos/mware/sprintf.c bertos/os/hptime.c bertos/emul/switch_ctx_emul.S"
34 [ "$VERBOSE" -ge 2 ] && buildout='/dev/stdout'
35 [ "$VERBOSE" -ge 3 ] && runout='/dev/stdout'
37 # Needed to get build/exec result code rather than tee's
40 rm -rf "${TESTOUT}.old"
41 mv -f "${TESTOUT}" "$TESTOUT.old"
45 name="`basename $src | sed -e 's/\.cpp$//' -e 's/\.c$//'`"
46 testdir="./$TESTOUT/$name"
51 PREPARECMD="test/parsetest.py $src"
52 BUILDCMD="$CC -I$testdir $CFLAGS $src $SRC_LIST -o $exe"
53 export testdir name cfgdir
55 [ $VERBOSE -gt 0 ] && echo "Preparing $name..."
56 [ $VERBOSE -gt 4 ] && echo " $PREPARECMD"
57 if $PREPARECMD 2>&1 | tee >$buildout $testdir/$name.prep; then
58 [ $VERBOSE -gt 0 ] && echo "Building $name..."
59 [ $VERBOSE -gt 4 ] && echo " $BUILDCMD"
60 if $BUILDCMD 2>&1 | tee >$buildout $testdir/$name.build; then
61 [ $VERBOSE -gt 0 ] && echo "Running $name..."
62 if ! $exe 2>&1 | tee >$runout $testdir/$name.out; then
63 echo "FAILED [RUN]: $name"
66 echo "FAILED [BUILD]: $name"
69 echo "FAILED [PREPARING]: $name"