mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tests: avoid gross inefficiency in "make test"
Do not run a sub-make to set up the environment for each and every test script. Instead, run it just once and store the result in a file. * tests/check.mk (built_programs): Remove definition. (.built-programs): New rule to create the temporary file. (CLEANFILES): Arrange to remove it. (TESTS_ENVIRONMENT): Simply cat .built-programs, rather than running the sub-make. * .gitignore: Ignore it.
This commit is contained in:
1 parent
5c3fd50a75
commit
ee6c466ba8
2 files changed
+9
-3
No files matched your search
@@ -76,6 +76,7 @@
|
||||
/stamp-h1
|
||||
/tests/*/*.log
|
||||
/tests/t?
|
||||
/tests/.built-programs
|
||||
/tests/test-suite.log
|
||||
ID
|
||||
Makefile
|
||||
|
||||
+8
-3
@@ -40,8 +40,13 @@ vc_exe_in_TESTS: Makefile
|
||||
check: vc_exe_in_TESTS
|
||||
.PHONY: vc_exe_in_TESTS
|
||||
|
||||
built_programs = \
|
||||
(cd $(top_builddir)/src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
||||
CLEANFILES =
|
||||
CLEANFILES += .built-programs
|
||||
check-am: .built-programs
|
||||
.built-programs:
|
||||
$(AM_V_GEN)cd $(top_builddir)/src \
|
||||
&& MAKEFLAGS= $(MAKE) -s built_programs.list \
|
||||
> $@-t && mv $@-t $@
|
||||
|
||||
# Note that the first lines are statements. They ensure that environment
|
||||
# variables that can perturb tests are unset or set to expected values.
|
||||
@@ -76,7 +81,7 @@ TESTS_ENVIRONMENT = \
|
||||
abs_top_builddir='$(abs_top_builddir)' \
|
||||
abs_top_srcdir='$(abs_top_srcdir)' \
|
||||
abs_srcdir='$(abs_srcdir)' \
|
||||
built_programs="`$(built_programs)`" \
|
||||
built_programs="`cat .built-programs`" \
|
||||
host_os=$(host_os) \
|
||||
host_triplet='$(host_triplet)' \
|
||||
srcdir='$(srcdir)' \
|
||||
|
||||
Reference in new issue
Block a user