summary refs log tree commit diff
path: root/posix/globtest.sh
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-08-09 17:40:23 +0000
committerUlrich Drepper <drepper@redhat.com>2001-08-09 17:40:23 +0000
commit748945b3f6f17d3937c8e9e40fedcec1126ba782 (patch)
tree1faf4c237c0ac8f7fde0339806cd25bc36d14cd8 /posix/globtest.sh
parentd4459f83de18527316eca4c5ad773380cbf13c09 (diff)
downloadglibc-748945b3f6f17d3937c8e9e40fedcec1126ba782.tar.gz
glibc-748945b3f6f17d3937c8e9e40fedcec1126ba782.tar.xz
glibc-748945b3f6f17d3937c8e9e40fedcec1126ba782.zip
Robustify tilde tests.
Diffstat (limited to 'posix/globtest.sh')
-rwxr-xr-xposix/globtest.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/posix/globtest.sh b/posix/globtest.sh
index 92f3e3c488..678a6d9b1a 100755
--- a/posix/globtest.sh
+++ b/posix/globtest.sh
@@ -324,8 +324,12 @@ ${common_objpfx}posix/globtest -q -t "$testdir" "~" |
 sort >$testout
 echo ~ | cmp - $testout >> $logfile || failed=1
 if test $failed -ne 0; then
-  echo "Tilde test failed" >> $logfile
-  result=1
+  if test -d ~; then
+    echo "Tilde test failed" >> $logfile
+    result=1
+  else
+    echo "Tilde test could not be run" >> $logfile
+  fi
 fi
 
 # Test tilde expansion with trailing slash
@@ -340,8 +344,12 @@ else
     echo ~/ | cmp - $testout >> $logfile || failed=1
 fi
 if test $failed -ne 0; then
-  echo "Tilde2 test failed" >> $logfile
-  result=1
+  if test -d ~/; then
+    echo "Tilde2 test failed" >> $logfile
+    result=1
+  else
+    echo "Tilde2 test could not be run" >> $logfile
+  fi
 fi
 
 # Test tilde expansion with username
@@ -351,8 +359,12 @@ ${common_objpfx}posix/globtest -q -t "$testdir" "~"$USER |
 sort > $testout
 eval echo ~$USER | cmp - $testout >> $logfile || failed=1
 if test $failed -ne 0; then
-  echo "Tilde3 test failed" >> $logfile
-  result=1
+  if eval test -d ~$USER; then
+    echo "Tilde3 test failed" >> $logfile
+    result=1
+  else
+    echo "Tilde3 test could not be run" >> $logfile
+  fi
 fi
 
 # Tilde expansion shouldn't match a file