Move var declaration for older C compilers.
[rsync.git] / runtests.sh
index a4d7141b7f71a70fcbfb6aa0119584a1685e5335..43732cead91bdaa9368baf119f9ed9f0ae3878df 100755 (executable)
@@ -155,10 +155,10 @@ RSYNC="$rsync_bin $*"
 #RSYNC="valgrind $rsync_bin $*"
 
 TLS_ARGS=''
-if egrep '^#define HAVE_UTIMES 1' "$srcdir/config.h" >/dev/null; then
+if egrep '^#define HAVE_LUTIMES 1' config.h >/dev/null; then
     TLS_ARGS="$TLS_ARGS -l"
 fi
-if egrep '#undef CHOWN_MODIFIES_SYMLINK' "$srcdir/config.h" >/dev/null; then
+if egrep '#undef CHOWN_MODIFIES_SYMLINK' config.h >/dev/null; then
     TLS_ARGS="$TLS_ARGS -L"
 fi
 
@@ -229,8 +229,9 @@ echo "    scratchbase=$scratchbase"
 [ -d "$scratchbase" ] || mkdir "$scratchbase"
 
 suitedir="$srcdir/testsuite"
+TESTRUN_TIMEOUT=300
 
-export scratchdir suitedir
+export scratchdir suitedir TESTRUN_TIMEOUT
 
 prep_scratch() {
     [ -d "$scratchdir" ] && chmod -R u+rwX "$scratchdir" && rm -rf "$scratchdir"
@@ -238,7 +239,10 @@ prep_scratch() {
     # Get rid of default ACLs and dir-setgid to avoid confusing some tests.
     $setfacl_nodef "$scratchdir" || true
     chmod g-s "$scratchdir"
-    ln -s "$srcdir" "$scratchdir/src"
+    case "$srcdir" in
+    /*) ln -s "$srcdir" "$scratchdir/src" ;;
+    *)  ln -s "$TOOLDIR/$srcdir" "$scratchdir/src" ;;
+    esac
     return 0
 }
 
@@ -258,8 +262,13 @@ do
 
     prep_scratch
 
+    case "$testscript" in
+    *hardlinks*) TESTRUN_TIMEOUT=600 ;;
+    *) TESTRUN_TIMEOUT=300 ;;
+    esac
+
     set +e
-    sh $RUNSHFLAGS "$testscript" >"$scratchdir/test.log" 2>&1
+    "$TOOLDIR/"testrun $RUNSHFLAGS "$testscript" >"$scratchdir/test.log" 2>&1
     result=$?
     set -e