2008-09-25 Mark Doffman <mark.doffman@codethink.co.uk>
authorMark Doffman <mdoff@silver-wind.(none)>
Tue, 30 Sep 2008 01:32:23 +0000 (02:32 +0100)
committerMark Doffman <mdoff@silver-wind.(none)>
Tue, 30 Sep 2008 01:32:23 +0000 (02:32 +0100)
* tests/Makefile.am
  configure.ac
  For the moment remove the cspi tests. cspi
  needs modification for it to be in working order again.

* tests/pyatspi/*
  Add unit tests to 'make check'

12 files changed:
configure.ac
pyatspi/Makefile.am
tests/Makefile.am
tests/pyatspi/Makefile.am
tests/pyatspi/accessibletest.py
tests/pyatspi/actiontest.py
tests/pyatspi/componenttest.py
tests/pyatspi/desktoptest.py
tests/pyatspi/relationtest.py
tests/pyatspi/runtests.sh [new file with mode: 0755]
tests/pyatspi/setvars.sh [changed mode: 0755->0644]
tests/pyatspi/testrunner [moved from tests/pyatspi/testrunner.py with 98% similarity]

index 371c33f..0249064 100644 (file)
@@ -190,7 +190,6 @@ AC_CONFIG_FILES([Makefile
                 atk-adaptor/Makefile
                 login-helper/Makefile
                 tests/dummyatk/Makefile
-                tests/cspi/Makefile
                 tests/data/Makefile
                 tests/pyatspi/Makefile
                 tests/pyatspi/pasytest/Makefile
index 3979bbc..c204ab4 100644 (file)
@@ -1,4 +1,6 @@
+pyatspidir = $(pythondir)/pyatspi
 pyatspi_PYTHON = \
+               Accessibility.py        \
                accessible.py           \
                action.py               \
                application.py          \
@@ -31,6 +33,4 @@ pyatspi_PYTHON = \
                utils.py                \
                value.py
 
-pyatspidir=$(pyexecdir)/pyatspi
-
 CLEANFILES = *.pyc
index 239fd4b..10d902b 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = dummyatk apps data cspi pyatspi
+SUBDIRS = dummyatk apps data pyatspi
 
 #TESTS=testrunner.py
 TESTS_ENVIRONMENT = PYTHONPATH=$(abs_top_srcdir)/python                                        \
index dbe32a8..97213ce 100644 (file)
@@ -2,6 +2,7 @@ SUBDIRS = pasytest
 
 EXTRA_DIST = \
        accessibletest.py\
+       actiontest.py\
        componenttest.py\
        desktoptest.py\
        statetest.py\
@@ -9,6 +10,11 @@ EXTRA_DIST = \
        Makefile.in\
        setvars.sh\
        relationtest.py\
-       testrunner.py
+       runtests.sh\
+       testrunner
+
+TESTS_ENVIRONMENT = top_builddir=$(top_builddir) top_srcdir=$(top_srcdir)
+
+TESTS = runtests.sh
 
 CLEANFILES = *.pyc
index 3867883..d94e0af 100644 (file)
@@ -55,7 +55,8 @@ class AccessibleTest(_PasyTest):
                self._path = path
 
        def setup(self, test):
-               self._registry = pyatspi.registry.Registry(self._path)
+               self._registry = pyatspi.Registry()
+               print self._path
                self._desktop = self._registry.getDesktop(0)
 
        def test_name(self, test):
index 870bf19..405f898 100644 (file)
@@ -26,7 +26,7 @@ class ActionTest(_PasyTest):
                self._path = path
 
        def setup(self, test):
-               self._registry = pyatspi.registry.Registry(self._path)
+               self._registry = pyatspi.Registry()
                self._desktop = self._registry.getDesktop(0)
 
        def test_nActions(self, test):
index 28a66f3..c6a9253 100644 (file)
@@ -44,7 +44,7 @@ class ComponentTest(_PasyTest):
                self._path = path
 
        def setup(self, test):
-               self._registry = pyatspi.registry.Registry(self._path)
+               self._registry = pyatspi.Registry()
                self._desktop = self._registry.getDesktop(0)
 
        def test_contains(self, test):
index 8266220..409f634 100644 (file)
@@ -46,7 +46,7 @@ class DesktopTest(_PasyTest):
                self._path = path
 
        def setup(self, test):
-               self._registry = pyatspi.registry.Registry(self._path)
+               self._registry = pyatspi.Registry()
                self._desktop = self._registry.getDesktop(0)
 
        def test_name(self, test):
index 6f93b14..77ce31c 100644 (file)
@@ -25,7 +25,7 @@ class RelationTest(_PasyTest):
                self._path = path
 
        def setup(self, test):
-               self._registry = pyatspi.registry.Registry(self._path)
+               self._registry = pyatspi.Registry()
                self._desktop = self._registry.getDesktop(0)
                self._root = self._desktop[0]
                self._rset = self._root.getRelationSet()
diff --git a/tests/pyatspi/runtests.sh b/tests/pyatspi/runtests.sh
new file mode 100755 (executable)
index 0000000..eec34d9
--- /dev/null
@@ -0,0 +1,12 @@
+export PYTHONPATH=$top_srcdir
+
+export TEST_DATA_DIRECTORY=$top_srcdir/tests/data
+export TEST_ATSPI_LIBRARY=$top_builddir/atk-adaptor/.libs/libspiatk.so
+export TEST_MODULES_DIRECTORY=$top_builddir/tests/apps/.libs
+export TEST_APPLICATION=$top_builddir/tests/apps/test-application
+
+$top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m accessibletest -n AccessibleTest
+$top_srcdir/tests/pyatspi/testrunner -l libactionapp.so -m actiontest -n ActionTest
+$top_srcdir/tests/pyatspi/testrunner -l libcomponentapp.so -m componenttest -n ComponentTest
+$top_srcdir/tests/pyatspi/testrunner -l librelationapp.so -m relationtest -n RelationTest
+$top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m statetest -n StateTest
old mode 100755 (executable)
new mode 100644 (file)
similarity index 98%
rename from tests/pyatspi/testrunner.py
rename to tests/pyatspi/testrunner
index b74929e..92531e2 100755 (executable)
@@ -3,6 +3,7 @@
 import gobject
 import dbus
 import sys
+import os
 import time
 from random import randint
 
@@ -72,6 +73,7 @@ def main(argv):
        test = dbus.Interface(to, "org.codethink.atspi.test")
 
        # Run the test script here
+       os.environ["ATSPI_TEST_APP_NAME"] = name
        module = __import__(options.test_module)
        test_class = getattr(module, options.test_name)
        test_object = test_class(bus, name)