From a4076491b617cf3abbd92a6e118fbae7b886e4b6 Mon Sep 17 00:00:00 2001 From: batt Date: Wed, 17 Dec 2008 16:19:09 +0000 Subject: [PATCH] Add test dependences in run_tests.sh; add test parsing; remove cpp support. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2068 38d2e660-2303-0410-9eaa-f027e97ec537 --- test/run_tests.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/test/run_tests.sh b/test/run_tests.sh index 16171d64..2449ad2e 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -27,9 +27,7 @@ TESTS=${TESTS:-`find . \ -o -name "*_test.c*" -print` } TESTOUT="testout" - -#Unit test static library -TESTLIB="images/libunittest.a" +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.S" buildout='/dev/null' runout='/dev/null' @@ -45,22 +43,30 @@ mkdir -p "$TESTOUT" for src in $TESTS; do name="`basename $src | sed -e 's/\.cpp$//' -e 's/\.c$//'`" - exe="./$TESTOUT/$name" + testdir="./$TESTOUT/$name" + cfgdir="$testdir/cfg" + mkdir -p "$cfgdir" + exe="$testdir/$name" - case "$src" in - *.cpp) BUILDCMD="$CXX $CXXFLAGS $src $TESTLIB -o $exe" ;; - *.c) BUILDCMD="$CC $CFLAGS $src $TESTLIB -o $exe" ;; - esac + PREPARECMD="test/parsetest.py $src" + BUILDCMD="$CC -I$testdir $CFLAGS $src $SRC_LIST -o $exe" + export testdir name cfgdir - [ $VERBOSE -gt 0 ] && echo "Building $name..." - [ $VERBOSE -gt 4 ] && echo " $BUILDCMD" - if $BUILDCMD 2>&1 | tee >$buildout $TESTOUT/$name.build; then - [ $VERBOSE -gt 0 ] && echo "Running $name..." - if ! $exe 2>&1 | tee >$runout $TESTOUT/$name.out; then - echo "FAILED [RUN]: $name" + [ $VERBOSE -gt 0 ] && echo "Preparing $name..." + [ $VERBOSE -gt 4 ] && echo " $PREPARECMD" + if $PREPARECMD 2>&1 | tee >$buildout $testdir/$name.prep; then + [ $VERBOSE -gt 0 ] && echo "Building $name..." + [ $VERBOSE -gt 4 ] && echo " $BUILDCMD" + if $BUILDCMD 2>&1 | tee >$buildout $testdir/$name.build; then + [ $VERBOSE -gt 0 ] && echo "Running $name..." + if ! $exe 2>&1 | tee >$runout $testdir/$name.out; then + echo "FAILED [RUN]: $name" + fi + else + echo "FAILED [BUILD]: $name" fi else - echo "FAILED [BUILD]: $name" + echo "FAILED [PREPARING]: $name" fi done -- 2.25.1