tests: add `cc.skip` to skip the C compilation of some programs
authorJean Privat <jean@pryen.org>
Sat, 26 Apr 2014 03:02:01 +0000 (23:02 -0400)
committerJean Privat <jean@pryen.org>
Sat, 26 Apr 2014 14:39:22 +0000 (10:39 -0400)
Exemple: unavailable C libraries.

Signed-off-by: Jean Privat <jean@pryen.org>

tests/cc.skip [new file with mode: 0644]
tests/tests.sh

diff --git a/tests/cc.skip b/tests/cc.skip
new file mode 100644 (file)
index 0000000..3fa85bc
--- /dev/null
@@ -0,0 +1,4 @@
+bcm2835
+gtk3_6
+gtk3_8
+posix_ext
index 733eb1f..9b42cb3 100755 (executable)
@@ -262,6 +262,15 @@ skip_exec()
        return 1
 }
 
+skip_cc()
+{
+       test "$noskip" = true && return 1
+       if echo "$1" | grep -f "cc.skip" >/dev/null 2>&1; then
+               return 0
+       fi
+       return 1
+}
+
 find_nitc()
 {
        ((tapcount=tapcount+1))
@@ -431,13 +440,18 @@ END
                        > "$ff.compile.log"
                        ERR=0
                else
+                       if skip_cc "$bf"; then
+                               nocc="--no-cc"
+                       else
+                               nocc=
+                       fi
                        # Compile
                        if [ "x$verbose" = "xtrue" ]; then
                                echo ""
-                               echo $NITC --no-color $OPT -o "$ff.bin" "$i" "$includes"
+                               echo $NITC --no-color $OPT -o "$ff.bin" "$i" "$includes" $nocc
                        fi
                        NIT_NO_STACK=1 JNI_LIB_PATH=$JNI_LIB_PATH JAVA_HOME=$JAVA_HOME \
-                               $TIMEOUT $NITC --no-color $OPT -o "$ff.bin" "$i" $includes 2> "$ff.cmp.err" > "$ff.compile.log"
+                               $TIMEOUT $NITC --no-color $OPT -o "$ff.bin" "$i" $includes $nocc 2> "$ff.cmp.err" > "$ff.compile.log"
                        ERR=$?
                        if [ "x$verbose" = "xtrue" ]; then
                                cat "$ff.compile.log"
@@ -452,6 +466,11 @@ END
                        # No exec
                        > "$ff.res"
                        process_result $bf $bf $pack
+               elif [ -n "$nocc" ]; then
+                       # not compiled
+                       test -z "$tap" && echo -n "nocc "
+                       > "$ff.res"
+                       process_result $bf $bf $pack
                elif [ -x "./$ff.bin" ]; then
                        test -z "$tap" && echo -n ". "
                        # Execute