maintcheck: test scripts should be executable, check for that
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 30 Jun 2012 21:26:17 +0000 (23:26 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 30 Jun 2012 21:31:26 +0000 (23:31 +0200)
* syntax-checks.mk (sc_tests_executable): Here, in this new check.
(syntax_check_rules): Add it.
* Makefile.am (dist-hook): Drop, no need to make test cases executable
anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Makefile.am
syntax-checks.mk

index 9d58155..b745721 100644 (file)
@@ -613,11 +613,6 @@ ChangeLog: am--changelog-regen-hook
          exit 1; \
        fi
 
-# Ensure tests are world-executable.
-# FIXME: this should be turned into a maintainer check...
-dist-hook:
-       $(am__cd) $(distdir)/t && chmod a+rx *.sh *.tap
-
 
 ## --------------------------- ##
 ##  Perl coverage statistics.  ##
index 3bbc4da..3b20911 100644 (file)
@@ -65,6 +65,7 @@ sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
 sc_tests_ls_t \
+sc_tests_executable \
 sc_m4_am_plain_egrep_fgrep \
 sc_tests_no_configure_in \
 sc_tests_PATH_SEPARATOR \
@@ -446,6 +447,19 @@ sc_tests_ls_t:
          exit 1; \
        fi
 
+## Test scripts must be executable.
+sc_tests_executable:
+       @st=0; \
+       for f in $(xtests); do \
+         case $$f in \
+           t/ax/*|./t/ax/*|$(srcdir)/t/ax/*);; \
+           *) test -x $$f || { echo "$$f: not executable" >&2; st=1; }; \
+         esac; \
+       done; \
+       test $$st -eq 0 || echo '$@: some test scripts are not executable' >&2; \
+       exit $$st;
+
+
 ## Never use 'sleep 1' to create files with different timestamps.
 ## Use '$sleep' instead.  Some filesystems (e.g., Windows) have only
 ## a 2sec resolution.