summaryrefslogtreecommitdiff
path: root/tests/misc
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-02-12 01:20:20 +0100
committerJim Meyering <jim@meyering.net>2007-02-12 01:20:20 +0100
commite152d05d8211444850e83e4e403a510f00f55027 (patch)
tree2a89fc5a9678a9c94c0f956898a73d9b95b03859 /tests/misc
parenta09b04794795b79164b83276f6be82d48e733e73 (diff)
downloadcoreutils-e152d05d8211444850e83e4e403a510f00f55027.tar.xz
* tests/misc/pwd-unreadable-parent: Skip the test if we're
definitely using the replacement. * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
Diffstat (limited to 'tests/misc')
-rw-r--r--tests/misc/Makefile.am1
-rwxr-xr-xtests/misc/pwd-unreadable-parent15
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 145afbe0c..425d6e368 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -28,6 +28,7 @@ TESTS_ENVIRONMENT = \
BUILD_SRC_DIR="`pwd`/../../src" \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \
+ CONFIG_HEADER=$(CONFIG_HEADER) \
PROG=`../../src/basename -- "$$tst"`
# Do not choose a name that is a shell keyword like 'if', or a
diff --git a/tests/misc/pwd-unreadable-parent b/tests/misc/pwd-unreadable-parent
index f84627ec4..35d4f1816 100755
--- a/tests/misc/pwd-unreadable-parent
+++ b/tests/misc/pwd-unreadable-parent
@@ -26,6 +26,21 @@ if test "$VERBOSE" = yes; then
readlink --version
fi
+skip=1
+# Run this test IFF:
+# if __GETCWD_PREFIX is not defined (system getcwd is good enough)
+# or HAVE_PARTLY_WORKING_GETCWD is defined
+grep '^/\* #undef __GETCWD_PREFIX ' $CONFIG_HEADER > /dev/null &&
+ skip=0
+test $skip = 1 &&
+ grep '^#define HAVE_PARTLY_WORKING_GETCWD ' $CONFIG_HEADER > /dev/null &&
+ skip=0
+test $skip = 1 &&
+ {
+ echo 1>&2 "$0: inadequate system getcwd; skipping this test"
+ (exit 77); exit 77
+ }
+
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0