Pádraig Brady wrote: > When running single tests I noticed a delay of about 3s at the end > when vc_exe_in_TESTS was running. This is mainly due to > running sed for each file under tests/ which can be avoided like: > > diff --git a/tests/check.mk b/tests/check.mk > index d45c288..ac7be1a 100644 > --- a/tests/check.mk > +++ b/tests/check.mk > @@ -29,8 +29,8 @@ vc_exe_in_TESTS: Makefile > $(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)/!!'`; \ > + 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; \ > > I've went further in the attached patch though and > simplified the test to avoid temp files etc. > > cheers, > Pádraig. > > From 32f0704d05ca56ecd0229194bc496d7ade19d6fe Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]> > Date: Mon, 17 Oct 2011 11:20:01 +0100 > Subject: [PATCH] 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. > The check was also adjusted to avoid temporary files.
Thanks a lot on both counts. Now that you mention it, that delay was a nagging annoyance, and avoiding temporary files in rules like that is always welcome. nit: this is a good example of passive vs. active "voice" mentioned in HACKING; please make this change to your log message: - The check was also adjusted to avoid temporary files. + Adjust the rule to no longer use temporary files.
