77689f48353b5a93f9057802fcc20cc55f44d582
[bertos.git] / bertos / run_tests.sh
1 #!/bin/bash
2 #
3 # Copyright 2005 Develer S.r.l. (http://www.develer.com/)
4 # All rights reserved.
5 #
6 # Author: Bernie Innocenti <bernie@codewiz.org>
7 #
8 # $Id$
9 #
10
11 VERBOSE=1
12
13 CC=gcc
14 CFLAGS="-W -Wall -Wextra -I. -Iemul -std=gnu99 -fno-builtin -D_DEBUG -D_TEST -DARCH=ARCH_EMUL"
15
16 CXX=g++
17 CXXFLAGS="$CFLAGS"
18
19 TESTS=${TESTS:-`find . -name "*_test.c*"`}
20
21 for test in $TESTS; do
22         [ $VERBOSE -gt 0 ] && echo "Running $test..."
23         case "$test" in
24         *.cpp)
25                 $CXX $CXXFLAGS $test -o test || exit 1
26                 ./test || exit 1
27                 rm -f test
28         ;;
29         *.c)
30                 $CC $CFLAGS $test -o test || exit 1
31                 ./test || exit 1
32                 rm -f test
33         ;;
34         esac
35 done
36