Add bitarray module to build its test.
[bertos.git] / test / run_tests.sh
index ea88cb05e12ea199d98ebe94b49015ed275f8cd7..8d46d75cef367205303faa8ea389dc84ca16c50d 100755 (executable)
@@ -13,7 +13,7 @@
 #  2 - build warnings
 #  3 - execution output
 #  4 - build commands
-VERBOSE=${VERBOSE:-3}
+VERBOSE=${VERBOSE:-1}
 
 CC=gcc
 #FIXME: -Ibertos/emul should not be needed
@@ -24,7 +24,7 @@ CFLAGS="-W -Wall -Wextra -Wundef -Wpointer-arith -Wcast-qual -Wcast-align -Wwrit
 CXX=g++
 CXXFLAGS="$CFLAGS"
 
-TESTS?=${TESTS:-`find . \
+TESTS=${TESTS:-`find . \
        \( -name .svn -prune -o -name .git -prune -o -name .hg  -prune \) \
        -o -name "*_test.c" -print` }
 
@@ -46,6 +46,7 @@ SRC_LIST="
        bertos/struct/kfile_fifo.c
        bertos/struct/heap.c
        bertos/struct/hashtable.c
+       bertos/struct/bitarray.c
        bertos/fs/fatfs/ff.c
        bertos/emul/diskio_emul.c
        bertos/fs/fat.c
@@ -65,6 +66,16 @@ SRC_LIST="
        bertos/io/kblock_ram.c
        bertos/io/kblock_posix.c
        bertos/io/kfile.c
+       bertos/sec/cipher.c
+       bertos/sec/cipher/blowfish.c
+       bertos/sec/cipher/aes.c
+       bertos/sec/kdf/pbkdf1.c
+       bertos/sec/kdf/pbkdf2.c
+       bertos/sec/hash/sha1.c
+       bertos/sec/hash/md5.c
+       bertos/sec/hash/ripemd.c
+       bertos/sec/mac/hmac.c
+       bertos/sec/mac/omac.c
 "
 
 buildout='/dev/null'
@@ -94,19 +105,25 @@ for src in $TESTS; do
 
        [ $VERBOSE -gt 0 ] && echo "Preparing $name..."
        [ $VERBOSE -gt 4 ] && echo " $PREPARECMD"
-       if $PREPARECMD 2>&1 | tee >$buildout $testdir/$name.prep; then
+       if $PREPARECMD 2>&1 | tee -a >>$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
+               if $BUILDCMD 2>&1 | tee -a >>$buildout $testdir/$name.build; then
                        [ $VERBOSE -gt 0 ] && echo "Running $name..."
-                       if ! $exe 2>&1 | tee >$runout $testdir/$name.out; then
+                       if ! $exe 2>&1 | tee -a >>$runout $testdir/$name.out; then
                                echo "FAILED [RUN]: $name"
+                               cat $testdir/$name.out
+                               exit 2
                        fi
                else
                        echo "FAILED [BUILD]: $name"
+                       cat $testdir/$name.build
+                       exit 3
                fi
        else
                echo "FAILED [PREPARING]: $name"
+               cat $testdir/$name.prep
+               exit 4
        fi
 done