[gtk/gtk-3-24] meson: add a11y test



commit 014320bfb012e861cbdb15f1e0447a555c084682
Author: Christoph Reiter <creiter src gnome org>
Date:   Sat Apr 13 11:51:03 2019 +0200

    meson: add a11y test

 testsuite/a11y/Makefile.am          |   2 +-
 testsuite/a11y/accessibility-dump.c |   3 +-
 testsuite/a11y/meson.build          | 108 ++++++++++++++++++++++++++++++++++++
 testsuite/a11y/state/Makefile.am    |   2 +-
 testsuite/a11y/state/meson.build    |   4 ++
 testsuite/meson.build               |   1 +
 6 files changed, 117 insertions(+), 3 deletions(-)
---
diff --git a/testsuite/a11y/Makefile.am b/testsuite/a11y/Makefile.am
index c51e55eec3..73519e9dea 100644
--- a/testsuite/a11y/Makefile.am
+++ b/testsuite/a11y/Makefile.am
@@ -99,7 +99,7 @@ test_in_files = \
        a11ymisc.test.in \
        $(NULL)
 
-EXTRA_DIST += $(test_in_files) $(testdata)
+EXTRA_DIST += $(test_in_files) $(testdata) meson.build
 
 GTK_GSETTINGS_SCHEMAS = \
        $(top_srcdir)/gtk/org.gtk.Settings.ColorChooser.gschema.xml \
diff --git a/testsuite/a11y/accessibility-dump.c b/testsuite/a11y/accessibility-dump.c
index 2986f297f6..bcaa48e906 100644
--- a/testsuite/a11y/accessibility-dump.c
+++ b/testsuite/a11y/accessibility-dump.c
@@ -928,7 +928,8 @@ parse_command_line (int *argc, char ***argv)
   gtk_test_init (argc, argv);
 
   schema_dir = g_test_build_filename (G_TEST_BUILT, "", NULL);
-  g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
+  if (g_getenv ("GTK_TEST_MESON") == NULL)
+    g_setenv ("GSETTINGS_SCHEMA_DIR", schema_dir, TRUE);
   g_free (schema_dir);
 
   /* gtk_test_init does not call setlocale(), so do it ourselves,
diff --git a/testsuite/a11y/meson.build b/testsuite/a11y/meson.build
new file mode 100644
index 0000000000..2da615fe83
--- /dev/null
+++ b/testsuite/a11y/meson.build
@@ -0,0 +1,108 @@
+a11y_state_tests = [
+  'hello-world',
+  'mnemonic',
+  'accessible-name',
+  'notebook',
+  'range',
+  'link',
+  'text',
+  'buttons',
+  'colorchooser',
+  'about',
+  'messagedialog',
+  'expander',
+  'assistant',
+  'pickers',
+  'label',
+  'lockbutton',
+  'spinner',
+  'progress',
+  'infobar',
+  'calendar',
+  'statusbar',
+  'paned',
+  'iconview',
+  'entries',
+  'scale-drawvalue',
+  'placeholder-text',
+  'menus',
+  'menu',
+  'menubutton',
+  'menubutton2',
+  'menubutton3',
+  'combos',
+  'listbox',
+  'stack',
+  'headerbar',
+  'tree',
+  'actionbar',
+  'tooltips',
+]
+
+skipped_tests = [
+  # gtk_color_picker_new() in CI returns NULL which changes the UI
+  'colorchooser',
+]
+
+a11y_testfocus_bin = executable('testfocus',
+  'testfocus.c',
+  dependencies: libgtk_dep,
+)
+
+a11y_dump_bin = executable('accessibility-dump',
+  'accessibility-dump.c',
+  dependencies: libgtk_dep,
+)
+
+foreach t: a11y_state_tests
+  if t not in skipped_tests
+    ui_path = join_paths(meson.current_source_dir(), t + '.ui')
+    test (t + ' state',
+      a11y_dump_bin,
+      args: [ '--tap', '-k', ui_path ],
+      env: [
+        'GIO_USE_VOLUME_MONITOR=unix',
+        'GSETTINGS_BACKEND=memory',
+        'GTK_CSD=0',
+        'G_ENABLE_DIAGNOSTIC=0',
+        'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+        'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
+        'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
+        'GTK_TEST_MESON=1',
+      ],
+      suite: 'a11y',
+    )
+  endif
+endforeach
+
+a11y_tests = [
+  'tree-performance',
+  'text',
+  'children',
+  'derive',
+  'value',
+  'misc',
+  'tree-relationships',
+  'util',
+]
+
+foreach t: a11y_tests
+  test_prefix = 'a11y'
+
+  test (t,
+        executable (t, '@0@.c'.format(t),
+                    dependencies: libgtk_dep),
+        args: [ '--tap', '-k', ],
+        timeout: 120,
+        env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+               'GSETTINGS_BACKEND=memory',
+               'GTK_CSD=1',
+               'G_ENABLE_DIAGNOSTIC=0',
+               'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+               'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
+               'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
+             ],
+        suite: 'a11y')
+endforeach
+
+subdir('state')
diff --git a/testsuite/a11y/state/Makefile.am b/testsuite/a11y/state/Makefile.am
index 2861d4dcd5..4ff4dfdab6 100644
--- a/testsuite/a11y/state/Makefile.am
+++ b/testsuite/a11y/state/Makefile.am
@@ -28,7 +28,7 @@ testdata = \
        focus1.ui focus1.in focus1.out \
        focus2.ui focus2.in focus2.out
 
-EXTRA_DIST += $(testdata)
+EXTRA_DIST += $(testdata) meson.build
 
 if BUILDOPT_INSTALL_TESTS
 insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)
diff --git a/testsuite/a11y/state/meson.build b/testsuite/a11y/state/meson.build
new file mode 100644
index 0000000000..0c792f6d00
--- /dev/null
+++ b/testsuite/a11y/state/meson.build
@@ -0,0 +1,4 @@
+a11y_state_record_bin = executable('state-record',
+  'state-record.c',
+  dependencies: libgtk_dep,
+)
diff --git a/testsuite/meson.build b/testsuite/meson.build
index a3507d5e06..33ecba05df 100644
--- a/testsuite/meson.build
+++ b/testsuite/meson.build
@@ -1,3 +1,4 @@
 subdir('gtk')
 subdir('gdk')
 subdir('css')
+subdir('a11y')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]