Add some tests

These test various aspects of ui file conversion.
This commit is contained in:
Matthias Clasen 2019-05-05 15:29:24 +00:00
parent d8e92d4859
commit d61e77dab4
9 changed files with 478 additions and 0 deletions

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkAssistant" id="window1">
<property name="type">popup</property>
<child>
<object class="GtkAssistantPage">
<property name="title" translatable="yes">Page 1</property>
<property name="child">
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">Button 1</property>
<property name="can_focus">1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkAssistantPage">
<property name="title" translatable="yes">Page 2</property>
<property name="child">
<object class="GtkButton" id="button2">
<property name="label" translatable="yes">Button 2</property>
<property name="can_focus">1</property>
</object>
</property>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkAssistant" id="window1">
<property name="can_focus">False</property>
<property name="type">popup</property>
<child>
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">Button 1</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="title" translatable="yes">Page 1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label" translatable="yes">Button 2</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="title" translatable="yes">Page 2</property>
</packing>
</child>
</object>
</interface>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window1">
<property name="type">popup</property>
<child>
<object class="GtkGrid" id="grid1">
<child>
<object class="GtkToggleButton" id="button1">
<property name="label" translatable="yes">Hello World!</property>
<property name="active">1</property>
<property name="can_focus">1</property>
<property name="receives_default">1</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="button2">
<property name="label" translatable="yes">Hello World!</property>
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<layout>
<property name="left_attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkRadioButton" id="button3">
<property name="label" translatable="yes">Hello World!</property>
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<layout>
<property name="left_attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkRadioButton" id="button4">
<property name="label" translatable="yes">Hello World!</property>
<property name="active">1</property>
<property name="group">button3</property>
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<layout>
<property name="left_attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkSwitch" id="button5">
<property name="active">1</property>
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<layout>
<property name="left_attach">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkSwitch" id="button6">
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<child internal-child="accessible">
<object class="AtkObject" id="button6-accessible">
<property name="accessible-name">Test switch</property>
</object>
</child>
<layout>
<property name="left_attach">5</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="button7">
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<property name="label">Text Button</property>
<layout>
<property name="top_attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="button8">
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<property name="halign">center</property>
<property name="valign">center</property>
<layout>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="button9">
<property name="can_focus">1</property>
<property name="receives_default">1</property>
<property name="halign">center</property>
<property name="valign">center</property>
<layout>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="column-span">2</property>
<property name="row-span">2</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="type">popup</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<child>
<object class="GtkToggleButton" id="button1">
<property name="label" translatable="yes">Hello World!</property>
<property name="visible">True</property>
<property name="active">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="button2">
<property name="label" translatable="yes">Hello World!</property>
<property name="visible">True</property>
<property name="active">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="button3">
<property name="label" translatable="yes">Hello World!</property>
<property name="visible">True</property>
<property name="active">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="button4">
<property name="label" translatable="yes">Hello World!</property>
<property name="visible">True</property>
<property name="active">True</property>
<property name="group">button3</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="button5">
<property name="visible">True</property>
<property name="active">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="button6">
<property name="visible">True</property>
<property name="active">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="button6-accessible">
<property name="accessible-name">Test switch</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button7">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="label">Text Button</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button8">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button9">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="width">2</property>
<property name="height">2</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window1">
<property name="type">popup</property>
<child>
<object class="GtkNotebook" id="notebook1">
<child>
<object class="GtkNotebookPage">
<property name="child">
<object class="GtkButton" id="page1">
<property name="label" translatable="yes">Yes</property>
</object>
</property>
<property name="tab">
<object class="GtkLabel" id="tab1">
<property name="label" translatable="yes">Tab 1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkNotebookPage">
<property name="child">
<object class="GtkButton" id="page2">
<property name="label" translatable="yes">No</property>
</object>
</property>
<property name="tab">
<object class="GtkLabel" id="tab2">
<property name="label" translatable="yes">Tab 2</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="type">popup</property>
<child>
<object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<child>
<object class="GtkButton" id="page1">
<property name="label" translatable="yes">Yes</property>
<property name="visible">True</property>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="tab1">
<property name="label" translatable="yes">Tab 1</property>
<property name="visible">True</property>
</object>
</child>
<child>
<object class="GtkButton" id="page2">
<property name="label" translatable="yes">No</property>
<property name="visible">True</property>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="tab2">
<property name="label" translatable="yes">Tab 2</property>
<property name="visible">True</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window1">
<property name="type">popup</property>
<child>
<object class="GtkBox" id="box1">
<child>
<object class="GtkStackSwitcher" id="stackswitcher1">
<property name="stack">stack1</property>
</object>
</child>
<child>
<object class="GtkStack" id="stack1">
<child>
<object class="GtkStackPage">
<property name="name">page1</property>
<property name="title">Page 1</property>
<property name="needs-attention">1</property>
<property name="child">
<object class="GtkButton" id="page1">
<property name="label" translatable="yes">Yes</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">page2</property>
<property name="title">Page 2</property>
<property name="icon-name">page2-icon</property>
<property name="child">
<object class="GtkButton" id="page2">
<property name="label" translatable="yes">No</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="type">popup</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<child>
<object class="GtkStackSwitcher" id="stackswitcher1">
<property name="visible">True</property>
<property name="stack">stack1</property>
</object>
</child>
<child>
<object class="GtkStack" id="stack1">
<property name="visible">True</property>
<child>
<object class="GtkButton" id="page1">
<property name="label" translatable="yes">Yes</property>
<property name="visible">True</property>
</object>
<packing>
<property name="name">page1</property>
<property name="title">Page 1</property>
<property name="needs-attention">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="page2">
<property name="label" translatable="yes">No</property>
<property name="visible">True</property>
</object>
<packing>
<property name="name">page2</property>
<property name="title">Page 2</property>
<property name="icon-name">page2-icon</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<child>
<object class="GtkLabel">
<property name="visible">0</property>
</object>
</child>
</object>
</interface>