]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Run subtests in a separate directory
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 28 Oct 2013 19:01:01 +0000 (20:01 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 28 Oct 2013 19:03:08 +0000 (20:03 +0100)
This makes subtests easier to understand, because one need not to read
the whole test script to figure out in which state we actualy are.

tests/wvtest.sh

index ac1e2d2cc22c25351f1139476c917eb0d5007fe1..e217901ab1c2d04a7efa93aca5b8cef12d5cf429 100644 (file)
@@ -133,6 +133,12 @@ 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/* .
 }
 
 omkize()
@@ -185,3 +191,5 @@ testdir="tmp/$(basename $0 .sh).$OMK_RULES"
 WVPASS mkdir -p "$testdir"
 WVPASS cd "$testdir"
 WVPASS cp "$OMK_TESTSROOT"/../rules/$OMK_RULES/* .
+
+WV_BASE_DIR="$PWD"