summaryrefslogtreecommitdiff
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
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.
-rw-r--r--ChangeLog6
-rw-r--r--tests/misc/Makefile.am1
-rwxr-xr-xtests/misc/pwd-unreadable-parent15
3 files changed, 22 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f0b7712ab..a2f6376d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-02-12 Jim Meyering <jim@meyering.net>
+
+ * tests/misc/pwd-unreadable-parent: Skip the test if we're
+ definitely using the replacement.
+ * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
+
2007-02-10 Jim Meyering <jim@meyering.net>
Remove excess leading spaces that would make help2man misbehave.
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