mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-29 23:10:21 +01:00
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.
107 lines
2.8 KiB
Makefile
107 lines
2.8 KiB
Makefile
# We're using _GNU_SOURCE to get the prototype for asprintf. This may
|
|
# not be the most portable approach, but it is pragmatic and I'm
|
|
# willing to do something cleaner as soon as it causes someone a
|
|
# problem.
|
|
INCLUDES = \
|
|
-D_GNU_SOURCE \
|
|
-I$(srcdir) \
|
|
-I$(top_srcdir)/boilerplate \
|
|
-I$(top_srcdir)/src \
|
|
-I$(top_builddir)/src \
|
|
$(CAIRO_CFLAGS)
|
|
|
|
noinst_PROGRAMS = cairo-perf cairo-perf-diff-files
|
|
EXTRA_DIST = cairo-perf-diff
|
|
|
|
cairo_perf_SOURCES = \
|
|
cairo-perf.c \
|
|
cairo-perf.h \
|
|
cairo-perf-cover.c \
|
|
cairo-stats.c \
|
|
cairo-stats.h \
|
|
box-outline.c \
|
|
fill.c \
|
|
long-lines.c \
|
|
mosaic.c \
|
|
mosaic.h \
|
|
paint.c \
|
|
pattern_create_radial.c \
|
|
rectangles.c \
|
|
stroke.c \
|
|
subimage_copy.c \
|
|
tessellate.c \
|
|
unaligned-clip.c \
|
|
text.c \
|
|
world-map.c \
|
|
world-map.h \
|
|
zrusin.c \
|
|
zrusin-another.h
|
|
|
|
if CAIRO_HAS_WIN32_SURFACE
|
|
cairo_perf_SOURCES += cairo-perf-win32.c
|
|
else
|
|
cairo_perf_SOURCES += cairo-perf-posix.c
|
|
endif
|
|
|
|
cairo_perf_diff_files_SOURCES = \
|
|
cairo-perf-diff-files.c \
|
|
cairo-stats.c \
|
|
cairo-stats.h
|
|
|
|
LDADD = $(top_builddir)/boilerplate/libcairoboilerplate.la \
|
|
$(top_builddir)/src/libcairo.la
|
|
|
|
$(top_builddir)/boilerplate/libcairoboilerplate.la: $(top_builddir)/src/libcairo.la
|
|
cd $(top_builddir)/boilerplate && $(MAKE) $(AM_MAKEFLAGS) libcairoboilerplate.la
|
|
|
|
$(top_builddir)/src/libcairo.la:
|
|
cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libcairo.la
|
|
|
|
|
|
# Do a funny transition of CAIRO_TEST_TARGET through TARGETS such that
|
|
# one can limit tested targets both through CAIRO_TEST_TARGET env var
|
|
# and TARGETS make var on the command line.
|
|
TARGETS = $(CAIRO_TEST_TARGET)
|
|
ITERS = $(CAIRO_PERF_ITERATIONS)
|
|
CAIRO_PERF_ENVIRONMENT = CAIRO_TEST_TARGET="$(TARGETS)" CAIRO_PERF_ITERATIONS="$(ITERS)"
|
|
|
|
# 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
|
|
|
|
index.html: cairo-perf
|
|
$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -h HEAD > $@
|
|
|
|
|
|
EXTRA_VALGRIND_FLAGS = $(CAIRO_EXTRA_VALGRIND_FLAGS)
|
|
VALGRIND_MEMCHECK_FLAGS = \
|
|
--tool=memcheck \
|
|
--suppressions=$(top_srcdir)/test/.valgrind-suppressions \
|
|
--leak-check=yes --show-reachable=yes
|
|
VALGRIND_CALLGRIND_FLAGS = \
|
|
--tool=callgrind
|
|
CLEANFILES = \
|
|
valgrind-log \
|
|
callgrind.out.* \
|
|
index.html
|
|
|
|
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 html check-valgrind perf-valgrind perf-callgrind
|