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 -Ibertos -Ibertos/emul -std=gnu99 -fno-builtin -D_DEBUG -DARCH=(ARCH_EMUL|ARCH_UNITTEST)"
25 TESTS=${TESTS:-`find . \
26 \( -name .svn -prune -o -name .git -prune -o -name .hg -prune \) \
27 -o -name "*_test.c*" -print` }
33 [ "$VERBOSE" -ge 2 ] && buildout='/dev/stdout'
34 [ "$VERBOSE" -ge 3 ] && runout='/dev/stdout'
36 # Needed to get build/exec result code rather than tee's
39 rm -rf "${TESTOUT}.old"
40 mv -f "${TESTOUT}" "$TESTOUT.old"
44 name="`basename $src | sed -e 's/\.cpp$//' -e 's/\.c$//'`"
45 exe="./$TESTOUT/$name"
48 *.cpp) BUILDCMD="$CXX $CXXFLAGS $src -o $exe" ;;
49 *.c) BUILDCMD="$CC $CXXFLAGS $src -o $exe" ;;
52 [ $VERBOSE -gt 0 ] && echo "Building $name..."
53 [ $VERBOSE -gt 4 ] && echo " $BUILDCMD"
54 if $BUILDCMD 2>&1 | tee >$buildout $TESTOUT/$name.build; then
55 [ $VERBOSE -gt 0 ] && echo "Running $name..."
56 if ! $exe 2>&1 | tee >$runout $TESTOUT/$name.out; then
57 echo "FAILED [RUN]: $name"
60 echo "FAILED [BUILD]: $name"