[PATCH 0/2] use AM_TESTS_ENVIRONMENT Automake variable

2016-05-21 Thread Mathieu Lirzin
Hello,

Since 2011 Automake TESTS_ENVIRONMENT variable is reserved for the
user unless the “older (and discouraged) serial test harness” is used.
See:

  
https://www.gnu.org/software/automake/manual/automake.html#index-AM_005fTESTS_005fENVIRONMENT

The first patch makes use of the new AM_TESTS_ENVIRONMENT
developer-reserved variable, and the second one adds a ‘syntax-check’
to ensure no rule to preach the good news!  ;)

Thanks,

Mathieu Lirzin (2):
  prefer AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT
  maint.mk: prohibit user reserved make flags

 ChangeLog | 37 +++
 Makefile  |  6 ++---
 doc/gnulib.texi   |  6 ++---
 doc/valgrind-tests.texi   |  6 ++---
 gnulib-tool   |  4 ++--
 modules/acl-tests |  2 +-
 modules/btowc-tests   |  2 +-
 modules/c-snprintf-tests  |  2 +-
 modules/c-stack-tests |  2 +-
 modules/c-strcase-tests   |  2 +-
 modules/c-vasprintf-tests |  2 +-
 modules/c-vsnprintf-tests |  2 +-
 modules/c-xvasprintf-tests|  2 +-
 modules/copy-file-tests   |  2 +-
 modules/file-has-acl-tests|  2 +-
 modules/localcharset  |  2 +-
 modules/mbmemcasecmp-tests|  2 +-
 modules/mbmemcasecoll-tests   |  2 +-
 modules/mbrtowc-tests |  2 +-
 modules/mbscasecmp-tests  |  2 +-
 modules/mbscasestr-tests  |  2 +-
 modules/mbschr-tests  |  2 +-
 modules/mbscspn-tests |  2 +-
 modules/mbsinit-tests |  2 +-
 modules/mbsncasecmp-tests |  2 +-
 modules/mbsnrtowcs-tests  |  2 +-
 modules/mbspbrk-tests |  2 +-
 modules/mbspcasecmp-tests |  2 +-
 modules/mbsrchr-tests |  2 +-
 modules/mbsrtowcs-tests   |  2 +-
 modules/mbsspn-tests  |  2 +-
 modules/mbsstr-tests  |  2 +-
 modules/nl_langinfo-tests |  2 +-
 modules/quotearg-tests|  2 +-
 modules/setlocale-tests   |  2 +-
 modules/unicase/locale-language-tests |  2 +-
 modules/unicase/ulc-casecmp-tests |  2 +-
 modules/unicase/ulc-casecoll-tests|  2 +-
 modules/unigbrk/ulc-grapheme-breaks-tests |  2 +-
 modules/unistdio/u16-vasnprintf-tests |  2 +-
 modules/unistdio/u32-vasnprintf-tests |  2 +-
 modules/unistdio/u8-vasnprintf-tests  |  2 +-
 modules/unistdio/ulc-vasnprintf-tests |  2 +-
 modules/uniwbrk/ulc-wordbreaks-tests  |  2 +-
 modules/update-copyright-tests|  2 +-
 modules/vasnprintf-posix-tests|  2 +-
 modules/vc-list-files-tests   |  2 +-
 modules/verify-tests  |  2 +-
 modules/wcrtomb-tests |  2 +-
 modules/wcsnrtombs-tests  |  2 +-
 modules/wcsrtombs-tests   |  2 +-
 tests/havelib/Makefile.am | 15 ++---
 tests/init.sh |  6 ++---
 top/maint.mk  |  8 +++
 54 files changed, 112 insertions(+), 68 deletions(-)

-- 
2.8.1




[PATCH 1/2] prefer AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT

2016-05-21 Thread Mathieu Lirzin
* Makefile, doc/gnulib.texi, doc/valgrind-tests.texi:
* gnulib-tool, modules/acl-tests, modules/btowc-tests:
* modules/c-snprintf-tests, modules/c-stack-tests:
* modules/c-strcase-tests, modules/c-vasprintf-tests:
* modules/c-vsnprintf-tests, modules/c-xvasprintf-tests:
* modules/copy-file-tests, modules/file-has-acl-tests:
* modules/localcharset, modules/mbmemcasecmp-tests:
* modules/mbmemcasecoll-tests, modules/mbrtowc-tests:
* modules/mbscasecmp-tests, modules/mbscasestr-tests:
* modules/mbschr-tests, modules/mbscspn-tests:
* modules/mbsinit-tests, modules/mbsncasecmp-tests:
* modules/mbsnrtowcs-tests, modules/mbspbrk-tests:
* modules/mbspcasecmp-tests, modules/mbsrchr-tests:
* modules/mbsrtowcs-tests, modules/mbsspn-tests, modules/mbsstr-tests:
* modules/nl_langinfo-tests, modules/quotearg-tests:
* modules/setlocale-tests, modules/unicase/locale-language-tests:
* modules/unicase/ulc-casecmp-tests
* modules/unicase/ulc-casecoll-tests:
* modules/unigbrk/ulc-grapheme-breaks-tests:
* modules/unistdio/u16-vasnprintf-tests:
* modules/unistdio/u32-vasnprintf-tests:
* modules/unistdio/u8-vasnprintf-tests:
* modules/unistdio/ulc-vasnprintf-tests:
* modules/uniwbrk/ulc-wordbreaks-tests, modules/update-copyright-tests:
* modules/vasnprintf-posix-tests, modules/vc-list-files-tests:
* modules/verify-tests, modules/wcrtomb-tests
* modules/wcsnrtombs-tests, modules/wcsrtombs-tests:
* tests/havelib/Makefile.am, tests/init.sh: Prefer
AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT since the latter is
reserved for the user.
---
 ChangeLog | 34 +++
 Makefile  |  6 +++---
 doc/gnulib.texi   |  6 +++---
 doc/valgrind-tests.texi   |  6 +++---
 gnulib-tool   |  4 ++--
 modules/acl-tests |  2 +-
 modules/btowc-tests   |  2 +-
 modules/c-snprintf-tests  |  2 +-
 modules/c-stack-tests |  2 +-
 modules/c-strcase-tests   |  2 +-
 modules/c-vasprintf-tests |  2 +-
 modules/c-vsnprintf-tests |  2 +-
 modules/c-xvasprintf-tests|  2 +-
 modules/copy-file-tests   |  2 +-
 modules/file-has-acl-tests|  2 +-
 modules/localcharset  |  2 +-
 modules/mbmemcasecmp-tests|  2 +-
 modules/mbmemcasecoll-tests   |  2 +-
 modules/mbrtowc-tests |  2 +-
 modules/mbscasecmp-tests  |  2 +-
 modules/mbscasestr-tests  |  2 +-
 modules/mbschr-tests  |  2 +-
 modules/mbscspn-tests |  2 +-
 modules/mbsinit-tests |  2 +-
 modules/mbsncasecmp-tests |  2 +-
 modules/mbsnrtowcs-tests  |  2 +-
 modules/mbspbrk-tests |  2 +-
 modules/mbspcasecmp-tests |  2 +-
 modules/mbsrchr-tests |  2 +-
 modules/mbsrtowcs-tests   |  2 +-
 modules/mbsspn-tests  |  2 +-
 modules/mbsstr-tests  |  2 +-
 modules/nl_langinfo-tests |  2 +-
 modules/quotearg-tests|  2 +-
 modules/setlocale-tests   |  2 +-
 modules/unicase/locale-language-tests |  2 +-
 modules/unicase/ulc-casecmp-tests |  2 +-
 modules/unicase/ulc-casecoll-tests|  2 +-
 modules/unigbrk/ulc-grapheme-breaks-tests |  2 +-
 modules/unistdio/u16-vasnprintf-tests |  2 +-
 modules/unistdio/u32-vasnprintf-tests |  2 +-
 modules/unistdio/u8-vasnprintf-tests  |  2 +-
 modules/unistdio/ulc-vasnprintf-tests |  2 +-
 modules/uniwbrk/ulc-wordbreaks-tests  |  2 +-
 modules/update-copyright-tests|  2 +-
 modules/vasnprintf-posix-tests|  2 +-
 modules/vc-list-files-tests   |  2 +-
 modules/verify-tests  |  2 +-
 modules/wcrtomb-tests |  2 +-
 modules/wcsnrtombs-tests  |  2 +-
 modules/wcsrtombs-tests   |  2 +-
 tests/havelib/Makefile.am | 15 +++---
 tests/init.sh |  6 +++---
 53 files changed, 101 insertions(+), 68 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f4bc50f..e324133 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2016-05-21  Mathieu Lirzin  
+
+   prefer AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT
+   * Makefile, doc/gnulib.texi, doc/valgrind-tests.texi:
+   * gnulib-tool, modules/acl-tests, modules/btowc-tests:
+   * modules/c-snprintf-tests, modules/c-stack-tests:
+   * modules/c-strcase-tests, modules/c-vasprintf-tests:
+   * modules/c-vsnprintf-tests, modules/c-xvasprintf-tests:
+   * modules/copy-file-tests, modules/file-has-acl-tests:
+   * modules/localcharset, modules/mbmemcasecmp-tests:
+   * m

[PATCH 2/2] maint.mk: prohibit user reserved make flags

2016-05-21 Thread Mathieu Lirzin
* top/maint.mk (sc_makefile_user_flags_check): New rule.
---
 ChangeLog| 3 +++
 top/maint.mk | 8 
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e324133..3721fff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-05-21  Mathieu Lirzin  
 
+   maint.mk: prohibit user reserved make flags when using Automake
+   * top/maint.mk (sc_makefile_user_flags_check): New rule.
+
prefer AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT
* Makefile, doc/gnulib.texi, doc/valgrind-tests.texi:
* gnulib-tool, modules/acl-tests, modules/btowc-tests:
diff --git a/top/maint.mk b/top/maint.mk
index aa23364..21662ce 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1164,6 +1164,14 @@ sc_makefile_path_separator_check:
halt=$(msg) \
  $(_sc_search_regexp)
 
+# Verify that no make flags reserved for the user are present.
+msg = 'Do not set make flags reserved for the user'
+sc_makefile_user_flags_check:
+   @prohibit='^[^_]*(FLAGS|TESTS_ENVIRONMENT)' \
+   in_vc_files='akefile|\.mk$$'\
+   halt=$(msg) \
+ $(_sc_search_regexp)
+
 # Check that 'make alpha' will not fail at the end of the process,
 # i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release)
 # and is read-only.
-- 
2.8.1