"Fossies" - the Fresh Open Source Software Archive

Member "automake-1.16.3/t/local.mk" (19 Nov 2020, 9638 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Make source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "local.mk": 1.16.2_vs_1.16.3.

    1 ## -*- makefile-automake -*-
    2 ## Copyright (C) 1995-2020 Free Software Foundation, Inc.
    3 ##
    4 ## This program is free software; you can redistribute it and/or modify
    5 ## it under the terms of the GNU General Public License as published by
    6 ## the Free Software Foundation; either version 2, or (at your option)
    7 ## any later version.
    8 ##
    9 ## This program is distributed in the hope that it will be useful,
   10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 ## GNU General Public License for more details.
   13 ##
   14 ## You should have received a copy of the GNU General Public License
   15 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
   16 
   17 ## ------------ ##
   18 ##  Testsuite.  ##
   19 ## ------------ ##
   20 
   21 # Run the tests with a proper shell detected at configure time.
   22 LOG_COMPILER = ./pre-inst-env $(AM_TEST_RUNNER_SHELL)
   23 
   24 TEST_EXTENSIONS = .pl .sh .tap
   25 SH_LOG_COMPILER = $(LOG_COMPILER)
   26 TAP_LOG_COMPILER = $(LOG_COMPILER)
   27 PL_LOG_COMPILER = ./pre-inst-env $(PERL)
   28 AM_PL_LOG_FLAGS = -Mstrict -w
   29 
   30 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(srcdir)/lib/tap-driver.sh
   31 
   32 AM_TAP_LOG_DRIVER_FLAGS = --merge
   33 
   34 EXTRA_DIST += %D%/README %D%/ax/is %D%/ax/is_newest %D%/ax/deltree.pl
   35 
   36 
   37 ## Will be updated later.
   38 TESTS =
   39 
   40 # Some testsuite-influential variables should be overridable from the
   41 # test scripts, but not from the environment.
   42 # Keep this in sync with the similar list in ax/runtest.in.
   43 AM_TESTS_ENVIRONMENT = \
   44   for v in \
   45     required \
   46     am_test_protocol \
   47     am_serial_tests \
   48     am_test_prefer_config_shell \
   49     am_original_AUTOMAKE \
   50     am_original_ACLOCAL \
   51     am_test_lib_sourced \
   52     test_lib_sourced \
   53   ; do \
   54     eval test x"\$${$$v}" = x || unset $$v; \
   55   done;
   56 # We want warning messages and explanations for skipped tests to go to
   57 # the console if possible, so set up 'stderr_fileno_' properly.
   58 AM_TESTS_FD_REDIRECT = 9>&2
   59 AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
   60 
   61 # For sourcing of extra "shell libraries" by our test scripts.  As per
   62 # POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
   63 # in case it is given with a relative name containing no slashes.
   64 AM_TESTS_ENVIRONMENT += \
   65   if test $(srcdir) != .; then \
   66     PATH='$(abs_srcdir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
   67   fi; \
   68   PATH='$(abs_builddir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
   69   export PATH;
   70 
   71 # Hand-written tests.
   72 
   73 include $(srcdir)/%D%/list-of-tests.mk
   74 
   75 TESTS += $(handwritten_TESTS)
   76 EXTRA_DIST += $(handwritten_TESTS)
   77 
   78 # Automatically-generated tests wrapping hand-written ones.
   79 # Also, automatically-computed dependencies for tests.
   80 
   81 include $(srcdir)/%D%/testsuite-part.am
   82 
   83 TESTS += $(generated_TESTS)
   84 EXTRA_DIST += $(generated_TESTS)
   85 
   86 $(srcdir)/%D%/testsuite-part.am:
   87     $(AM_V_at)rm -f %D%/testsuite-part.tmp $@
   88     $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
   89       --srcdir $(srcdir) > %D%/testsuite-part.tmp
   90     $(AM_V_at)chmod a-w %D%/testsuite-part.tmp
   91     $(AM_V_at)mv -f %D%/testsuite-part.tmp $@
   92 EXTRA_DIST += gen-testsuite-part
   93 
   94 # The dependencies declared here are not truly complete, but such
   95 # completeness would cause more issues than it would solve.  See
   96 # automake bug#11347 and #44458.
   97 $(generated_TESTS): $(srcdir)/gen-testsuite-part
   98 $(srcdir)/%D%/testsuite-part.am: $(srcdir)/gen-testsuite-part
   99 $(srcdir)/%D%/testsuite-part.am: Makefile.am
  100 $(srcdir)/%D%/testsuite-part.am: %D%/list-of-tests.mk
  101 
  102 # Hand-written tests for stuff in 'contrib/'.
  103 include $(srcdir)/contrib/%D%/local.mk
  104 TESTS += $(contrib_TESTS)
  105 EXTRA_DIST += $(contrib_TESTS)
  106 
  107 # Static dependencies valid for each test case (also further
  108 # extended later).  Note that use 'noinst_' rather than 'check_'
  109 # as the prefix, because we really want them to be built by
  110 # "make all".  This makes it easier to run the test cases by
  111 # hand after having simply configured and built the package.
  112 
  113 dist_noinst_DATA += \
  114   %D%/ax/test-init.sh \
  115   %D%/ax/test-lib.sh \
  116   %D%/ax/am-test-lib.sh \
  117   %D%/ax/tap-functions.sh
  118 
  119 # Few more static dependencies.
  120 %D%/distcheck-missing-m4.log: %D%/ax/distcheck-hook-m4.am
  121 %D%/distcheck-outdated-m4.log: %D%/ax/distcheck-hook-m4.am
  122 EXTRA_DIST += %D%/ax/distcheck-hook-m4.am
  123 
  124 %D%/ax/test-defs.sh: %D%/ax/test-defs.in Makefile
  125     $(AM_V_at)rm -f $@ $@-t
  126     $(AM_V_at)$(MKDIR_P) %D%/ax
  127     $(AM_V_GEN)in=%D%/ax/test-defs.in \
  128       && $(do_subst) <$(srcdir)/$$in >$@-t
  129     $(generated_file_finalize)
  130 EXTRA_DIST += %D%/ax/test-defs.in
  131 CLEANFILES += %D%/ax/test-defs.sh
  132 nodist_noinst_DATA += %D%/ax/test-defs.sh
  133 
  134 %D%/ax/shell-no-trail-bslash: %D%/ax/shell-no-trail-bslash.in Makefile
  135     $(AM_V_at)rm -f $@ $@-t
  136     $(AM_V_GEN)in=%D%/ax/shell-no-trail-bslash.in \
  137       && $(MKDIR_P) %D%/ax \
  138       && $(do_subst) <$(srcdir)/$$in >$@-t \
  139       && chmod a+x $@-t
  140     $(generated_file_finalize)
  141 EXTRA_DIST += %D%/ax/shell-no-trail-bslash.in
  142 CLEANFILES += %D%/ax/shell-no-trail-bslash
  143 nodist_noinst_SCRIPTS += %D%/ax/shell-no-trail-bslash
  144 
  145 %D%/ax/cc-no-c-o: %D%/ax/cc-no-c-o.in Makefile
  146     $(AM_V_at)rm -f $@ $@-t
  147     $(AM_V_GEN)in=%D%/ax/cc-no-c-o.in \
  148       && $(MKDIR_P) %D%/ax \
  149       && $(do_subst) <$(srcdir)/$$in >$@-t \
  150       && chmod a+x $@-t
  151     $(generated_file_finalize)
  152 EXTRA_DIST += %D%/ax/cc-no-c-o.in
  153 CLEANFILES += %D%/ax/cc-no-c-o
  154 nodist_noinst_SCRIPTS += %D%/ax/cc-no-c-o
  155 
  156 runtest: %D%/ax/runtest.in Makefile
  157     $(AM_V_at)rm -f $@ $@-t
  158     $(AM_V_GEN)in=%D%/ax/runtest.in \
  159       && $(MKDIR_P) %D%/ax \
  160       && $(do_subst) <$(srcdir)/$$in >$@-t \
  161       && chmod a+x $@-t
  162     $(generated_file_finalize)
  163 EXTRA_DIST += %D%/ax/runtest.in
  164 CLEANFILES += runtest
  165 nodist_noinst_SCRIPTS += runtest
  166 
  167 # If two test scripts have the same basename, they will end up sharing
  168 # the same log file, leading to all sort of undefined and undesired
  169 # behaviours.
  170 check-no-repeated-test-name:
  171     @LC_ALL=C; export LC_ALL; \
  172      lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
  173        | sort | uniq -c | awk '($$1 > 1) { print }' \
  174        | sed 's/\.log$$//' | grep . >&2 \
  175        && { \
  176          echo $@: test names listed above are duplicated >&2; \
  177          exit 1; \
  178        }; :
  179 check-local: check-no-repeated-test-name
  180 .PHONY: check-no-repeated-test-name
  181 
  182 # Check that our test cases are syntactically correct.
  183 # See automake bug#11898.
  184 check-tests-syntax:
  185     @st=0; \
  186     err () { echo "$@: $$*" >&2; st=1; }; \
  187 ## The user might do something like "make check TESTS=t/foo" or
  188 ## "make check TESTS_LOGS=t/foo.log" and expect (say) the test
  189 ## 't/foo.sh' to be run; this has worked well until today, and
  190 ## we want to continue supporting this use case.
  191     bases=`for log in : $(TEST_LOGS); do echo $$log; done \
  192       | sed -e '/^:$$/d' -e 's/\.log$$//'`; \
  193     for bas in $$bases; do \
  194       for suf in sh tap pl; do \
  195         tst=$$bas.$$suf; \
  196 ## Emulate VPATH search.
  197         if test -f $$tst; then \
  198           break; \
  199         elif test -f $(srcdir)/$$tst; then \
  200           tst=$(srcdir)/$$tst; \
  201           break; \
  202         else \
  203           tst=''; \
  204         fi; \
  205       done; \
  206       test -n "$$tst" || err "couldn't find test '$$bas'"; \
  207 ## Don't check that perl tests are valid shell scripts!
  208       test $$suf = pl && continue; \
  209       $(AM_V_P) && echo " $(AM_TEST_RUNNER_SHELL) -n $$tst"; \
  210       $(AM_TEST_RUNNER_SHELL) -n "$$tst" \
  211         || err "test '$$tst' syntactically invalid"; \
  212     done; \
  213     exit $$st
  214 check-local: check-tests-syntax
  215 .PHONY: check-tests-syntax
  216 
  217 # Recipes with a trailing backslash character (possibly followed by
  218 # blank characters only) can cause spurious syntax errors with at
  219 # least older bash versions (e.g., bash 2.05b), and can be potentially
  220 # be unportable to other weaker shells.  Run the testsuite in a way
  221 # that helps catching such problems in Automake-generated recipes.
  222 # See automake bug#10436.
  223 check-no-trailing-backslash-in-recipes:
  224     $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
  225       CONFIG_SHELL='$(abs_top_builddir)/%D%/ax/shell-no-trail-bslash'
  226 .PHONY: check-no-trailing-backslash-in-recipes
  227 
  228 # Some compilers out there (hello, MSVC) still choke on "-c -o" being
  229 # passed together on the command line.  Run the whole testsuite faking
  230 # the presence of such a compiler, to help catch regressions that would
  231 # otherwise only present themselves later "in the wild".  See also the
  232 # long discussion about automake bug#13378.
  233 check-cc-no-c-o:
  234     $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
  235       AM_TESTSUITE_SIMULATING_NO_CC_C_O=yes
  236 .PHONY: check-cc-no-c-o
  237 
  238 # Automake-generated Makefiles should work when run with parallel make.
  239 check-parallel:
  240     $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
  241       AM_TESTSUITE_MAKE="$${AM_TESTSUITE_MAKE-$${MAKE-make}} -j4"
  242 .PHONY: check-parallel
  243 
  244 ## Checking the list of tests.
  245 test_subdirs = %D% %D%/pm contrib/%D%
  246 include %D%/CheckListOfTests.am
  247 
  248 # Run the testsuite with the installed aclocal and automake without using
  249 # the 'pre-inst-env' wrapper script.
  250 installcheck-local: installcheck-testsuite
  251 installcheck-testsuite:
  252     $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
  253       LOG_COMPILER=$(AM_TEST_RUNNER_SHELL) \
  254       PL_LOG_COMPILER=$(PERL) \
  255       am_running_installcheck=yes
  256 
  257 # Ensure that the installed Automake perl modules are found when running 'installcheck' target
  258 AM_TESTS_ENVIRONMENT += \
  259   if test "$${am_running_installcheck}" = yes; then \
  260     PERL5LIB="$(DESTDIR)$(pkgvdatadir)/$${PERL5LIB:+$(PATH_SEPARATOR)}$$PERL5LIB"; \
  261   fi; \
  262   export PERL5LIB;
  263 
  264 # Performance tests.
  265 .PHONY: perf
  266 perf: all
  267     $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
  268       TEST_SUITE_LOG='$(PERF_TEST_SUITE_LOG)' TESTS='$(perf_TESTS)'
  269 PERF_TEST_SUITE_LOG = %D%/perf/test-suite.log
  270 CLEANFILES += $(PERF_TEST_SUITE_LOG)
  271 EXTRA_DIST += $(perf_TESTS)
  272 
  273 clean-local: clean-local-check
  274 .PHONY: clean-local-check
  275 clean-local-check:
  276     $(AM_V_GEN)$(PERL) $(srcdir)/t/ax/deltree.pl t/*.dir t/*/*.dir */t/*.dir
  277 
  278 # vim: ft=automake noet