tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / primary-prefix-couples-force-valid.sh
old mode 100755 (executable)
new mode 100644 (file)
index e7ea634..cb2be39
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 # should work.
 
 required=cc
-. ./defs || Exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
@@ -54,7 +54,12 @@ test:
        test -f '$(bindir)/libquux.a'
        ls -l '$(libexecdir)/bar.h'
        test -f '$(libexecdir)/bar.h'
-       test ! -x '$(libexecdir)/bar.h'
+## If this test is run as root, "test -x" could succeed also for
+## non-executable files, so we need to protect the next check.
+## See automake bug#12041.
+       if test -x Makefile; then echo SKIP THIS; else \
+         test ! -x '$(libexecdir)/bar.h'; \
+       fi;
 END
 
 cat > foo.c <<'END'