[cairo-commit] Makefile.am perf/Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Thu Apr 19 15:12:13 PDT 2007


 Makefile.am      |    3 ++-
 perf/Makefile.am |   32 ++++++++++++++++++++------------
 2 files changed, 22 insertions(+), 13 deletions(-)

New commits:
diff-tree d64ef355217db7a555da0029187d19c80ec12609 (from 0ffb021e9b0cc2ec9afc3eaa360b4518327afa6c)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 19 23:12:09 2007 +0100

    Include cairo-perf in make check
    
    Although cairo-perf is not written to perform explicit failure testing of
    cairo, it does generate long sequences of cairo operations which often
    trigger unexpected errors. By including it with make check, it becomes
    even easier for the programmer to check that one has not broken cairo in
    terms of expected behaviour or performance.

diff --git a/Makefile.am b/Makefile.am
index 23166ea..3d8e360 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@ DIST_SUBDIRS = pixman src boilerplate te
 SUBDIRS = pixman src doc
 # libpng is required for our test programs
 if CAIRO_HAS_PNG_FUNCTIONS
-SUBDIRS += boilerplate test
+SUBDIRS += boilerplate test perf
 endif
 
 
@@ -19,6 +19,7 @@ recheck: all
 	cd test && $(MAKE) $(AM_MAKEFLAGS) recheck
 check-valgrind: all
 	cd test && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
+	cd perf && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
 perf: all
 	cd perf && $(MAKE) $(AM_MAKEFLAGS) perf
 lcov: check
diff --git a/perf/Makefile.am b/perf/Makefile.am
index 59e0b33..86bdd26 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -65,7 +65,12 @@ TARGETS = $(CAIRO_TEST_TARGET)
 ITERS = $(CAIRO_PERF_ITERATIONS)
 CAIRO_PERF_ENVIRONMENT = CAIRO_TEST_TARGET="$(TARGETS)" CAIRO_PERF_ITERATIONS="$(ITERS)"
 
-perf: cairo-perf FORCE
+# Cap the maximum number of iterations during 'make check'
+TESTS_ENVIRONMENT = CAIRO_TEST_TARGET="$(TARGETS)" CAIRO_PERF_ITERATIONS="10"
+
+TESTS = cairo-perf
+
+perf: cairo-perf
 	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf
 
 html: index.html
@@ -73,6 +78,7 @@ html: index.html
 index.html: cairo-perf
 	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -h HEAD > $@
 
+
 EXTRA_VALGRIND_FLAGS = $(CAIRO_EXTRA_VALGRIND_FLAGS)
 VALGRIND_MEMCHECK_FLAGS = \
 	--tool=memcheck \
@@ -85,15 +91,17 @@ CLEANFILES = \
 	callgrind.out.* \
 	index.html
 
-perf-valgrind: cairo-perf FORCE
-	$(CAIRO_PERF_ENVIRONMENT) $(top_srcdir)/libtool --mode=execute \
-		valgrind $(VALGRIND_MEMCHECK_FLAGS) $(EXTRA_VALGRIND_FLAGS) \
-		./cairo-perf 2>&1 | tee valgrind-log
-perf-callgrind: cairo-perf FORCE
-	$(CAIRO_PERF_ENVIRONMENT) $(top_srcdir)/libtool --mode=execute \
-		valgrind $(VALGRIND_CALLGRIND_FLAGS) $(EXTRA_VALGRIND_FLAGS) \
-		./cairo-perf
-
-FORCE:
+check-valgrind perf-valgrind:
+	$(MAKE) $(AM_MAKEFLAGS) check \
+	    TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
+	    $(top_srcdir)/libtool --mode=execute \
+	    valgrind $(VALGRIND_MEMCHECK_FLAGS) $(EXTRA_VALGRIND_FLAGS)' \
+	    | tee valgrind-log
+
+perf-callgrind:
+	$(MAKE) $(AM_MAKEFLAGS) check \
+	    TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) \
+	    $(top_srcdir)/libtool --mode=execute \
+	    valgrind $(VALGRIND_CALLGRIND_FLAGS) $(EXTRA_VALGRIND_FLAGS)'
 
-.PHONY: perf perf-valgrind perf-callgrind FORCE
+.PHONY: perf html check-valgrind perf-valgrind perf-callgrind


More information about the cairo-commit mailing list