2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
24 * Testing AT-SPI requires both a test application and AT client.
25 * Test applications are built using the Dummy ATK implementation: MyAtk.
26 * This file contains the entry point for all test applications.
27 * The test will provide its own implementation of atk_get_root,
28 * and as such provide all the application state for the test.
36 #include <atk-bridge.h>
38 #include "atk-object-xml-loader.h"
40 static AtkObject *root_accessible;
42 static GMainLoop *mainloop;
44 static gchar *tdata_path = NULL;
47 test_init (gchar *path)
52 g_print ("No test data file provided\n");
57 td = g_build_path (G_DIR_SEPARATOR_S, tdata_path, NULL, NULL);
58 root_accessible = ATK_OBJECT (atk_object_xml_parse (td));
65 return root_accessible;
71 return test_get_root ();
75 get_toolkit_name (void)
77 return strdup ("atspitesting-toolkit");
85 klass = g_type_class_ref (ATK_TYPE_UTIL);
86 klass->get_root = get_root;
87 klass->get_toolkit_name = get_toolkit_name;
88 g_type_class_unref (klass);
91 static GOptionEntry optentries[] = {
92 {"test-data-file", 0, 0, G_OPTION_ARG_STRING, &tdata_path, "Path to file of test data", NULL},
96 int main (int argc, char *argv[])
100 opt = g_option_context_new (NULL);
101 g_option_context_add_main_entries (opt, optentries, NULL);
102 g_option_context_set_ignore_unknown_options (opt, TRUE);
104 if (!g_option_context_parse (opt, &argc, &argv, &err))
105 g_error("Option parsing failed: %s\n", err->message);
108 test_init (tdata_path);
109 atk_bridge_adaptor_init (NULL, NULL);
111 mainloop = g_main_loop_new (NULL, FALSE);
112 g_main_loop_run (mainloop);