summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte.benjamin@googlemail.com>2019-04-13 00:02:19 +0000
committerBenjamin Otte <otte.benjamin@googlemail.com>2019-04-13 00:02:19 +0000
commitb11c69b4a8ad4a7496f2d3cbc3092b6fe7c17224 (patch)
treeffc222b6e8465e2945e6efcd7ddf544d879b1241
parent9a1da43890d4e5187c5ea33c6d0b7b52376e1778 (diff)
parent84351ba9e523968003dcbcf1100ebe3f0f78b129 (diff)
downloadgtk+-b11c69b4a8ad4a7496f2d3cbc3092b6fe7c17224.tar.gz
Merge branch 'fix-reftests' into 'master'
Fix reftests See merge request GNOME/gtk!746
-rw-r--r--testsuite/reftests/gtk-reftest.c30
-rw-r--r--testsuite/reftests/label-shadows.ref.ui210
-rw-r--r--testsuite/reftests/label-shadows.ui65
-rw-r--r--testsuite/reftests/meson.build2
-rw-r--r--testsuite/reftests/textview-margins.ref.ui2
-rw-r--r--testsuite/reftests/textview-margins.ui2
6 files changed, 144 insertions, 167 deletions
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 3a4792e031..b0fb5741f6 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -86,10 +86,9 @@ parse_command_line (int *argc, char ***argv)
}
static const char *
-get_output_dir (void)
+get_output_dir (GError **error)
{
static const char *output_dir = NULL;
- GError *error = NULL;
if (output_dir)
return output_dir;
@@ -110,8 +109,9 @@ get_output_dir (void)
GFile *file;
file = g_file_new_for_path (output_dir);
- g_assert (g_file_make_directory_with_parents (file, NULL, &error));
- g_assert_no_error (error);
+ if (!g_file_make_directory_with_parents (file, NULL, error))
+ return NULL;
+
g_object_unref (file);
}
@@ -140,12 +140,17 @@ get_components_of_test_file (const char *test_file,
}
static char *
-get_output_file (const char *test_file,
- const char *extension)
+get_output_file (const char *test_file,
+ const char *extension,
+ GError **error)
{
- const char *output_dir = get_output_dir ();
+ const char *output_dir;
char *result, *base;
+ output_dir = get_output_dir (error);
+ if (output_dir == NULL)
+ return NULL;
+
get_components_of_test_file (test_file, NULL, &base);
result = g_strconcat (output_dir, G_DIR_SEPARATOR_S, base, extension, NULL);
@@ -242,7 +247,16 @@ save_image (cairo_surface_t *surface,
const char *test_name,
const char *extension)
{
- char *filename = get_output_file (test_name, extension);
+ GError *error = NULL;
+ char *filename;
+
+ filename = get_output_file (test_name, extension, &error);
+ if (filename == NULL)
+ {
+ g_test_message ("Not storing test result image: %s", error->message);
+ g_error_free (error);
+ return;
+ }
g_test_message ("Storing test result image at %s", filename);
g_assert (cairo_surface_write_to_png (surface, filename) == CAIRO_STATUS_SUCCESS);
diff --git a/testsuite/reftests/label-shadows.ref.ui b/testsuite/reftests/label-shadows.ref.ui
index e4f582acfd..4761ff9ec2 100644
--- a/testsuite/reftests/label-shadows.ref.ui
+++ b/testsuite/reftests/label-shadows.ref.ui
@@ -1,135 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <object class="GtkWindow" id="window1">
+ <object class="GtkWindow">
<property name="type">popup</property>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkFixed">
+ <property name="width-request">200</property>
+ <property name="height-request">200</property>
<child>
- <object class="GtkFixed" id="fixed1">
- <child>
- <object class="GtkLabel" id="shadow1">
- <property name="label" translatable="yes">ABC</property>
- <attributes>
- <attribute name="foreground" value="#ffff00000000"></attribute>
- </attributes>
- <style>
- <class name="no-shadow"/>
- </style>
- <layout>
- <property name="position">translate(2, 2)</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="label" translatable="yes">ABC</property>
- <style>
- <class name="no-shadow"/>
- </style>
- </object>
- </child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(50, 50) rotate(0) translate(-49,-49)</property>
</layout>
+ <attributes>
+ <attribute name="foreground" value="#ffff00000000"></attribute>
+ </attributes>
+ <style>
+ <class name="no-shadow"/>
+ </style>
</object>
</child>
<child>
- <object class="GtkFixed" id="fixed2">
- <child>
- <object class="GtkLabel" id="shadow2">
- <property name="label" translatable="yes">ABC</property>
- <attributes>
- <attribute name="foreground" value="#ffff00000000"></attribute>
- </attributes>
- <style>
- <class name="no-shadow"/>
- </style>
- <layout>
- <property name="position">translate(2, 0)</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="label" translatable="yes">ABC</property>
- <style>
- <class name="no-shadow"/>
- </style>
- </object>
- </child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(50, 50) rotate(0) translate(-50,-50)</property>
</layout>
+ <style>
+ <class name="no-shadow"/>
+ </style>
</object>
</child>
<child>
- <object class="GtkFixed" id="fixed3">
- <child>
- <object class="GtkLabel" id="shadow3">
- <property name="label" translatable="yes">ABC</property>
- <attributes>
- <attribute name="foreground" value="#ffff00000000"></attribute>
- </attributes>
- <style>
- <class name="no-shadow"/>
- </style>
- <layout>
- <property name="position">translate(0, 0)</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="label" translatable="yes">ABC</property>
- <style>
- <class name="no-shadow"/>
- </style>
- </object>
- </child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(150, 50) rotate(90) translate(-49,-49)</property>
</layout>
+ <attributes>
+ <attribute name="foreground" value="#ffff00000000"></attribute>
+ </attributes>
+ <style>
+ <class name="no-shadow"/>
+ </style>
</object>
</child>
<child>
- <object class="GtkFixed" id="fixed4">
- <child>
- <object class="GtkLabel" id="shadow4">
- <property name="label" translatable="yes">ABC</property>
- <attributes>
- <attribute name="foreground" value="#ffff00000000"></attribute>
- </attributes>
- <style>
- <class name="no-shadow"/>
- </style>
- <layout>
- <property name="position">translate(0, 2)</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="label" translatable="yes">ABC</property>
- <style>
- <class name="no-shadow"/>
- </style>
- </object>
- </child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(150, 50) rotate(90) translate(-50,-50)</property>
</layout>
+ <style>
+ <class name="no-shadow"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
+ <layout>
+ <property name="position">translate(150, 150) rotate(180) translate(-49,-49)</property>
+ </layout>
+ <attributes>
+ <attribute name="foreground" value="#ffff00000000"></attribute>
+ </attributes>
+ <style>
+ <class name="no-shadow"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
+ <layout>
+ <property name="position">translate(150, 150) rotate(180) translate(-50,-50)</property>
+ </layout>
+ <style>
+ <class name="no-shadow"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
+ <layout>
+ <property name="position">translate(50, 150) rotate(180) translate(-49,-49)</property>
+ </layout>
+ <attributes>
+ <attribute name="foreground" value="#ffff00000000"></attribute>
+ </attributes>
+ <style>
+ <class name="no-shadow"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
+ <property name="label" translatable="yes">ABC</property>
+ <layout>
+ <property name="position">translate(50, 150) rotate(180) translate(-50,-50)</property>
+ </layout>
+ <style>
+ <class name="no-shadow"/>
+ </style>
</object>
</child>
</object>
diff --git a/testsuite/reftests/label-shadows.ui b/testsuite/reftests/label-shadows.ui
index d3093d6dca..bba30cda1d 100644
--- a/testsuite/reftests/label-shadows.ui
+++ b/testsuite/reftests/label-shadows.ui
@@ -1,76 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <object class="GtkWindow" id="window1">
+ <object class="GtkWindow">
<property name="type">popup</property>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkFixed">
+ <property name="width-request">200</property>
+ <property name="height-request">200</property>
<child>
- <object class="GtkLabel" id="label1">
- <property name="halign">start</property>
- <property name="valign">start</property>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
<property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(50, 50) rotate(0) translate(-50,-50)</property>
</layout>
</object>
</child>
<child>
- <object class="GtkLabel" id="label2">
- <property name="halign">start</property>
- <property name="valign">start</property>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
<property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(150, 50) rotate(90) translate(-50,-50)</property>
</layout>
</object>
</child>
<child>
- <object class="GtkLabel" id="label3">
- <property name="halign">start</property>
- <property name="valign">start</property>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
<property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(150, 150) rotate(180) translate(-50,-50)</property>
</layout>
</object>
</child>
<child>
- <object class="GtkLabel" id="label4">
- <property name="halign">start</property>
- <property name="valign">start</property>
+ <object class="GtkLabel">
+ <property name="width-request">100</property>
+ <property name="height-request">100</property>
<property name="label" translatable="yes">ABC</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="column-span">1</property>
- <property name="row-span">1</property>
+ <property name="position">translate(50, 150) rotate(180) translate(-50,-50)</property>
</layout>
</object>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
</child>
</object>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 38c98cb6e7..998d76349d 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -417,10 +417,8 @@ xfails = [
'background-origin.ui',
'border-half-pixel.ui',
'border-image-url.ui',
- 'label-shadows.ui',
'sizegroups-evolution-identity-page.ui',
'textview-border-windows.ui',
- 'textview-margins.ui',
'window-show-contents-on-map.ui',
]
diff --git a/testsuite/reftests/textview-margins.ref.ui b/testsuite/reftests/textview-margins.ref.ui
index b9a99288c8..3807b945fd 100644
--- a/testsuite/reftests/textview-margins.ref.ui
+++ b/testsuite/reftests/textview-margins.ref.ui
@@ -6,7 +6,7 @@
</object>
<object class="GtkWindow" id="window">
<property name="type">popup</property>
- <property name="default_width">106</property>
+ <property name="default_width">150</property>
<property name="resizable">0</property>
<child>
<object class="GtkTextView" id="textview1">
diff --git a/testsuite/reftests/textview-margins.ui b/testsuite/reftests/textview-margins.ui
index 275a0ab216..57f621b31b 100644
--- a/testsuite/reftests/textview-margins.ui
+++ b/testsuite/reftests/textview-margins.ui
@@ -6,7 +6,7 @@
</object>
<object class="GtkWindow" id="window">
<property name="type">popup</property>
- <property name="default_width">106</property>
+ <property name="default_width">150</property>
<property name="resizable">0</property>
<child>
<object class="GtkTextView" id="textview1">