# Readlink tests.
# Copyright 2006 by Natanael Copa <n@tanael.org>
-# Licensed under GPL v2, see file LICENSE for details.
+# Licensed under GPLv2, see file LICENSE in this source tree.
-. testing.sh
+. ./testing.sh
TESTDIR=readlink_testdir
TESTFILE="$TESTDIR/testfile"
testing "readlink on a file" "readlink ./$TESTFILE" "" "" ""
testing "readlink on a link" "readlink ./$TESTLINK" "./$TESTFILE\n" "" ""
+
+optional FEATURE_READLINK_FOLLOW
+
testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$PWD/$TESTFILE\n" "" ""
testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$PWD/$TESTFILE\n" "" ""
testing "readlink -f on an invalid link" "readlink -f ./$FAILLINK" "" "" ""
# clean up
-rm -r "$TESTLINK" "$TESTDIR"
+rm -r "$TESTLINK" "$TESTDIR"
+exit $((FAILCOUNT <= 255 ? FAILCOUNT : 255))