From: Eric Blake Date: Mon, 31 Aug 2009 15:12:30 +0000 (-0600) Subject: canonicalize: allow cross-testing from cygwin to mingw X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a01c968e6d045385bb27857eacc9100c4bb829a9;p=pspp 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. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 2998bb7c71..f8745fea13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2009-08-31 Eric Blake + 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 diff --git a/modules/canonicalize-lgpl-tests b/modules/canonicalize-lgpl-tests index 5028ee7e6b..ac40166d45 100644 --- a/modules/canonicalize-lgpl-tests +++ b/modules/canonicalize-lgpl-tests @@ -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) diff --git a/modules/canonicalize-tests b/modules/canonicalize-tests index 875984e108..e8dfec7204 100644 --- a/modules/canonicalize-tests +++ b/modules/canonicalize-tests @@ -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@ diff --git a/tests/test-canonicalize-lgpl.sh b/tests/test-canonicalize-lgpl.sh index 54d30b737c..e439b7a151 100755 --- a/tests/test-canonicalize-lgpl.sh +++ b/tests/test-canonicalize-lgpl.sh @@ -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 diff --git a/tests/test-canonicalize.sh b/tests/test-canonicalize.sh index 0ef91f308e..a4ab9626f4 100755 --- a/tests/test-canonicalize.sh +++ b/tests/test-canonicalize.sh @@ -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