tests: Move relative directory path hack from run_tests to common.sh
authorMartin Schwenke <martin@meltin.net>
Thu, 19 Apr 2012 01:23:07 +0000 (11:23 +1000)
committerMartin Schwenke <martin@meltin.net>
Fri, 27 Apr 2012 05:40:43 +0000 (15:40 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/scripts/common.sh
tests/scripts/run_tests

index 481ef298c6a6eb8043a0099015eba86edfe19a00..2d7b2e292e5afa29bc40066b5100a3ebbcd8cf3d 100644 (file)
@@ -2,7 +2,11 @@
 
 # Common variables and functions for all CTDB tests.
 
-export TEST_SUBDIR=$(dirname $0)
+# This expands the most probable problem cases like "." and "..".
+TEST_SUBDIR=$(dirname "$0")
+if [ $(dirname "$TEST_SUBDIR") = "." ] ; then
+    TEST_SUBDIR=$(cd "$TEST_SUBDIR" ; pwd)
+fi
 
 CTDB_DIR=$(dirname $(dirname "$TEST_SUBDIR"))
 
index 5efe6e41475ab84344bab85fd872fca7446c99a6..2fc69799610ce6d13e47224d995a3fe7962c27e6 100755 (executable)
@@ -168,10 +168,6 @@ run_one_test ()
 
 for f ; do
     if [ -d "$f" ] ; then
-       # This expands the most probable problem cases like "." and "..".
-       if [ $(dirname "$f") = "." ] ; then
-           f=$(cd "$f" ; pwd)
-       fi
        for i in $(ls "${f%/}/"*".sh" 2>/dev/null) ; do
            run_one_test "$i"
        done