Merge branch 'maint'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 1 Jul 2012 08:14:23 +0000 (10:14 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 1 Jul 2012 08:14:23 +0000 (10:14 +0200)
* maint:
  parallel-tests: silence an overly verbose recipe
  tests: fix some uses of 'Exit', where 'exit' should now be used instead
  maintcheck: test scripts should be executable, check for that

1  2 
Makefile.am
lib/am/check.am
syntax-checks.mk

diff --combined Makefile.am
@@@ -261,12 -261,14 +261,12 @@@ dist_automake_ac_DATA = 
    m4/ar-lib.m4 \
    m4/as.m4 \
    m4/auxdir.m4 \
 -  m4/ccstdc.m4 \
    m4/cond.m4 \
    m4/cond-if.m4 \
    m4/depend.m4 \
    m4/depout.m4 \
    m4/dmalloc.m4 \
    m4/gcj.m4 \
 -  m4/header.m4 \
    m4/init.m4 \
    m4/install-sh.m4 \
    m4/lead-dot.m4 \
    m4/make.m4 \
    m4/minuso.m4 \
    m4/missing.m4 \
 -  m4/mkdirp.m4 \
 -  m4/obsol-gt.m4 \
 -  m4/obsol-lt.m4 \
 -  m4/obsolete.m4 \
    m4/options.m4 \
    m4/protos.m4 \
    m4/python.m4 \
@@@ -607,11 -613,6 +607,6 @@@ ChangeLog: am--changelog-regen-hoo
          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.  ##
diff --combined lib/am/check.am
@@@ -46,7 -46,7 +46,7 @@@ endif !%?COLOR
  
  .PHONY: check-TESTS
  
 -if %?PARALLEL_TESTS%
 +if !%?SERIAL_TESTS%
  
  include inst-vars.am
  
@@@ -397,8 -397,8 +397,8 @@@ RECHECK_LOGS = $(TEST_LOGS
  ## ------------------------------------------ ##
  
  check-TESTS:
-       list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
-       list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+       @list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+       @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
  ## We always have to remove $(TEST_SUITE_LOG), to ensure its rule is run
  ## in any case even in lazy mode: otherwise, if no test needs rerunning,
  ## or a prior run plus reruns all happen within the same timestamp (can
@@@ -471,9 -471,7 +471,9 @@@ AM_RECURSIVE_TARGETS += check rechec
  
  .PHONY: recheck
  
 -else !%?PARALLEL_TESTS%
 +else %?SERIAL_TESTS%
 +
 +## Obsolescent serial testsuite driver.
  
  check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; \
          test "$$failed" -eq 0; \
        else :; fi
  
 -endif !%?PARALLEL_TESTS%
 +endif %?SERIAL_TESTS%
diff --combined syntax-checks.mk
@@@ -39,6 -39,7 +39,6 @@@ ams := $(shell find $(srcdir) -name '*.
  # guaranteed to work on my machine.
  syntax_check_rules = \
  $(sc_tests_plain_check_rules) \
 -sc_test_names \
  sc_diff_automake_in_automake \
  sc_diff_aclocal_in_automake \
  sc_perl_syntax \
@@@ -55,7 -56,6 +55,7 @@@ sc_perl_at_uscore_in_scalar_context 
  sc_perl_local \
  sc_AMDEP_TRUE_in_automake_in \
  sc_tests_make_without_am_makeflags \
 +$(sc_obsolete_requirements_rules) \
  sc_tests_obsolete_variables \
  sc_tests_here_document_format \
  sc_tests_command_subst \
@@@ -65,6 -65,7 +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 \
@@@ -75,6 -76,69 +76,6 @@@ sc_unquoted_DESTDIR 
  sc_tabs_in_texi \
  sc_at_in_texi
  
 -## Look for test whose names can cause spurious failures when used as
 -## first argument to AC_INIT (chiefly because they might contain an
 -## m4/m4sugar builtin or macro name).
 -m4_builtins = \
 -  __gnu__ \
 -  __unix__ \
 -  bpatsubst \
 -  bregexp \
 -  builtin \
 -  changecom \
 -  changequote \
 -  changeword \
 -  debugfile \
 -  debugmode \
 -  decr \
 -  define \
 -  defn \
 -  divert \
 -  divnum \
 -  dnl \
 -  dumpdef \
 -  errprint \
 -  esyscmd \
 -  eval \
 -  format \
 -  ifdef \
 -  ifelse \
 -  include \
 -  incr \
 -  index \
 -  indir \
 -  len \
 -  m4exit \
 -  m4wrap \
 -  maketemp \
 -  mkstemp \
 -  patsubst \
 -  popdef \
 -  pushdef \
 -  regexp \
 -  shift \
 -  sinclude \
 -  substr \
 -  symbols \
 -  syscmd \
 -  sysval \
 -  traceoff \
 -  traceon \
 -  translit \
 -  undefine \
 -  undivert
 -sc_test_names:
 -      @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
 -       m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
 -       if { \
 -         for t in $(xtests); do echo $$t; done \
 -           | LC_ALL=C grep -E "$$m4_macro_rx"; \
 -       }; then \
 -         echo "the names of the tests above can be problematic" 1>&2; \
 -         echo "Avoid test names that contain names of m4 macros" 1>&2; \
 -         exit 1; \
 -       fi
 -
  ## These check avoids accidental configure substitutions in the source.
  ## There are exactly 9 lines that should be modified from automake.in to
  ## automake, and 10 lines that should be modified from aclocal.in to
@@@ -239,19 -303,6 +240,19 @@@ sc_tests_obsolete_variables
          exit 1; \
        else :; fi
  
 +## Look out for obsolete requirements specified in the test cases.
 +sc_obsolete_requirements_rules = sc_no_texi2dvi-o sc_no_makeinfo-html
 +modern-requirement.texi2dvi-o = texi2dvi
 +modern-requirement.makeinfo-html = makeinfo
 +
 +$(sc_obsolete_requirements_rules): sc_no_% :
 +      @if grep -E 'required=.*\b$*\b' $(xtests); then \
 +        echo "Requirement '$*' is obsolete and shouldn't" \
 +             "be used anymore." >&2; \
 +        echo "You should use '$(modern-requirement.$*)' instead." >&2; \
 +        exit 1; \
 +      fi
 +
  ## Tests should never call some programs directly, but only through the
  ## corresponding variable (e.g., '$MAKE', not 'make').  This will allow
  ## the programs to be overridden at configure time (for less brittleness)
@@@ -396,6 -447,19 +397,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.