canonicalize: allow cross-testing from cygwin to mingw
authorEric Blake <ebb9@byu.net>
Mon, 31 Aug 2009 15:12:30 +0000 (09:12 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 1 Sep 2009 01:19:53 +0000 (19:19 -0600)
* modules/canonicalize-tests (configure.ac): Define HAVE_SYMLINK.
(Makefile.am): Pass it through TESTS_ENVIRONMENT.
* modules/canonicalize-lgpl-tests (configure.ac, Makefile.am):
Likewise.
* tests/test-canonicalize.sh: Also skip test if 'ln -s' works, but
target does not support symlinks.
* tests/test-canonicalize-lgpl.sh: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
modules/canonicalize-lgpl-tests
modules/canonicalize-tests
tests/test-canonicalize-lgpl.sh
tests/test-canonicalize.sh

index 2998bb7..f8745fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-08-31  Eric Blake  <ebb9@byu.net>
 
+       canonicalize: allow cross-testing from cygwin to mingw
+       * modules/canonicalize-tests (configure.ac): Define HAVE_SYMLINK.
+       (Makefile.am): Pass it through TESTS_ENVIRONMENT.
+       * modules/canonicalize-lgpl-tests (configure.ac, Makefile.am):
+       Likewise.
+       * tests/test-canonicalize.sh: Also skip test if 'ln -s' works, but
+       target does not support symlinks.
+       * tests/test-canonicalize-lgpl.sh: Likewise.
+
        chown: avoid compilation warning on mingw
        * m4/chown.m4 (gl_FUNC_CHOWN): Recognize missing chown.
        * lib/chown.c (rpl_chown) [!HAVE_CHOWN]: Always return failure on
index 5028ee7..ac40166 100644 (file)
@@ -5,9 +5,12 @@ tests/test-canonicalize-lgpl.c
 Depends-on:
 
 configure.ac:
+AC_CHECK_FUNCS_ONCE([symlink])
+HAVE_SYMLINK=$ac_cv_func_symlink
+AC_SUBST([HAVE_SYMLINK])
 
 Makefile.am:
 TESTS += test-canonicalize-lgpl.sh
-TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@'
+TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' HAVE_SYMLINK='$(HAVE_SYMLINK)'
 check_PROGRAMS += test-canonicalize-lgpl
 test_canonicalize_lgpl_LDADD = $(LDADD)
index 875984e..e8dfec7 100644 (file)
@@ -5,9 +5,12 @@ tests/test-canonicalize.c
 Depends-on:
 
 configure.ac:
+AC_CHECK_FUNCS_ONCE([symlink])
+HAVE_SYMLINK=$ac_cv_func_symlink
+AC_SUBST([HAVE_SYMLINK])
 
 Makefile.am:
 TESTS += test-canonicalize.sh
-TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@'
+TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' HAVE_SYMLINK='$(HAVE_SYMLINK)'
 check_PROGRAMS += test-canonicalize
 test_canonicalize_LDADD = $(LDADD) @LIBINTL@
index 54d30b7..e439b7a 100755 (executable)
@@ -5,7 +5,8 @@ trap 'rm -fr $tmpfiles' 1 2 3 15
 
 tmpfiles="$tmpfiles t-can-lgpl.tmp ise"
 mkdir t-can-lgpl.tmp
-ln -s t-can-lgpl.tmp/ket ise \
+test "x$HAVE_SYMLINK" = xyes \
+  && ln -s t-can-lgpl.tmp/ket ise \
   || { echo "Skipping test: symbolic links not supported on this filesystem"
        rm -fr $tmpfiles
        exit 77
index 0ef91f3..a4ab962 100755 (executable)
@@ -5,7 +5,8 @@ trap 'rm -fr $tmpfiles' 1 2 3 15
 
 tmpfiles="$tmpfiles t-can.tmp ise"
 mkdir t-can.tmp
-ln -s t-can.tmp/ket ise \
+test "x$HAVE_SYMLINK" = xyes \
+  && ln -s t-can.tmp/ket ise \
   || { echo "Skipping test: symbolic links not supported on this filesystem"
        rm -fr $tmpfiles
        exit 77