e11302a77fbd2d4a0475a5e83c6496cc8835e0ab
[platform/core/uifw/at-spi2-atk.git] / tests / pyatspi / testutil.py
1
2 def runTestApp(module_name, dbus_name):
3         import os
4         from subprocess import Popen
5
6         test_data_directory = os.environ["TEST_DATA_DIRECTORY"]
7         test_modules_directory = os.environ["TEST_MODULES_DIRECTORY"]
8         test_atspi_library = os.environ["TEST_ATSPI_LIBRARY"]
9         test_application = os.environ["TEST_APPLICATION"]
10
11         test_module = os.path.join(test_modules_directory, module_name)
12         pop = Popen([test_application,
13                 "--atspi-dbus-name", dbus_name,
14                 "--test-atspi-library", test_atspi_library,
15                 "--test-module", test_module,
16                 "--test-data-directory", test_data_directory,])
17
18         print " ".join([test_application,
19                 "--atspi-dbus-name", dbus_name,
20                 "--test-atspi-library", test_atspi_library,
21                 "--test-module", test_module,
22                 "--test-data-directory", test_data_directory,])
23
24         wait_message = """
25         The test application %s has been started with PID %d.
26         
27         To continue the test press ENTER.\n\n
28         """
29         if ("TEST_APP_WAIT_FOR_DEBUG" in os.environ.keys()):
30                 raw_input(wait_message % (module_name, pop.pid))