-SUBDIRS=dummyatk apps clients
+SUBDIRS = dummyatk apps clients
+EXTRA_DIST = testrunner.py runtests.sh
-EXTRA_DIST = testrunner.py
+TESTS=testrunner.py
+TESTS_ENVIRONMENT = PYTHONPATH=$(abs_top_srcdir)/python \
+ ATSPI_INTROSPECTION_PATH=$(top_srcdir)/xml/introspection \
+ testdata=$(abs_top_srcdir)/tests/data \
+ atspilib=$(abs_top_srcdir)/atk-adaptor/.libs/libspiatk.so \
+ testmodules=$(abs_top_srcdir)/tests/apps/.libs \
+ testapp=$(abs_top_srcdir)/tests/apps/test-application
+
+CLEANFILES = *.pyc
EXTRA_DIST = \
accessibleobject.py \
__init__.py \
- object-test-stage1.xml \
testutil.py
+
+CLEANFILES = *.pyc
def runTest(self):
root = self._cache.getRootAccessible()
+
doc = minidom.Document()
createNode(root, doc)
answer = doc.toprettyxml()
- correct = os.path.join(testutil.testdata, "object-test-stage1.xml")
+
+ correct = os.path.join(testutil.testdata, "object-test-stage1-results.xml")
file = open(correct)
cstring = file.read()
+
+ #import difflib
+ #print ''.join(difflib.unified_diff(answer.splitlines(), cstring.splitlines()))
+
self.assertEqual(answer, cstring, "Object tree not passed correctly")
+++ /dev/null
-<?xml version="1.0" ?>
-<accessible description="" name="main" role="68">
- <accessible description="" name="gnome-settings-daemon" role="77"/>
- <accessible description="" name="gnome-panel" role="77">
- <accessible description="" name="Bottom Expanded Edge Panel" role="24"/>
- <accessible description="" name="Top Expanded Edge Panel" role="24"/>
- </accessible>
- <accessible description="" name="nautilus" role="77">
- <accessible description="" name="Desktop" role="24"/>
- </accessible>
- <accessible description="" name="metacity" role="77"/>
- <accessible description="" name="tracker-applet" role="77"/>
- <accessible description="" name="empathy" role="77">
- <accessible description="" name="Contact List" role="24"/>
- </accessible>
- <accessible description="" name="nm-applet" role="77"/>
- <accessible description="" name="gnome-power-manager" role="77"/>
- <accessible description="" name="update-notifier" role="77"/>
- <accessible description="Firefox Application Accessible" name="Firefox" role="77">
- <accessible description="Firefox Application Accessible" name="Google Reader - Mozilla Firefox 3 Beta 5" role="24">
- <accessible description="" name="" role="34"/>
- <accessible description="" name="Strip originally conceived in conversation with Jeph Jacques. Soon to be a major motion picture." role="65"/>
- <accessible description="" name="" role="67">
- <accessible description="" name="" role="32">
- <accessible description="" name="" role="10"/>
- <accessible description="" name="" role="10"/>
- </accessible>
- </accessible>
- <accessible description="" name="" role="34">
- <accessible description="" name="" role="68"/>
- </accessible>
- <accessible description="" name="" role="34"/>
- <accessible description="" name="" role="34"/>
- <accessible description="" name="" role="34"/>
- <accessible description="" name="" role="34"/>
- <accessible description="" name="" role="34"/>
- <accessible description="" name="" role="65"/>
- <accessible description="" name="" role="65"/>
- <accessible description="" name="" role="64">
- <accessible description="" name="Application" role="35"/>
- <accessible description="" name="" role="51"/>
- <accessible description="" name="Activity Indicator" role="44"/>
- </accessible>
- <accessible description="" name="" role="64">
- <accessible description="Go back one page" name="Back" role="44"/>
- <accessible description="Go forwards one page" name="Forward" role="44"/>
- <accessible description="" name="" role="44"/>
- <accessible description="Reload current page" name="Reload" role="44"/>
- <accessible description="Stop loading this page" name="Stop" role="44"/>
- <accessible description="chrome://ubufox/content/startpage.html" name="Home" role="44"/>
- <accessible description="" name="Location" role="78"/>
- <accessible description="" name="Search using Google" role="78"/>
- </accessible>
- <accessible description="" name="" role="64">
- <accessible description="" name="Smart Bookmarks" role="44"/>
- <accessible description="" name="Getting Started" role="44"/>
- <accessible description="" name="Latest Headlines" role="44"/>
- </accessible>
- <accessible description="" name="" role="40">
- <accessible description="" name="Google Reader" role="65"/>
- <accessible description="" name="" role="34"/>
- <accessible description="" name="" role="39"/>
- <accessible description="" name="" role="50"/>
- <accessible description="" name="" role="50">
- <accessible description="" name="Google Reader" role="29">
- <accessible description="" name="Google Reader" role="84">
- <accessible description="" name="Click here for ARIA enhanced Google Reader." role="70"/>
- <accessible description="" name="" role="87"/>
- <accessible description="" name="" role="87"/>
- <accessible description="" name="" role="87"/>
- <accessible description="" name="Google Reader" role="70"/>
- <accessible description="" name="" role="62"/>
- <accessible description="" name="" role="87"/>
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="87"/>
- <accessible description="" name="" role="87"/>
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="56"/>
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="56"/>
- <accessible description="" name="" role="56">
- <accessible description="" name="" role="57">
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="87"/>
- <accessible description="" name="" role="62"/>
- <accessible description="" name="Google News" role="70"/>
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="87"/>
- <accessible description="" name="" role="87">
- <accessible description="" name="Reader and ARIA: A new way to read" role="70"/>
- </accessible>
- <accessible description="" name="" role="87">
- <accessible description="" name="Official Google Reader Blog" role="70"/>
- </accessible>
- <accessible description="" name="" role="87"/>
- </accessible>
- </accessible>
- </accessible>
- <accessible description="" name="" role="57"/>
- </accessible>
- </accessible>
- <accessible description="" name="" role="87">
- <accessible description="" name="Google Reader Blog" role="70"/>
- <accessible description="" name="Discuss" role="70"/>
- <accessible description="" name="Privacy Policy" role="70"/>
- <accessible description="" name="Help" role="70"/>
- <accessible description="" name="" role="87"/>
- </accessible>
- </accessible>
- </accessible>
- </accessible>
- </accessible>
- <accessible description="" name="" role="87">
- <accessible description="" name="" role="28"/>
- <accessible description="" name="" role="28"/>
- <accessible description="" name="" role="28"/>
- <accessible description="" name="" role="28"/>
- <accessible description="" name="" role="28"/>
- </accessible>
- </accessible>
- </accessible>
- </accessible>
- </accessible>
- <accessible description="" name="" role="34"/>
- <accessible description="" name="" role="55">
- <accessible description="" name="Done" role="44"/>
- <accessible description="" name="" role="44"/>
- </accessible>
- </accessible>
- </accessible>
- <accessible description="" name="gnome-terminal" role="77">
- <accessible description="" name="mdoff@silver-wind: ~/Projects/accessibility/dbus-atspi/test" role="24"/>
- </accessible>
-</accessible>
#Atk to at-spi adaptor library location.
atspilib = "../../atk-adaptor/.libs/libspiatk.so"
-from subprocess import Popen
-from os.path import join
def runTestApp(module_name):
- testmodule = join(testmodules, module_name)
- print testmodule
- print testapp
- return Popen([testapp , "-a", atspilib, "-t", testmodule, "-d", testdata])
+ import os
+ from subprocess import Popen
+
+ testmodule = os.path.join(testmodules, module_name)
+ pop = Popen([testapp , "-a", atspilib, "-t", testmodule, "-d", testdata])
+
+ wait_envar = "TEST_APP_WAIT_FOR_DEBUG"
+
+ wait_message = """
+ The test application %s has been started with PID %d.
+
+ To continue the test press ENTER.\n\n
+ """
+
+ if (wait_envar in os.environ.keys()):
+ raw_input(wait_message % (module_name, pop.pid))
--- /dev/null
+<?xml version="1.0" ?>
+<accessible description="" name="main" role="69">
+ <accessible description="" name="gnome-settings-daemon" role="79"/>
+ <accessible description="" name="gnome-panel" role="79">
+ <accessible description="" name="Bottom Expanded Edge Panel" role="25"/>
+ <accessible description="" name="Top Expanded Edge Panel" role="25"/>
+ </accessible>
+ <accessible description="" name="nautilus" role="79">
+ <accessible description="" name="Desktop" role="25"/>
+ </accessible>
+ <accessible description="" name="metacity" role="79"/>
+ <accessible description="" name="tracker-applet" role="79"/>
+ <accessible description="" name="empathy" role="79">
+ <accessible description="" name="Contact List" role="25"/>
+ </accessible>
+ <accessible description="" name="nm-applet" role="79"/>
+ <accessible description="" name="gnome-power-manager" role="79"/>
+ <accessible description="" name="update-notifier" role="79"/>
+ <accessible description="Firefox Application Accessible" name="Firefox" role="79">
+ <accessible description="Firefox Application Accessible" name="Google Reader - Mozilla Firefox 3 Beta 5" role="25">
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="Strip originally conceived in conversation with Jeph Jacques. Soon to be a major motion picture." role="66"/>
+ <accessible description="" name="" role="68">
+ <accessible description="" name="" role="33">
+ <accessible description="" name="" role="10"/>
+ <accessible description="" name="" role="10"/>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="35">
+ <accessible description="" name="" role="69"/>
+ </accessible>
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="" role="66"/>
+ <accessible description="" name="" role="66"/>
+ <accessible description="" name="" role="65">
+ <accessible description="" name="Application" role="36"/>
+ <accessible description="" name="" role="53"/>
+ <accessible description="" name="Activity Indicator" role="45"/>
+ </accessible>
+ <accessible description="" name="" role="65">
+ <accessible description="Go back one page" name="Back" role="45"/>
+ <accessible description="Go forwards one page" name="Forward" role="45"/>
+ <accessible description="" name="" role="45"/>
+ <accessible description="Reload current page" name="Reload" role="45"/>
+ <accessible description="Stop loading this page" name="Stop" role="45"/>
+ <accessible description="chrome://ubufox/content/startpage.html" name="Home" role="45"/>
+ <accessible description="" name="Location" role="80"/>
+ <accessible description="" name="Search using Google" role="80"/>
+ </accessible>
+ <accessible description="" name="" role="65">
+ <accessible description="" name="Smart Bookmarks" role="45"/>
+ <accessible description="" name="Getting Started" role="45"/>
+ <accessible description="" name="Latest Headlines" role="45"/>
+ </accessible>
+ <accessible description="" name="" role="41">
+ <accessible description="" name="Google Reader" role="66"/>
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="" role="40"/>
+ <accessible description="" name="" role="51"/>
+ <accessible description="" name="" role="51">
+ <accessible description="" name="Google Reader" role="30">
+ <accessible description="" name="Google Reader" role="86">
+ <accessible description="" name="Click here for ARIA enhanced Google Reader." role="72"/>
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="Google Reader" role="72"/>
+ <accessible description="" name="" role="63"/>
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="57"/>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="57"/>
+ <accessible description="" name="" role="57">
+ <accessible description="" name="" role="58">
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="" role="63"/>
+ <accessible description="" name="Google News" role="72"/>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="89"/>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="Reader and ARIA: A new way to read" role="72"/>
+ </accessible>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="Official Google Reader Blog" role="72"/>
+ </accessible>
+ <accessible description="" name="" role="89"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="58"/>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="Google Reader Blog" role="72"/>
+ <accessible description="" name="Discuss" role="72"/>
+ <accessible description="" name="Privacy Policy" role="72"/>
+ <accessible description="" name="Help" role="72"/>
+ <accessible description="" name="" role="89"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="89">
+ <accessible description="" name="" role="29"/>
+ <accessible description="" name="" role="29"/>
+ <accessible description="" name="" role="29"/>
+ <accessible description="" name="" role="29"/>
+ <accessible description="" name="" role="29"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="35"/>
+ <accessible description="" name="" role="56">
+ <accessible description="" name="Done" role="45"/>
+ <accessible description="" name="" role="45"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="gnome-terminal" role="79">
+ <accessible description="" name="mdoff@silver-wind: ~/Projects/accessibility/dbus-atspi/test" role="25"/>
+ </accessible>
+</accessible>
--- /dev/null
+<?xml version="1.0" ?>
+<accessible description="" name="main" role="68">
+ <accessible description="" name="gnome-settings-daemon" role="77"/>
+ <accessible description="" name="gnome-panel" role="77">
+ <accessible description="" name="Bottom Expanded Edge Panel" role="24"/>
+ <accessible description="" name="Top Expanded Edge Panel" role="24"/>
+ </accessible>
+ <accessible description="" name="nautilus" role="77">
+ <accessible description="" name="Desktop" role="24"/>
+ </accessible>
+ <accessible description="" name="metacity" role="77"/>
+ <accessible description="" name="tracker-applet" role="77"/>
+ <accessible description="" name="empathy" role="77">
+ <accessible description="" name="Contact List" role="24"/>
+ </accessible>
+ <accessible description="" name="nm-applet" role="77"/>
+ <accessible description="" name="gnome-power-manager" role="77"/>
+ <accessible description="" name="update-notifier" role="77"/>
+ <accessible description="Firefox Application Accessible" name="Firefox" role="77">
+ <accessible description="Firefox Application Accessible" name="Google Reader - Mozilla Firefox 3 Beta 5" role="24">
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="Strip originally conceived in conversation with Jeph Jacques. Soon to be a major motion picture." role="65"/>
+ <accessible description="" name="" role="67">
+ <accessible description="" name="" role="32">
+ <accessible description="" name="" role="10"/>
+ <accessible description="" name="" role="10"/>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="34">
+ <accessible description="" name="" role="68"/>
+ </accessible>
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="" role="65"/>
+ <accessible description="" name="" role="65"/>
+ <accessible description="" name="" role="64">
+ <accessible description="" name="Application" role="35"/>
+ <accessible description="" name="" role="51"/>
+ <accessible description="" name="Activity Indicator" role="44"/>
+ </accessible>
+ <accessible description="" name="" role="64">
+ <accessible description="Go back one page" name="Back" role="44"/>
+ <accessible description="Go forwards one page" name="Forward" role="44"/>
+ <accessible description="" name="" role="44"/>
+ <accessible description="Reload current page" name="Reload" role="44"/>
+ <accessible description="Stop loading this page" name="Stop" role="44"/>
+ <accessible description="chrome://ubufox/content/startpage.html" name="Home" role="44"/>
+ <accessible description="" name="Location" role="78"/>
+ <accessible description="" name="Search using Google" role="78"/>
+ </accessible>
+ <accessible description="" name="" role="64">
+ <accessible description="" name="Smart Bookmarks" role="44"/>
+ <accessible description="" name="Getting Started" role="44"/>
+ <accessible description="" name="Latest Headlines" role="44"/>
+ </accessible>
+ <accessible description="" name="" role="40">
+ <accessible description="" name="Google Reader" role="65"/>
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="" role="39"/>
+ <accessible description="" name="" role="50"/>
+ <accessible description="" name="" role="50">
+ <accessible description="" name="Google Reader" role="29">
+ <accessible description="" name="Google Reader" role="84">
+ <accessible description="" name="Click here for ARIA enhanced Google Reader." role="70"/>
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="Google Reader" role="70"/>
+ <accessible description="" name="" role="62"/>
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="56"/>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="56"/>
+ <accessible description="" name="" role="56">
+ <accessible description="" name="" role="57">
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="" role="62"/>
+ <accessible description="" name="Google News" role="70"/>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="87"/>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="Reader and ARIA: A new way to read" role="70"/>
+ </accessible>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="Official Google Reader Blog" role="70"/>
+ </accessible>
+ <accessible description="" name="" role="87"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="57"/>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="Google Reader Blog" role="70"/>
+ <accessible description="" name="Discuss" role="70"/>
+ <accessible description="" name="Privacy Policy" role="70"/>
+ <accessible description="" name="Help" role="70"/>
+ <accessible description="" name="" role="87"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="87">
+ <accessible description="" name="" role="28"/>
+ <accessible description="" name="" role="28"/>
+ <accessible description="" name="" role="28"/>
+ <accessible description="" name="" role="28"/>
+ <accessible description="" name="" role="28"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="" role="34"/>
+ <accessible description="" name="" role="55">
+ <accessible description="" name="Done" role="44"/>
+ <accessible description="" name="" role="44"/>
+ </accessible>
+ </accessible>
+ </accessible>
+ <accessible description="" name="gnome-terminal" role="77">
+ <accessible description="" name="mdoff@silver-wind: ~/Projects/accessibility/dbus-atspi/test" role="24"/>
+ </accessible>
+</accessible>
--- /dev/null
+export PYTHONPATH=../python
+export ATSPI_INTROSPECTION_PATH=../xml/introspection
+
+export testdata=../tests/data
+export atspilib=../atk-adaptor/.libs/libspiatk.so
+export testmodules=../tests/apps/.libs
+export testapp=../tests/apps/test-application
+
+./testrunner.py
+#!/usr/bin/python
+
import sys
+import os
import unittest
import clients
-from optparse import OptionParser
-
-parser = OptionParser()
-parser.add_option("-d", "--testdata", dest="testdata", help="Location of test data directory")
-parser.add_option("-a", "--atspilib", dest="atspilib", help="Location of atk to atspi adaptor")
-parser.add_option("-t", "--testmodules", dest="testmodules", help="Location of test application libraries")
-parser.add_option("-r", "--testapp", dest="testapp", help="Location of test application executable")
-parser.add_option("-b", "--busname", dest="busname", help="D-Bus name of test application")
-parser.add_option("-o", "--objectpath", dest="objectpath", help="Object path of test applicaiton tree interface")
-
optionvars = ["testdata",
"atspilib",
"testmodules",
"busname",
"objectpath"]
-def set_data(options, name):
- val = getattr(options, name)
- if val is not None:
- setattr(clients.testutil, name, val)
def main(argv):
- (options, args) = parser.parse_args()
- [set_data(options, name) for name in optionvars]
+ def set_data(name):
+ if name in os.environ.keys():
+ setattr(clients.testutil, name, os.environ[name])
+
+ [set_data(name) for name in optionvars]
runner = unittest.TextTestRunner()
testsuite = unittest.defaultTestLoader.loadTestsFromModule(clients)
- runner.run(testsuite)
+ result = runner.run(testsuite)
+
+ if result.wasSuccessful():
+ return 0
+ else:
+ return 1
+
if __name__=="__main__":
sys.exit(main(sys.argv))