summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-10-17 11:20:01 +0100
committerPádraig Brady <P@draigBrady.com>2011-10-17 11:56:10 +0100
commitead96f9ede398eb34f23ee75317062963b460942 (patch)
tree0c6592ce4606caa855973c33aa5b75a0cf64bef2 /tests
parent563bb94068764558201bf986aa94dc23d974d9c0 (diff)
downloadcoreutils-ead96f9ede398eb34f23ee75317062963b460942.tar.xz
maint: speed up make check (vc_exe_in_TESTS)
* tests/check.mk (vc_exe_in_TESTS): The main change is to not start a sed process for each file under tests/, which was taking around 2.5s on a 2.1GHz i3-2310M. Also adjust the rule to no longer use temporary files.
Diffstat (limited to 'tests')
-rw-r--r--tests/check.mk24
1 files changed, 10 insertions, 14 deletions
diff --git a/tests/check.mk b/tests/check.mk
index d45c2885f..557d41a7a 100644
--- a/tests/check.mk
+++ b/tests/check.mk
@@ -20,21 +20,17 @@
_v = TESTS
_w = root_tests
vc_exe_in_TESTS: Makefile
- $(AM_V_GEN)rm -f t1 t2; \
- if test -d $(top_srcdir)/.git && test $(srcdir) = .; then \
- { sed -n '/^$(_v) =[ ]*\\$$/,/[^\]$$/p' \
- $(srcdir)/Makefile.am \
- | sed 's/^ *//;/^\$$.*/d;/^$(_v) =/d'; \
- sed -n '/^$(_w) =[ ]*\\$$/,/[^\]$$/p' \
- $(srcdir)/Makefile.am \
- | sed 's/^ *//;/^\$$.*/d;/^$(_w) =/d'; } \
- | tr -s '\012\\' ' ' | fmt -1 | sort -u > t1 && \
- for f in `cd $(top_srcdir) && build-aux/vc-list-files $(subdir)`; do \
- f=`echo $$f|sed 's!^$(subdir)/!!'`; \
+ $(AM_V_GEN)if test -d $(top_srcdir)/.git && test $(srcdir) = .; then \
+ { \
+ for list in $(_v) $(_w); do \
+ sed -n "/^$$list =[ ]*\\\\$$/,/[^\]$$/p" Makefile.am | \
+ sed -n 's/^ *\([^$$ ]\{1,\}\).*/\1/p'; \
+ done; \
+ for f in `cd $(top_srcdir) && \
+ build-aux/vc-list-files $(subdir) | sed 's!^$(subdir)/!!'`; do \
test -f "$$f" && test -x "$$f" && echo "$$f"; \
- done | sort -u > t2 && \
- diff -u t1 t2 || exit 1; \
- rm -f t1 t2; \
+ done; \
+ } | sort | uniq -u | grep . && exit 1 ||:; \
else :; fi
check: vc_exe_in_TESTS