findutils/tests/GNUmakefile
Bernhard Voelker f72b299cdd tests: add shell-style test framework
Borrow the 'tests' framework from GNU coreutils.  This allows better
shell-style tests with more control over stdin, stdout, stderr, signals,
preparatory steps, cleanup, return code verification, root-only tests,
etc.

* .gitignore: Add entries for per-test *.log and *.trs files, and the
'test-suite.log'.
* .x-update-copyright: Exempt 'tests/init.sh' as this comes from gnulib.
* Makefile.am: Include 'tests/local.mk'.
(EXTRA_DIST): Add 'tests/GNUmakefile'.
(SUBDIRS): Move 'gnulib-tests' to the end, i.e., run our own tests first.
(ALL_RECURSIVE_TARGETS): Initialize.
(update-gnulib-to-latest): Copy 'tests/init.sh' from gnulib.
* cfg.mk: Add some syntax-check rules.
* init.cfg: Add file.
* tests/GNUmakefile: Likewise.
* tests/envvar-check: Likewise.
* tests/init.sh: Likewise.
* tests/lang-default: Likewise.
* tests/local.mk: Likewise.
* tests/misc/help-version.sh: Likewise.
* tests/other-fs-tmpdir: Likewise.
* tests/sample-test: Likewise.
* tests/.gitignore: Likewise.
* NEWS (Changes to the build process): Mention the new test framework.
2019-01-09 00:24:34 +01:00

21 lines
569 B
Makefile

# Provide a compatibility layer so that the commands used before the
# conversion of tests/ to non-recursive make still work. To do that, we
# must rerun the "make check" from the parent, and with tests/ prefixed
# onto any TESTS values. The SUBDIRS=. is to prevent the top-level check
# rules from descending into e.g., gnulib-test/.
.PHONY: all
all:
@echo 'tests/GNUmakefile: did you mean to make "check"?' 1>&2
@exit 1
ifeq ($(TESTS),)
tests =
else
tests = TESTS=$(addprefix tests/,$(TESTS))
endif
.PHONY: check
check:
cd .. && $(MAKE) $@ $(tests) SUBDIRS=.