2008-06-06 Mark Doffman <mark.doffman@codethink.co.uk>
authorMark Doffman <mdoff@silver-wind.(none)>
Fri, 6 Jun 2008 16:10:59 +0000 (17:10 +0100)
committerMark Doffman <mdoff@silver-wind.(none)>
Fri, 6 Jun 2008 16:10:59 +0000 (17:10 +0100)
        * tests/Makefile.am
          Run the test framework on make check.
* tests/data/*
  Add results directory, and results for single test.
* tests/clients/*
  Changes for passing environment variables needed
  to find test libraries and data.

tests/Makefile.am
tests/clients/Makefile.am
tests/clients/accessibleobject.py
tests/clients/object-test-stage1.xml [deleted file]
tests/clients/testutil.py
tests/data/object-test-stage1-results.xml [new file with mode: 0644]
tests/data/object-test-stage1.xml [new file with mode: 0644]
tests/runtests.sh [new file with mode: 0755]
tests/testrunner.py [changed mode: 0644->0755]

index 15f1affd13c1d85fbeaebc091d4e8a9060712267..dd9a2349c8e2581d76e7dde3fff1beafe82212a4 100644 (file)
@@ -1,3 +1,12 @@
-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
index 2777638d2c24e334b482d8d11c614dc7cd19398d..a0d9ea12e236ab761e856d9c799cd66232cf5f39 100644 (file)
@@ -1,5 +1,6 @@
 EXTRA_DIST = \
        accessibleobject.py     \
        __init__.py             \
-       object-test-stage1.xml  \
        testutil.py
+
+CLEANFILES = *.pyc
index 480b3f7435ff8e54bd59c3ec155e633230bcd1d9..f63490d694bd3443ad3edfdff4b811fbad9dfbf3 100644 (file)
@@ -40,10 +40,16 @@ class AccessibleObjectTestCase(unittest.TestCase):
 
        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")
diff --git a/tests/clients/object-test-stage1.xml b/tests/clients/object-test-stage1.xml
deleted file mode 100644 (file)
index 54729ca..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?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>
index a5bc9dd147d47271741946a357062bc037adbd5f..c7d8e0f4d9d60cb46da9a0b7d6b96bc795a4b017 100644 (file)
@@ -17,11 +17,21 @@ testmodules = "../apps/.libs"
 #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))
diff --git a/tests/data/object-test-stage1-results.xml b/tests/data/object-test-stage1-results.xml
new file mode 100644 (file)
index 0000000..9a0ebd3
--- /dev/null
@@ -0,0 +1,136 @@
+<?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>
diff --git a/tests/data/object-test-stage1.xml b/tests/data/object-test-stage1.xml
new file mode 100644 (file)
index 0000000..54729ca
--- /dev/null
@@ -0,0 +1,136 @@
+<?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>
diff --git a/tests/runtests.sh b/tests/runtests.sh
new file mode 100755 (executable)
index 0000000..0cc27a1
--- /dev/null
@@ -0,0 +1,9 @@
+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
old mode 100644 (file)
new mode 100755 (executable)
index 5684c75..feafc33
@@ -1,17 +1,10 @@
+#!/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",
@@ -19,18 +12,23 @@ optionvars = ["testdata",
                "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))