From b3cbee25bc4ead4911b04a411d1c590f87467f63 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 17 Nov 2009 23:28:27 +0000 Subject: [PATCH] Makefile: Print timing information in test output. For some reason, C makes a very poor showing in the timings. I'd love to know why. (Guess at `malloc' being a bottleneck.) --- Makefile | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index aac2437..8ea4f74 100644 --- a/Makefile +++ b/Makefile @@ -24,23 +24,25 @@ clean::; rm -f $(CLEANFILES) CLEANFILES += test.* test:: all - @win=0 lose=0; \ - for lang in $(LANGS); do \ - echo >&3 "*** $$lang"; \ - printf "Test $$lang..."; \ - if ./test ./$${lang}-fringe 2>&3; then \ - win=$$(expr $$win + 1); \ - printf " ok\n"; \ - else \ - lose=$$(expr $$lose + 1); \ - printf " FAILED\n"; \ - fi; \ - done 3>test.log; \ - if [ $$lose -eq 0 ]; then \ - echo "All $$win test(s) OK"; \ - else \ - echo "FAILED $$lose test(s)!"; \ - exit 1; \ + @win=0 lose=0; \ + for lang in $(LANGS); do \ + echo >&3 "*** $$lang"; \ + printf "Test $$lang..."; \ + time=`command time -o/dev/stdout -f "%U user; %S system; %E" \ + ./test ./$${lang}-fringe 2>&3`; \ + if [ $$? -eq 0 ]; then \ + win=$$(expr $$win + 1); \ + printf " ok ($$time)\n"; \ + else \ + lose=$$(expr $$lose + 1); \ + printf " FAILED\n"; \ + fi; \ + done 3>test.log; \ + if [ $$lose -eq 0 ]; then \ + echo "All $$win test(s) OK"; \ + else \ + echo "FAILED $$lose test(s)!"; \ + exit 1; \ fi ###-------------------------------------------------------------------------- -- 2.11.0