summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-10 14:42:12 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-07-10 14:42:12 +0000
commit47e75d6fcb32c5a59dca30b2b8ebf6a30d0e83f4 (patch)
tree61ab9a0ee2192253477db1586c4cc00bd84424f7 /tests
parent96bcf49c1b0d7a0dc82d2dd3b20ca340100be841 (diff)
parent2926528b5b8044591c9307e280eff3ae6bec48d5 (diff)
downloadpango-47e75d6fcb32c5a59dca30b2b8ebf6a30d0e83f4.tar.gz
Merge branch 'matthiasc/for-master' into 'master'
Add a way to show fonts in test-layout output See merge request GNOME/pango!371
Diffstat (limited to 'tests')
-rw-r--r--tests/test-common.c3
-rw-r--r--tests/test-layout.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/test-common.c b/tests/test-common.c
index 14e9941a..66493990 100644
--- a/tests/test-common.c
+++ b/tests/test-common.c
@@ -225,7 +225,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
PangoAttribute *
attribute_from_string (const char *string)
{
- char *s, *p;
+ const char *s;
+ char *p;
PangoAttribute *attr;
long long start, end;
GEnumClass *class;
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 4c27585e..ca9e5da5 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -34,6 +34,7 @@
static PangoContext *context;
+static gboolean opt_show_font;
static const gchar *
enum_value_nick (GType type, gint value)
@@ -160,7 +161,7 @@ dump_runs (PangoLayout *layout, GString *string)
i, index, item->num_chars, item->analysis.level,
gravity_name (item->analysis.gravity),
item->analysis.flags,
- "OMITTED", /* for some reason, this fails on build.gnome.org, so leave it out */
+ opt_show_font ? font : "OMITTED", /* for some reason, this fails on build.gnome.org, so leave it out */
script_name (item->analysis.script),
pango_language_to_string (item->analysis.language),
char_str);
@@ -362,7 +363,7 @@ test_file (const char *filename, GString *string)
char *p;
LayoutParams params;
PangoFontDescription *desc;
- PangoFontDescription *desc2;
+ const PangoFontDescription *desc2;
guint serial;
PangoRectangle ink_rect, logical_rect;
PangoRectangle ink_rect1, logical_rect1;
@@ -754,6 +755,9 @@ main (int argc, char *argv[])
const gchar *name;
gchar *path;
+ if (g_getenv ("PANGO_TEST_SHOW_FONT"))
+ opt_show_font = TRUE;
+
/* allow to easily generate expected output for new test cases */
if (argc > 1 && argv[1][0] != '-')
{