]> rtime.felk.cvut.cz Git - omk.git/blobdiff - tests/wvtest.sh
NuttX: the adapt to new implementation of ROMFS mounting at /etc
[omk.git] / tests / wvtest.sh
index 5c112228c3af77814cd67c08be632e40c3aa9ae2..d6bc1984d73ad4651e8ee310caefd2c9028085f9 100644 (file)
@@ -14,6 +14,8 @@ _wvtextclean()
 
 
 if [ -n "$BASH_VERSION" ]; then
+        trap 'echo "! ${BASH_SOURCE[0]}:${LINENO} ${BASH_COMMAND} FAILED"' ERR
+
        _wvfind_caller()
        {
                LVL=$1
@@ -131,6 +133,14 @@ WVSTART()
        echo >&2
        _wvfind_caller
        echo "Testing \"$* ($OMK_RULES)\" in $WVCALLER_FILE:" >&2
+       cd "$WV_BASE_DIR"
+       local dir=test.$(echo $* | tr -s '[[:blank:]]' _ | tr "A-Z" "a-z")
+       rm -rf "$dir"
+       mkdir -p "$dir"
+       WVPASS cd "$WV_BASE_DIR/$dir"
+       WVPASS cp "$OMK_TESTSROOT"/../rules/$OMK_RULES/* .
+       WVPASS cp "$OMK_TESTSROOT"/../snippets/Makefile.rules.$OMK_RULES Makefile.rules
+       WVPASS cp "$OMK_TESTSROOT/../leaf-makefile/Makefile" .
 }
 
 omkize()
@@ -149,6 +159,16 @@ needs_valid_CC()
        echo "Warning: '$CC' not found - skipping the test"
        exit 0
     fi
+
+    if [[ $OMK_RULES = sysless-keil16x ]] && ! which cygpath; then
+       echo "Warning: cygpath command not found - skipping the test"
+       exit 0
+    fi
+
+    if [[ $OMK_RULES = sysless-keil51 ]] && ! which l51; then
+       echo "Warning: l51 command not found - skipping the test"
+       exit 0
+    fi
 }
 
 OMK_TESTSROOT=${OMK_TESTSROOT:-$(readlink --canonicalize $(dirname $0))}
@@ -173,3 +193,9 @@ testdir="tmp/$(basename $0 .sh).$OMK_RULES"
 WVPASS mkdir -p "$testdir"
 WVPASS cd "$testdir"
 WVPASS cp "$OMK_TESTSROOT"/../rules/$OMK_RULES/* .
+WVPASS cp "$OMK_TESTSROOT"/../snippets/Makefile.rules.$OMK_RULES Makefile.rules
+WVPASS cp "$OMK_TESTSROOT/../leaf-makefile/Makefile" .
+
+WV_BASE_DIR="$PWD"
+export MAKEFLAGS="--include-dir=$OMK_TESTSROOT/../snippets"
+export LC_ALL=C