+build_symlinks() {
+ fromdir="$scratchdir/from"
+ todir="$scratchdir/to"
+ mkdir "$fromdir"
+ date >"$fromdir/referent"
+ ln -s referent "$fromdir/relative"
+ ln -s "$fromdir/referent" "$fromdir/absolute"
+ ln -s nonexistent "$fromdir/dangling"
+ ln -s "$srcdir/rsync.c" "$fromdir/unsafe"
+}
+
+test_fail() {
+ echo "$@" >&2
+ exit 1
+}
+
+test_skipped() {
+ echo "$@" >&2
+ exit 77
+}
+
+# It failed, but we expected that. don't dump out error logs,
+# because most users won't want to see them. But do leave
+# the working directory around.
+test_xfail() {
+ echo "$@" >&2
+ exit 78
+}
+
+# Test whether something is a link, allowing for shell peculiarities
+is_a_link() {
+ test -L "$1" || test -h "$1" || /usr/bin/test -L "$1" || /usr/bin/test -h "$1"
+}
+
+# be reproducible
+umask 077
\ No newline at end of file