test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / t / CheckListOfTests.am
blob48ebaa6fbe9c2fce34ae2b25da44e49c144b6cb1
1 ## -*- Automake -*-
2 ##
3 ## Copyright (C) 2011-2024 Free Software Foundation, Inc.
4 ##
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
8 ## any later version.
9 ##
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 ## Temporary files used in the 'check-list-of-tests' recipe.
20 am__tmk = tests-in-makefile-list.tmp
21 am__tfs = tests-on-filesystem-list.tmp
22 am__tdf = diff-in-tests-lists.tmp
24 ## Check that the list of tests given in the Makefile is equal to the
25 ## list of all test scripts in the Automake testsuite.
26 .PHONY: maintainer-check-list-of-tests
27 maintainer-check-list-of-tests:
28 ## Prefer unified diffs over plain diffs, for readability.
29          @if diff -u /dev/null /dev/null >/dev/null 2>&1; then \
30            diff='diff -u'; \
31          else \
32            diff='diff'; \
33          fi; \
34 ## List of tests in Makefile.
35          lst='$(expected_list_of_tests)'; \
36          test -n "$$lst" || lst='$(TESTS)'; \
37          for t in $$lst; do \
38            echo "$$t"; \
39          done | sort >$(am__tmk); \
40 ## List of subdirs where to look for tests.
41          dirs='$(test_subdirs)'; \
42          test -n "$$dirs" || dirs=.; \
43 ## List of tests on filesystem.  Be careful to cater for VPATH builds too.
44          test_extensions='$(TEST_EXTENSIONS)'; \
45          for ext in $$test_extensions; do \
46            for dir in $$dirs; do \
47              ls $$dir/*$$ext 2>/dev/null; \
48              if test $(srcdir) != $(builddir); then \
49                ($(am__cd) $(srcdir) && ls $$dir/*$$ext 2>/dev/null); \
50              fi; \
51            done; \
52          done | sed 's,^\./,,' | sort -u >$(am__tfs); \
53 ## Compare the two lists, complain if they differ.
54          if $$diff $(am__tmk) $(am__tfs) >$(am__tdf); then \
55             result=0; \
56          else \
57             echo '$@: list of tests in Makefile and on filesystem differ' >&2; \
58             echo "+ $$diff in-makefile on-filesystem" >&2; \
59             cat $(am__tdf) >&2; \
60             result=1; \
61          fi; \
62          rm -f $(am__tmk) $(am__tfs) $(am__tdf); \
63          exit $$result;
65 .PHONY: clean-maintcheck-testslist-tmp
66 clean-local: clean-maintcheck-testslist-tmp
67 clean-maintcheck-testslist-tmp:
68         rm -f $(am__tmk) $(am__tfs) $(am__tdf)