summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-04-19 23:12:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-04-19 23:12:09 +0100
commitd64ef355217db7a555da0029187d19c80ec12609 (patch)
tree55f1eba8aa2d5c80f200f508b9aafdd5b92b404a
parent0ffb021e9b0cc2ec9afc3eaa360b4518327afa6c (diff)
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.
-rw-r--r--Makefile.am3
-rw-r--r--perf/Makefile.am30
2 files changed, 21 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index 23166ea0..3d8e3603 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@ DIST_SUBDIRS = pixman src boilerplate test perf doc
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 59e0b339..86bdd26f 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
+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
-FORCE:
+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