c7d8e0f4d9d60cb46da9a0b7d6b96bc795a4b017
[platform/core/uifw/at-spi2-atk.git] / tests / clients / testutil.py
1 #Bus name where test application can be found.
2 busname = "test.atspi.tree"
3
4 #Path of tree interface on test application.
5 objectpath = "/org/freedesktop/atspi/tree"
6
7 #Directory where test data, such as XML results
8 #can be found.
9 testdata = "./"
10
11 #Location of test application.
12 testapp = "../apps/test-application"
13
14 #Directory of test application modules.
15 testmodules = "../apps/.libs"
16
17 #Atk to at-spi adaptor library location.
18 atspilib = "../../atk-adaptor/.libs/libspiatk.so"
19
20
21 def runTestApp(module_name):
22         import os
23         from subprocess import Popen
24
25         testmodule = os.path.join(testmodules, module_name)
26         pop = Popen([testapp , "-a", atspilib, "-t", testmodule, "-d", testdata])
27
28         wait_envar = "TEST_APP_WAIT_FOR_DEBUG"
29
30         wait_message = """
31         The test application %s has been started with PID %d.
32         
33         To continue the test press ENTER.\n\n
34         """
35
36         if (wait_envar in os.environ.keys()):
37                 raw_input(wait_message % (module_name, pop.pid))