Rename myself
[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
12 VERBOSE=1
13
14 CC=gcc
15 CFLAGS="-W -Wall -Wextra -I. -fno-builtin -D_DEBUG -D_TEST"
16
17 CXX=g++
18 CXXFLAGS="$CFLAGS"
19
20 for test in `find . -name "*_test.*"`; do
21         [ $VERBOSE -gt 0 ] && echo "Running $test..."
22         case "$test" in
23         *.cpp)
24                 $CXX $CXXFLAGS $test -o test || exit 1
25                 ./test || exit 1
26                 rm -f test
27         ;;
28         *.c)
29                 $CC $CFLAGS $test -o test || exit 1
30                 ./test || exit 1
31                 rm -f test
32         ;;
33         esac
34 done
35