From 722e620f20fa2225cf874f4aeb115a064142fcf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 26 Sep 2016 11:51:36 +0200 Subject: [PATCH] Use G_TEST_DIST to build the path of math test fonts --- test/api/Makefile.am | 2 ++ test/api/test-ot-layout-math.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/api/Makefile.am b/test/api/Makefile.am index 322cd7d2a..27520ffe8 100644 --- a/test/api/Makefile.am +++ b/test/api/Makefile.am @@ -83,6 +83,8 @@ TESTS_ENVIRONMENT = \ G_DEBUG=gc-friendly \ G_SLICE=always-malloc \ srcdir=$(srcdir) \ + G_TEST_SRCDIR=$(abs_srcdir) \ + G_TEST_BUILDDIR=$(abs_builddir) \ $(NULL) diff --git a/test/api/test-ot-layout-math.c b/test/api/test-ot-layout-math.c index d7121a2a2..93dab740a 100644 --- a/test/api/test-ot-layout-math.c +++ b/test/api/test-ot-layout-math.c @@ -54,12 +54,16 @@ cleanupFreeType (void) static void openFont(const char* fontFile) { + gchar* path = g_test_build_filename(G_TEST_DIST, fontFile, NULL); + FT_Error ft_error; - if ((ft_error = FT_New_Face (ft_library, fontFile, 0, &ft_face))) + if ((ft_error = FT_New_Face (ft_library, path, 0, &ft_face))) { + g_free(path); abort(); + } + g_free(path); #define fontSize 1000 - if ((ft_error = FT_Set_Char_Size (ft_face, fontSize, fontSize, 0, 0))) abort(); hb_font = hb_ft_font_create (ft_face, NULL);