diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-03-13 20:36:54 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-03-13 20:36:54 +0000 |
commit | 33db28c288c86f75c8387fce8bb29019773bf6d5 (patch) | |
tree | 1edb100949b894093a3ae913f09c9f8eab5b9910 | |
parent | 66a0a8d53e5970f404f234f367aed1838784f1d7 (diff) | |
parent | 7db490ef2afd1ba3d657cbc2eb888b6de20ac265 (diff) | |
download | gtk+-33db28c288c86f75c8387fce8bb29019773bf6d5.tar.gz |
Merge branch 'fix-tools-tests' into 'master'
Fix tools tests
See merge request GNOME/gtk!1524
20 files changed, 33 insertions, 72 deletions
diff --git a/testsuite/tools/meson.build b/testsuite/tools/meson.build index 1364a98679..fd385ba174 100644 --- a/testsuite/tools/meson.build +++ b/testsuite/tools/meson.build @@ -19,6 +19,7 @@ if bash.found() test(t, bash, args: t, workdir: meson.current_build_dir(), + protocol: 'tap', env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', 'GDK_DEBUG=default-settings', diff --git a/testsuite/tools/settings.in b/testsuite/tools/settings.in index 38a69c1b00..98c9acc04d 100755 --- a/testsuite/tools/settings.in +++ b/testsuite/tools/settings.in @@ -10,7 +10,7 @@ echo "1..1" name=gtk-query-settings result=$TEST_RESULT_DIR/$name.out $GTK_QUERY_SETTINGS 2>/dev/null >$result -if [ $(wc -l $result | cut -f1 -d' ') -eq 882 ]; then +if [ $(wc -l $result | cut -f1 -d' ') -eq 48 ]; then echo "ok 1 $name" else echo "not ok 1 $name" diff --git a/testsuite/tools/simplify-3to4.in b/testsuite/tools/simplify-3to4.in index 693e8bd05f..31d7da0970 100755 --- a/testsuite/tools/simplify-3to4.in +++ b/testsuite/tools/simplify-3to4.in @@ -1,7 +1,7 @@ #! /bin/bash GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool} -TEST_DATA_DIR=${TEST_DATA_DIR:-./simplify-data-3to4} +TEST_DATA_DIR=${G_TEST_SRCDIR:-.}/simplify-data-3to4 TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp} shopt -s nullglob diff --git a/testsuite/tools/simplify-data-3to4/popover.expected b/testsuite/tools/simplify-data-3to4/popover.expected index 84263bd86f..9f2cafebc7 100644 --- a/testsuite/tools/simplify-data-3to4/popover.expected +++ b/testsuite/tools/simplify-data-3to4/popover.expected @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <object class="GtkPopover" id="popover"> - <property name="modal">0</property> + <property name="autohide">0</property> </object> </interface> diff --git a/testsuite/tools/simplify-data/test1.expected b/testsuite/tools/simplify-data/test1.expected index de1472e5cd..23509c8237 100644 --- a/testsuite/tools/simplify-data/test1.expected +++ b/testsuite/tools/simplify-data/test1.expected @@ -1,5 +1,4 @@ -<!-- default property gets stripped --> +<?xml version="1.0" encoding="UTF-8"?> <interface> - <object class="GtkWindow"> - </object> + <object class="GtkWindow"/> </interface> diff --git a/testsuite/tools/simplify-data/test2.expected b/testsuite/tools/simplify-data/test2.expected index 99fefb9511..0bb3f4e18b 100644 --- a/testsuite/tools/simplify-data/test2.expected +++ b/testsuite/tools/simplify-data/test2.expected @@ -1,4 +1,4 @@ -<!-- non-default property not stripped --> +<?xml version="1.0" encoding="UTF-8"?> <interface> <object class="GtkWindow"> <property name="visible">1</property> diff --git a/testsuite/tools/simplify-data/test3.expected b/testsuite/tools/simplify-data/test3.expected index 6b9c07f163..511e7ee76b 100644 --- a/testsuite/tools/simplify-data/test3.expected +++ b/testsuite/tools/simplify-data/test3.expected @@ -1,4 +1,4 @@ -<!-- translatable property not stripped --> +<?xml version="1.0" encoding="UTF-8"?> <interface> <object class="GtkWindow"> <property name="visible" translatable="yes">0</property> diff --git a/testsuite/tools/simplify-data/test4.expected b/testsuite/tools/simplify-data/test4.expected index 286f1062ec..be8d6b5981 100644 --- a/testsuite/tools/simplify-data/test4.expected +++ b/testsuite/tools/simplify-data/test4.expected @@ -1,6 +1,6 @@ -<!-- irrelevant comments and context are stripped --> +<?xml version="1.0" encoding="UTF-8"?> <interface> <object class="GtkWindow"> - <property name="visible">1</property> + <property name="visible" comments="foo" context="bla">1</property> </object> </interface> diff --git a/testsuite/tools/simplify-data/test4.ui b/testsuite/tools/simplify-data/test4.ui index eb5b0f0ea6..cf9c66b091 100644 --- a/testsuite/tools/simplify-data/test4.ui +++ b/testsuite/tools/simplify-data/test4.ui @@ -1,4 +1,4 @@ -<!-- irrelevant comments and context are stripped --> +<!-- comments and context are preserved --> <interface> <object class="GtkWindow"> <property name="visible" comments="foo" context="bla">True</property> diff --git a/testsuite/tools/simplify-data/test5.expected b/testsuite/tools/simplify-data/test5.expected index 1fb898bc0e..24b18f4a52 100644 --- a/testsuite/tools/simplify-data/test5.expected +++ b/testsuite/tools/simplify-data/test5.expected @@ -1,8 +1,11 @@ -<!-- placeholders are stripped --> +<?xml version="1.0" encoding="UTF-8"?> <interface> <object class="GtkWindow"> <child> <object class="GtkBox"> + <child> + <placeholder/> + </child> </object> </child> </object> diff --git a/testsuite/tools/simplify-data/test5.ui b/testsuite/tools/simplify-data/test5.ui index e379abdb2c..66ccb2016b 100644 --- a/testsuite/tools/simplify-data/test5.ui +++ b/testsuite/tools/simplify-data/test5.ui @@ -1,4 +1,4 @@ -<!-- placeholders are stripped --> +<!-- placeholders are preserved --> <interface> <object class="GtkWindow"> <child> diff --git a/testsuite/tools/simplify-data/test6.expected b/testsuite/tools/simplify-data/test6.expected index 8d4495b50e..3ee19043ff 100644 --- a/testsuite/tools/simplify-data/test6.expected +++ b/testsuite/tools/simplify-data/test6.expected @@ -1,5 +1,6 @@ -<!-- non-canonical property name works --> +<?xml version="1.0" encoding="UTF-8"?> <interface> <object class="GtkWindow"> + <property name="default_height">200</property> </object> </interface> diff --git a/testsuite/tools/simplify-data/test6.ui b/testsuite/tools/simplify-data/test6.ui index e4f394dc21..c0a5673f10 100644 --- a/testsuite/tools/simplify-data/test6.ui +++ b/testsuite/tools/simplify-data/test6.ui @@ -2,5 +2,6 @@ <interface> <object class="GtkWindow"> <property name="default_width">-1</property> + <property name="default_height">200</property> </object> </interface> diff --git a/testsuite/tools/simplify-data/test7.expected b/testsuite/tools/simplify-data/test7.expected index a75c4d4570..22f627bfa8 100644 --- a/testsuite/tools/simplify-data/test7.expected +++ b/testsuite/tools/simplify-data/test7.expected @@ -1,8 +1,12 @@ -<!-- default child property gets stripped --> +<?xml version="1.0" encoding="UTF-8"?> <interface> - <object class="GtkBox"> + <object class="GtkGrid"> <child> - <object class="GtkLabel"/> + <object class="GtkLabel"> + <layout> + <property name="row-span">2</property> + </layout> + </object> </child> </object> </interface> diff --git a/testsuite/tools/simplify-data/test7.ui b/testsuite/tools/simplify-data/test7.ui index 52e0da2f4b..2b08eae6ad 100644 --- a/testsuite/tools/simplify-data/test7.ui +++ b/testsuite/tools/simplify-data/test7.ui @@ -1,12 +1,13 @@ -<!-- default child property gets stripped --> +<!-- default layout property gets stripped --> <interface> - <object class="GtkBox"> + <object class="GtkGrid"> <child> <object class="GtkLabel"> + <layout> + <property name="column-span">1</property> + <property name="row-span">2</property> + </layout> </object> - <packing> - <property name="expand">False</property> - </packing> </child> </object> </interface> diff --git a/testsuite/tools/simplify-data/test8.expected b/testsuite/tools/simplify-data/test8.expected deleted file mode 100644 index df3c4077e3..0000000000 --- a/testsuite/tools/simplify-data/test8.expected +++ /dev/null @@ -1,11 +0,0 @@ -<!-- non-default child property remains --> -<interface> - <object class="GtkBox"> - <child> - <object class="GtkLabel"/> - <packing> - <property name="expand">1</property> - </packing> - </child> - </object> -</interface> diff --git a/testsuite/tools/simplify-data/test8.ui b/testsuite/tools/simplify-data/test8.ui deleted file mode 100644 index 1aec7adfea..0000000000 --- a/testsuite/tools/simplify-data/test8.ui +++ /dev/null @@ -1,12 +0,0 @@ -<!-- non-default child property remains --> -<interface> - <object class="GtkBox"> - <child> - <object class="GtkLabel"> - </object> - <packing> - <property name="expand">True</property> - </packing> - </child> - </object> -</interface> diff --git a/testsuite/tools/simplify-data/test9.expected b/testsuite/tools/simplify-data/test9.expected deleted file mode 100644 index 731b05e586..0000000000 --- a/testsuite/tools/simplify-data/test9.expected +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <object class="GtkGrid"> - <child> - <object class="GtkLabel"> - <layout> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </layout> - </object> - </child> - </object> -</interface> diff --git a/testsuite/tools/simplify-data/test9.ui b/testsuite/tools/simplify-data/test9.ui deleted file mode 100644 index b64bf8c463..0000000000 --- a/testsuite/tools/simplify-data/test9.ui +++ /dev/null @@ -1,13 +0,0 @@ -<!-- non-default child property remains --> -<interface> - <object class="GtkGrid"> - <child> - <object class="GtkLabel"> - <layout> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </layout> - </object> - </child> - </object> -</interface> diff --git a/testsuite/tools/simplify.in b/testsuite/tools/simplify.in index 08059f3c17..c92c5c6d9c 100755 --- a/testsuite/tools/simplify.in +++ b/testsuite/tools/simplify.in @@ -1,7 +1,7 @@ #! /bin/bash GTK_BUILDER_TOOL=${GTK_BUILDER_TOOL:-gtk4-builder-tool} -TEST_DATA_DIR=${TEST_DATA_DIR:-./simplify-data} +TEST_DATA_DIR=${G_TEST_SRCDIR:-.}/simplify-data TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp} shopt -s nullglob |