aboutsummaryrefslogtreecommitdiff
path: root/pixman/test
diff options
context:
space:
mode:
Diffstat (limited to 'pixman/test')
-rw-r--r--pixman/test/Makefile.am47
-rw-r--r--pixman/test/Makefile.sources36
-rw-r--r--pixman/test/Makefile.win3289
-rw-r--r--pixman/test/blitters-test.c1
-rw-r--r--pixman/test/composite.c1
-rw-r--r--pixman/test/fetch-test.c5
-rw-r--r--pixman/test/pdf-op-test.c1
-rw-r--r--pixman/test/scaling-helpers-test.c3
-rw-r--r--pixman/test/utils.h5
9 files changed, 72 insertions, 116 deletions
diff --git a/pixman/test/Makefile.am b/pixman/test/Makefile.am
index 6687bed35..4268cd7c5 100644
--- a/pixman/test/Makefile.am
+++ b/pixman/test/Makefile.am
@@ -1,50 +1,13 @@
+include $(top_srcdir)/test/Makefile.sources
+
AM_CFLAGS = @OPENMP_CFLAGS@
AM_LDFLAGS = @OPENMP_CFLAGS@ @TESTPROGS_EXTRA_LDFLAGS@
-LDADD = $(top_builddir)/pixman/libpixman-1.la -lm @PNG_LIBS@
+LDADD = $(top_builddir)/pixman/libpixman-1.la libutils.la -lm @PNG_LIBS@
INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman @PNG_CFLAGS@
-TESTPROGRAMS = \
- a1-trap-test \
- pdf-op-test \
- region-test \
- region-translate-test \
- fetch-test \
- oob-test \
- trap-crasher \
- alpha-loop \
- scaling-crash-test \
- scaling-helpers-test \
- gradient-crash-test \
- region-contains-test \
- alphamap \
- stress-test \
- composite-traps-test \
- blitters-test \
- scaling-test \
- affine-test \
- composite
-
-pdf_op_test_SOURCES = pdf-op-test.c utils.c utils.h
-region_test_SOURCES = region-test.c utils.c utils.h
-blitters_test_SOURCES = blitters-test.c utils.c utils.h
-region_contains_test_SOURCES = region-contains-test.c utils.c utils.h
-composite_traps_test_SOURCES = composite-traps-test.c utils.c utils.h
-scaling_test_SOURCES = scaling-test.c utils.c utils.h
-affine_test_SOURCES = affine-test.c utils.c utils.h
-alphamap_SOURCES = alphamap.c utils.c utils.h
-alpha_loop_SOURCES = alpha-loop.c utils.c utils.h
-composite_SOURCES = composite.c utils.c utils.h
-gradient_crash_test_SOURCES = gradient-crash-test.c utils.c utils.h
-stress_test_SOURCES = stress-test.c utils.c utils.h
-scaling_helpers_test_SOURCES = scaling-helpers-test.c utils.c utils.h
-
-# Benchmarks
-
-BENCHMARKS = \
- lowlevel-blt-bench
-
-lowlevel_blt_bench_SOURCES = lowlevel-blt-bench.c utils.c utils.h
+libutils_la_SOURCES = $(libutils_sources) $(libutils_headers)
+noinst_LTLIBRARIES = libutils.la
noinst_PROGRAMS = $(TESTPROGRAMS) $(BENCHMARKS)
TESTS = $(TESTPROGRAMS)
diff --git a/pixman/test/Makefile.sources b/pixman/test/Makefile.sources
new file mode 100644
index 000000000..99eb705af
--- /dev/null
+++ b/pixman/test/Makefile.sources
@@ -0,0 +1,36 @@
+# Tests (sorted by expected completion time)
+TESTPROGRAMS = \
+ a1-trap-test \
+ pdf-op-test \
+ region-test \
+ region-translate-test \
+ fetch-test \
+ oob-test \
+ trap-crasher \
+ alpha-loop \
+ scaling-crash-test \
+ scaling-helpers-test \
+ gradient-crash-test \
+ region-contains-test \
+ alphamap \
+ stress-test \
+ composite-traps-test \
+ blitters-test \
+ scaling-test \
+ affine-test \
+ composite \
+ $(NULL)
+
+# Benchmarks
+BENCHMARKS = \
+ lowlevel-blt-bench \
+ $(NULL)
+
+# Utility functions
+libutils_sources = \
+ utils.c \
+ $(NULL)
+
+libutils_headers = \
+ utils.h \
+ $(NULL)
diff --git a/pixman/test/Makefile.win32 b/pixman/test/Makefile.win32
index a62b6fc35..307ba0c23 100644
--- a/pixman/test/Makefile.win32
+++ b/pixman/test/Makefile.win32
@@ -1,76 +1,31 @@
-CC = cl
-LINK = link
+default: all
-CFG_VAR = $(CFG)
-ifeq ($(CFG_VAR),)
-CFG_VAR=release
-endif
+top_srcdir = ..
+include $(top_srcdir)/test/Makefile.sources
+include $(top_srcdir)/Makefile.win32.common
-CFLAGS = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_BIND_TO_CURRENT_VCLIBS_VERSION -D_MT -I../pixman -I. -I../
-TEST_LDADD = ../pixman/$(CFG_VAR)/pixman-1.lib
-INCLUDES = -I../pixman -I$(top_builddir)/pixman
+TEST_LDADD = \
+ $(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib \
+ $(CFG_VAR)/libutils.lib \
+ $(NULL)
-# optimization flags
-ifeq ($(CFG_VAR),debug)
-CFLAGS += -Od -Zi
-else
-CFLAGS += -O2
-endif
+libutils_OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libutils_sources))
-SOURCES = \
- a1-trap-test.c \
- pdf-op-test.c \
- region-test.c \
- region-translate-test.c \
- fetch-test.c \
- oob-test.c \
- trap-crasher.c \
- alpha-loop.c \
- scaling-crash-test.c \
- gradient-crash-test.c \
- alphamap.c \
- stress-test.c \
- composite-traps-test.c \
- blitters-test.c \
- scaling-test.c \
- affine-test.c \
- composite.c \
- lowlevel-blt-bench.c \
- utils.c
+SOURCES = $(patsubst %, %.c, $(TESTPROGRAMS) $(BENCHMARKS))
+OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
+TESTS = $(patsubst %, $(CFG_VAR)/%.exe, $(TESTPROGRAMS))
+BENCHS = $(patsubst %, $(CFG_VAR)/%.exe, $(BENCHMARKS))
-TESTS = \
- $(CFG_VAR)/a1-trap-test.exe \
- $(CFG_VAR)/pdf-op-test.exe \
- $(CFG_VAR)/region-test.exe \
- $(CFG_VAR)/region-translate-test.exe \
- $(CFG_VAR)/fetch-test.exe \
- $(CFG_VAR)/oob-test.exe \
- $(CFG_VAR)/trap-crasher.exe \
- $(CFG_VAR)/alpha-loop.exe \
- $(CFG_VAR)/scaling-crash-test.exe \
- $(CFG_VAR)/gradient-crash-test.exe \
- $(CFG_VAR)/alphamap.exe \
- $(CFG_VAR)/stress-test.exe \
- $(CFG_VAR)/composite-traps-test.exe \
- $(CFG_VAR)/blitters-test.exe \
- $(CFG_VAR)/scaling-test.exe \
- $(CFG_VAR)/affine-test.exe \
- $(CFG_VAR)/composite.exe
+all: inform $(TESTS) $(BENCHS)
-BENCHMARKS = \
- $(CFG_VAR)/lowlevel-blt-bench.exe
+check: inform $(TESTS)
+ @for test in $(TESTS) ; do ./$$test && echo "PASS: $$test" || echo "FAIL: $$test" ; done
-OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
+$(CFG_VAR)/libutils.lib: $(libutils_OBJECTS)
+ @$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
-$(CFG_VAR)/%.obj: %.c
- @mkdir -p $(CFG_VAR)
- @$(CC) -c $(CFLAGS) -Fo"$@" $<
+$(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj $(TEST_LDADD)
+ @$(LD) $(PIXMAN_LDFLAGS) -OUT:$@ $^
-$(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj
- $(LINK) /NOLOGO /OUT:$@ $< $(CFG_VAR)/utils.obj $(TEST_LDADD)
-
-all: $(OBJECTS) $(TESTS) $(BENCHMARKS)
- @exit 0
-
-clean:
- @rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.pdb || exit 0
+$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib:
+ @$(MAKE) -C $(top_builddir)/pixman -f Makefile.win32
diff --git a/pixman/test/blitters-test.c b/pixman/test/blitters-test.c
index 594ec548b..790a27f03 100644
--- a/pixman/test/blitters-test.c
+++ b/pixman/test/blitters-test.c
@@ -8,7 +8,6 @@
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
-#include <config.h>
#include "utils.h"
static pixman_indexed_t rgb_palette[9];
diff --git a/pixman/test/composite.c b/pixman/test/composite.c
index edea9a96b..408c363a3 100644
--- a/pixman/test/composite.c
+++ b/pixman/test/composite.c
@@ -27,7 +27,6 @@
#include <stdio.h>
#include <stdlib.h> /* abort() */
#include <math.h>
-#include <config.h>
#include <time.h>
#include "utils.h"
diff --git a/pixman/test/fetch-test.c b/pixman/test/fetch-test.c
index feb98d9b7..9f80eec1b 100644
--- a/pixman/test/fetch-test.c
+++ b/pixman/test/fetch-test.c
@@ -1,8 +1,11 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "pixman.h"
-#include <config.h>
#define SIZE 1024
diff --git a/pixman/test/pdf-op-test.c b/pixman/test/pdf-op-test.c
index dc7a4fd0b..99cb7dfea 100644
--- a/pixman/test/pdf-op-test.c
+++ b/pixman/test/pdf-op-test.c
@@ -1,4 +1,3 @@
-#include <config.h>
#include <stdlib.h>
#include "utils.h"
diff --git a/pixman/test/scaling-helpers-test.c b/pixman/test/scaling-helpers-test.c
index a38cac544..a8b94b0c7 100644
--- a/pixman/test/scaling-helpers-test.c
+++ b/pixman/test/scaling-helpers-test.c
@@ -1,4 +1,3 @@
-#include <config.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
@@ -20,12 +19,12 @@ bilinear_pad_repeat_get_scanline_bounds_ref (int32_t source_image_width,
int32_t * right_pad)
{
int w = *width;
+ int64_t vx = vx_;
*left_pad = 0;
*left_tz = 0;
*width = 0;
*right_tz = 0;
*right_pad = 0;
- int64_t vx = vx_;
while (--w >= 0)
{
if (vx < 0)
diff --git a/pixman/test/utils.h b/pixman/test/utils.h
index 3790483db..b23925c4a 100644
--- a/pixman/test/utils.h
+++ b/pixman/test/utils.h
@@ -1,5 +1,8 @@
-#include <stdlib.h>
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
+#include <stdlib.h>
#include <assert.h>
#include "pixman-private.h" /* For 'inline' definition */