automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: detect that MSYS lacks symlinks


From: Peter Rosin
Subject: [PATCH] tests: detect that MSYS lacks symlinks
Date: Mon, 09 Jan 2012 12:53:08 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0

Hi!

Another case of ln/cp on MSYS.  The test reported ERROR previously (it
terminated early when it failed to create a broken link with
"ln -s none brokenlink"), with this change, it's 36 PASS / 6 SKIP.

Cheers,
Peter

>From 63aa6177cc67ff43bdc4f68769ac8fc6585e31e9 Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Mon, 9 Jan 2012 12:43:30 +0100
Subject: [PATCH] tests: detect that MSYS lacks symlinks

* tests/self-check-cleanup.tap: Also check if "ln -s" really created a
symlink to cater for MSYS falling back to an ordinary copy.  Also, don't
chmod the symlinks if they were never created.
---
 tests/self-check-cleanup.tap |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/self-check-cleanup.tap b/tests/self-check-cleanup.tap
index d369c9f..e403dde 100755
--- a/tests/self-check-cleanup.tap
+++ b/tests/self-check-cleanup.tap
@@ -33,7 +33,7 @@ cp ../defs .
 
 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 
-if ln -s defs foo; then
+if ln -s defs foo && test -h foo; then
   have_symlinks=yes
 else
   have_symlinks=no
@@ -60,7 +60,8 @@ if test $have_symlinks = yes; then
   ln -s none brokenlink
 fi
 cd ..
-chmod 000 $dir/sub/* $dir/file $dir/symlink
+chmod 000 $dir/sub/* $dir/file
+test $have_symlinks = yes && chmod 000 $dir/symlink
 chmod 000 $dir/sub $dir
 command_ok_ "pre-cleanup can deal with null-perms testdir" \
             $SHELL -c  '. ./defs' dummy.test
@@ -84,7 +85,8 @@ command_ok_ "post-cleanup can deal with null-perms testdir" \
     ln -s none brokenlink
   fi
   cd ..
-  chmod 000 dir/sub/* dir/file dir/symlink
+  chmod 000 dir/sub/* dir/file
+  test $have_symlinks = yes && chmod 000 dir/symlink
   chmod 000 dir/sub dir
   :
 ' dummy.test
-- 
1.7.5.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]