[pyatspi2] Test fixes



commit 4788606e36348784142c66310f3a339154d6395f
Author: Mike Gorse <mgorse novell com>
Date:   Mon May 3 11:27:10 2010 -0400

    Test fixes
    
    Test a collection rule with an empty stateset and MATCH_ANY
    Have runtests.sh return non-zero if any test failed, not just the last one
    Look for libatk-bridge.so in the correct place if relocated

 tests/pyatspi/Makefile.am       |    4 ++++
 tests/pyatspi/collectiontest.py |   23 +++++++++++++++++++++++
 tests/pyatspi/runtests.sh       |   23 +++++++++++++++++------
 3 files changed, 44 insertions(+), 6 deletions(-)
---
diff --git a/tests/pyatspi/Makefile.am b/tests/pyatspi/Makefile.am
index cb705ba..2514536 100644
--- a/tests/pyatspi/Makefile.am
+++ b/tests/pyatspi/Makefile.am
@@ -1,5 +1,9 @@
 if SET_GTK_MODULE
+if RELOCATE
+gtk_module_dir = $(libdir)/$(GTK_MODULE_DIR)/at-spi-dbus/modules
+else
 gtk_module_dir = $(libdir)/$(GTK_MODULE_DIR)
+endif
 else
 gtk_module_dir = $(GTK_MODULE_DIR)
 endif
diff --git a/tests/pyatspi/collectiontest.py b/tests/pyatspi/collectiontest.py
index 503aafe..1c508c7 100644
--- a/tests/pyatspi/collectiontest.py
+++ b/tests/pyatspi/collectiontest.py
@@ -32,6 +32,7 @@ class AccessibleTest(_PasyTest):
 
         __tests__ = ["setup",
                      "test_basic",
+                     "test_match_any",
                      "test_role",
                      "teardown",
                      ]
@@ -116,6 +117,28 @@ class AccessibleTest(_PasyTest):
                         "Top Expanded Edge Panel", 25,
                 ), " Restrict Children ")
 
+        def test_match_any(self, test):
+                collection = self.root.queryCollection()
+                stateSet = pyatspi.StateSet()
+                rule = collection.createMatchRule (stateSet.raw(),
+                        collection.MATCH_ANY,
+                [],     # attributes
+                        collection.MATCH_ANY,
+                [],     # role
+                        collection.MATCH_ANY,
+                "",     # interfaces
+                        collection.MATCH_NONE,
+                        False)
+
+                ret = collection.getMatches (rule, collection.SORT_ORDER_CANONICAL, 5, True)
+                self.assertObjects(test,ret,(
+                        "gnome-settings-daemon", 79 ,
+                        "gnome-panel", 79 ,
+                        "Bottom Expanded Edge Panel", 25 ,
+                        "Top Expanded Edge Panel", 25 ,
+                        "nautilus", 79 ,
+                ), " 1 ")
+
         def test_role(self, test):
                 collection = self.root.queryCollection()
                 stateSet = pyatspi.StateSet()
diff --git a/tests/pyatspi/runtests.sh b/tests/pyatspi/runtests.sh
index 7790462..18429d2 100755
--- a/tests/pyatspi/runtests.sh
+++ b/tests/pyatspi/runtests.sh
@@ -5,9 +5,20 @@ export TEST_ATSPI_LIBRARY=$gtk_module_dir/libatk-bridge.so
 export TEST_MODULES_DIRECTORY=$top_builddir/tests/apps/.libs
 export TEST_APPLICATION=$top_builddir/tests/apps/test-application
 
-$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m accessibletest -n AccessibleTest
-$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libactionapp.so -m actiontest -n ActionTest
-$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m collectiontest -n AccessibleTest
-$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libcomponentapp.so -m componenttest -n ComponentTest
-$PYTHON $top_srcdir/tests/pyatspi/testrunner -l librelationapp.so -m relationtest -n RelationTest
-$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m statetest -n StateTest
+run()
+{
+  $PYTHON $top_srcdir/tests/pyatspi/testrunner -l $1 -m $2 -n $3
+  result=$?
+  if [ $result -ne 0 ]; then
+    ret=$result
+    fi
+}
+
+ret=0
+run libaccessibleapp.so accessibletest AccessibleTest
+run libactionapp.so actiontest ActionTest
+run libaccessibleapp.so collectiontest AccessibleTest
+run libcomponentapp.so componenttest ComponentTest
+run librelationapp.so relationtest RelationTest
+run libaccessibleapp.so statetest StateTest
+exit $ret



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]