]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: move all under the same hierarchy ('tests/' directory)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 18 Jan 2012 11:17:11 +0000 (12:17 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 18 Jan 2012 12:31:55 +0000 (13:31 +0100)
This simplifies the organization of the Automake source tree and
reduces the (lamentably high) number of Makefiles in the Automake
build system by one.  It also makes the maintainer check that
verifies the consistency of list of tests more self-contained and
simpler.  Finally, it might be a first step forward the transition
to a non-recursive build system for automake (if we ever decide to
go down that road fully some day).

* lib/Automake/tests: All the '*.pl' tests in here moved ...
* tests/pm: ... into this new directory.
* lib/Automake/tests/Makefile.am: Remove, its meaningful
contents moved ...
* tests/Makefile.am: ... here, with obvious adjustments.
(test_subdirs): New variable, for the sake of the recipe
of 'maintainer-check-list-of-tests'.
* CheckListOfTests (maintainer-check-list-of-tests): Enhance
its recipe to make it able to deal with test script residing
in subdirectories.
* Makefile.am (maintainer-check-list-of-tests): Simplified.
(TEST_SUBDIRS): Remove, no more needed.
* tests/list-of-tests.mk (perl_TESTS): New variable, lists
the '.pl' tests just moved into 'tests/pm'.
(handwritten_TESTS): Add the contents of '$(perl_TESTS)'.
* lib/Automake/Makefile.am (SUBDIRS): Remove.
* configure.ac (AC_CONFIG_FILES): Update.
* .gitignore: Adjust.

14 files changed:
.gitignore
CheckListOfTests.am
Makefile.am
configure.ac
lib/Automake/Makefile.am
lib/Automake/tests/Makefile.am [deleted file]
tests/Makefile.am
tests/list-of-tests.mk
tests/pm/Condition-t.pl [moved from lib/Automake/tests/Condition-t.pl with 100% similarity]
tests/pm/Condition.pl [moved from lib/Automake/tests/Condition.pl with 100% similarity]
tests/pm/DisjConditions-t.pl [moved from lib/Automake/tests/DisjConditions-t.pl with 100% similarity]
tests/pm/DisjConditions.pl [moved from lib/Automake/tests/DisjConditions.pl with 100% similarity]
tests/pm/Version.pl [moved from lib/Automake/tests/Version.pl with 100% similarity]
tests/pm/Wrap.pl [moved from lib/Automake/tests/Wrap.pl with 100% similarity]

index 33e3827fc13e00138737f958bc5b7bc1a22b7250..f21915354671c1f3a28937763093dd520a7a208d 100644 (file)
@@ -47,10 +47,10 @@ Makefile
 /doc/amhello/install-sh
 /doc/amhello/missing
 /lib/Automake/Config.pm
-/lib/Automake/tests/*.log
-/lib/Automake/tests/*.log-t
 /tests/*.log
 /tests/*.log-t
+/tests/pm/*.log
+/tests/pm/*.log-t
 /tests/*.dir
 /tests/*-p.test
 /tests/aclocal-1.*
index 0a484470e9f0946b1e313cd9425d9130d5d68fec..c71c7fc0d322f7fd8af5df5b6600483c77608cf1 100644 (file)
@@ -37,13 +37,18 @@ maintainer-check-list-of-tests:
         for t in $$lst; do \
           echo "$$t"; \
         done | sort >$(am__tmk); \
+## List of subdirs where to look for tests.
+        dirs='$(test_subdirs)'; \
+        test -n "$$dirs" || dirs=.; \
 ## List of tests on filesystem.  Be careful to cater for VPATH builds too.
         for ext in $(TEST_EXTENSIONS); do \
-          ls *$$ext 2>/dev/null; \
-          if test $(srcdir) != $(builddir); then \
-            (cd $(srcdir) && ls *$$ext 2>/dev/null); \
-          fi; \
-        done | sort | uniq >$(am__tfs); \
+          for dir in $$dirs; do \
+            ls $$dir/*$$ext 2>/dev/null; \
+            if test $(srcdir) != $(builddir); then \
+              (cd $(srcdir) && ls $$dir/*$$ext 2>/dev/null); \
+            fi; \
+          done; \
+        done | sed 's,^\./,,' | sort | uniq >$(am__tfs); \
 ## Compare the two lists, complain if they differ.
         if $$diff $(am__tmk) $(am__tfs) >$(am__tdf); then \
            result=0; \
index 7ad3b921f0c7a9e62c5553ccd19165c1bec08322..b9166dbaa8aefd5aed7250ff08b5d355f8007830 100644 (file)
@@ -25,8 +25,6 @@
 ## run aclocal and automake.
 SUBDIRS = lib . contrib doc m4 tests
 
-TEST_SUBDIRS = tests lib/Automake/tests
-
 bin_SCRIPTS = automake aclocal
 
 CLEANFILES = $(bin_SCRIPTS)
@@ -203,18 +201,7 @@ maintainer-check: $(syntax_check_rules)
 ## list of all test scripts in the Automake testsuite.
 .PHONY: maintainer-check-list-of-tests
 maintainer-check-list-of-tests:
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       for subdir in $(TEST_SUBDIRS); do \
-         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \
-       done; \
-       test -z "$$fail"
-
+       $(am__cd) tests && $(MAKE) $(AM_MAKEFLAGS) $@
 maintainer-check: maintainer-check-list-of-tests
 
 ## Look for test whose names can cause spurious failures when used as
index bcd28fda632dc5e550740a9f2488f6d51382d2b8..18dbd8aa2be3bd5fb443edf6ed8d85a432bd23c0 100644 (file)
@@ -209,7 +209,6 @@ AC_CONFIG_FILES([
   contrib/Makefile
   doc/Makefile
   lib/Automake/Makefile
-  lib/Automake/tests/Makefile
   lib/Makefile
   lib/am/Makefile
   m4/Makefile
index cfc7272b8d50882f02e1d1a75f286ded6c19e477..9805024622341a3a197533de242198035d7a6b2a 100644 (file)
@@ -1,7 +1,7 @@
 ## Process this file with automake to create Makefile.in
 
-# Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009, 2010, 2012 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
@@ -16,9 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# `make clean check' should build Config.pm first.
-SUBDIRS = . tests
-
 perllibdir = $(pkgvdatadir)/Automake
 dist_perllib_DATA = \
   ChannelDefs.pm \
diff --git a/lib/Automake/tests/Makefile.am b/lib/Automake/tests/Makefile.am
deleted file mode 100644 (file)
index a537fd1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-## Process this file with automake to create Makefile.in
-
-# Copyright (C) 2002, 2003, 2008, 2009, 2012 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-PL_LOG_COMPILER = $(PERL)
-AM_PL_LOG_FLAGS = -Mstrict -I ../.. -I $(top_srcdir)/lib -w
-TEST_EXTENSIONS = .pl
-
-TESTS = \
-Condition.pl \
-Condition-t.pl \
-DisjConditions.pl \
-DisjConditions-t.pl \
-Version.pl \
-Wrap.pl
-
-EXTRA_DIST = $(TESTS)
-
-include $(top_srcdir)/CheckListOfTests.am
index c2daff4fbe1b991d38f05a0fd81d3959dbf67bf8..4939aab972499f3a145d456352c4272d4070bb82 100644 (file)
@@ -52,6 +52,11 @@ TESTS_ENVIRONMENT = \
   test x"$$required" = x || unset required; \
   test x"$$parallel_tests" = x || unset parallel_tests;
 
+TEST_EXTENSIONS = .pl .test
+
+PL_LOG_COMPILER = $(PERL)
+AM_PL_LOG_FLAGS = -Mstrict -I $(top_builddir)/lib -I $(top_srcdir)/lib -w
+
 include $(srcdir)/list-of-tests.mk
 
 TESTS = $(handwritten_TESTS) $(parallel_tests)
@@ -128,6 +133,7 @@ EXTRA_DIST += distcheck-hook-m4.am
 check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 
 ## Checking the list of tests.
+test_subdirs = . pm
 include $(top_srcdir)/CheckListOfTests.am
 maintainer-check-list-of-tests: $(parallel_tests)
 
index 6e4412f5dd11ba2b9e603d797cca1df51784c47c..7585e2bc0b96e7a48721d9d7735877431ad9de1b 100644 (file)
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+perl_TESTS = \
+pm/Condition.pl \
+pm/Condition-t.pl \
+pm/DisjConditions.pl \
+pm/DisjConditions-t.pl \
+pm/Version.pl \
+pm/Wrap.pl
+
 # The order here is mostly alphabetical, with the deliberate exception
 # that tests having a high runtime (especially TAP tests that run various
 # checks sequentially) are listed early; this improves performance on
 # concurrent testsuite runs.
 handwritten_TESTS = \
 get-sysconf.test \
+$(perl_TESTS) \
 self-check-env-sanitize.test \
 self-check-report.test \
 aclibobj.test \
similarity index 100%
rename from lib/Automake/tests/Wrap.pl
rename to tests/pm/Wrap.pl