summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--configure.ac2
-rw-r--r--src/cairo-truetype-subset.c4
-rw-r--r--test/cairo-test-runner.c6
-rwxr-xr-xtest/mime-unique-id.c20
-rw-r--r--test/pdf-mime-data.c10
-rwxr-xr-x[-rw-r--r--]util/cairo-trace/cairo-trace.in0
-rw-r--r--util/cairo-trace/meson.build1
8 files changed, 37 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index add22d658..29b90ea85 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,7 +11,7 @@ variables:
FDO_DISTRIBUTION_TAG: '2020-09-29.0'
# TODO: should probably get its own image at some point instead of reusing the GStreamer one.
- WINDOWS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v12-master"
+ WINDOWS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v16-master"
DEFAULT_MESON_ARGS: >
--default-library=both
diff --git a/configure.ac b/configure.ac
index 6444a3da3..c4373c3e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ AC_CONFIG_HEADERS(config.h)
AC_CHECK_HEADERS([unistd.h sys/ioctl.h])
AC_C_TYPEOF
-AM_INIT_AUTOMAKE([1.11 foreign -Wall no-define no-dist-gzip dist-xz])
+AM_INIT_AUTOMAKE([1.11 foreign -Wall no-define no-dist-gzip dist-xz serial-tests])
AM_SILENT_RULES([yes])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Workaround for Automake 1.12
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 7f0445df4..f5f06defc 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -628,8 +628,10 @@ cairo_truetype_font_write_glyf_table (cairo_truetype_font_t *font,
status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
TT_TAG_loca, 0, u.bytes, &size);
- if (unlikely (status))
+ if (unlikely (status)) {
+ free (u.bytes);
return _cairo_truetype_font_set_error (font, status);
+ }
start_offset = _cairo_array_num_elements (&font->output);
for (i = 0; i < font->num_glyphs; i++) {
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 779addf5b..551a4e072 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -208,6 +208,9 @@ _cairo_test_runner_preamble (cairo_test_runner_t *runner,
if (! runner->foreground) {
pid_t pid;
+ /* fork() duplicates output buffers, so clear them */
+ fflush (NULL);
+
switch ((pid = fork ())) {
case -1: /* error */
return CAIRO_TEST_UNTESTED;
@@ -234,6 +237,9 @@ _cairo_test_runner_draw (cairo_test_runner_t *runner,
if (! runner->foreground) {
pid_t pid;
+ /* fork() duplicates output buffers, so clear them */
+ fflush (NULL);
+
switch ((pid = fork ())) {
case -1: /* error */
return CAIRO_TEST_UNTESTED;
diff --git a/test/mime-unique-id.c b/test/mime-unique-id.c
index bdd056137..aab93164d 100755
--- a/test/mime-unique-id.c
+++ b/test/mime-unique-id.c
@@ -48,6 +48,7 @@
#include <math.h>
#include <stdio.h>
+#include <errno.h>
#include <cairo.h>
@@ -81,12 +82,25 @@
*/
#define PS2_EXPECTED_SIZE 417510
#define PS3_EXPECTED_SIZE 381554
-#define PDF_EXPECTED_SIZE 347182
+#define PDF_EXPECTED_SIZE 162923
#define SIZE_TOLERANCE 5000
static const char *png_filename = "romedalen.png";
static const char *jpeg_filename = "romedalen.jpg";
+static FILE *
+my_fopen (cairo_test_context_t *ctx, const char *pathname, const char *mode)
+{
+ FILE *f = fopen (pathname, mode);
+ if (f == NULL && errno == ENOENT && ctx->srcdir) {
+ char *srcdir_pathname;
+ xasprintf (&srcdir_pathname, "%s/%s", ctx->srcdir, pathname);
+ f = fopen (srcdir_pathname, mode);
+ free (srcdir_pathname);
+ }
+ return f;
+}
+
static cairo_test_status_t
create_image_surface (cairo_test_context_t *ctx, cairo_surface_t **surface)
{
@@ -117,7 +131,7 @@ create_recording_surface_with_mime_jpg (cairo_test_context_t *ctx, cairo_surface
cairo_rectangle_t extents = { 0, 0, 1, 1 };
*surface = cairo_recording_surface_create (CAIRO_CONTENT_COLOR_ALPHA, &extents);
- f = fopen (jpeg_filename, "rb");
+ f = my_fopen (ctx, jpeg_filename, "rb");
if (f == NULL) {
cairo_test_log (ctx, "Unable to open file %s\n", jpeg_filename);
return CAIRO_TEST_FAILURE;
@@ -372,7 +386,7 @@ check_file_size (cairo_test_context_t *ctx, const char *filename, long expected_
FILE *f;
long size;
- f = fopen (filename, "rb");
+ f = my_fopen (ctx, filename, "rb");
if (f == NULL) {
cairo_test_log (ctx, "Unable to open file %s\n", filename);
return CAIRO_TEST_FAILURE;
diff --git a/test/pdf-mime-data.c b/test/pdf-mime-data.c
index 69fafa145..5052f3dac 100644
--- a/test/pdf-mime-data.c
+++ b/test/pdf-mime-data.c
@@ -112,7 +112,13 @@ preamble (cairo_test_context_t *ctx)
if (! cairo_test_is_target_enabled (ctx, "pdf"))
return CAIRO_TEST_UNTESTED;
- image = cairo_image_surface_create_from_png (IMAGE_FILE ".png");
+ exit_status = system ("command -v pdfimages");
+ if (exit_status) {
+ cairo_test_log (ctx, "pdfimages not available\n");
+ return CAIRO_TEST_UNTESTED;
+ }
+
+ image = cairo_test_create_surface_from_png (ctx, IMAGE_FILE ".png");
test_status = read_file (ctx, IMAGE_FILE ".jpg", &data, &len);
if (test_status) {
return test_status;
@@ -134,7 +140,7 @@ preamble (cairo_test_context_t *ctx)
cairo_destroy (cr);
cairo_surface_finish (surface);
status2 = cairo_surface_status (surface);
- if (status != CAIRO_STATUS_SUCCESS)
+ if (status == CAIRO_STATUS_SUCCESS)
status = status2;
cairo_surface_destroy (surface);
cairo_surface_destroy (image);
diff --git a/util/cairo-trace/cairo-trace.in b/util/cairo-trace/cairo-trace.in
index ece90d3eb..ece90d3eb 100644..100755
--- a/util/cairo-trace/cairo-trace.in
+++ b/util/cairo-trace/cairo-trace.in
diff --git a/util/cairo-trace/meson.build b/util/cairo-trace/meson.build
index e836f98cf..7048786eb 100644
--- a/util/cairo-trace/meson.build
+++ b/util/cairo-trace/meson.build
@@ -31,4 +31,5 @@ configure_file(input: 'cairo-trace.in',
configuration: trace_conf,
install: true,
install_dir: join_paths(get_option('prefix'), get_option('bindir')),
+ install_mode: 'rwxr-xr-x',
)