2004-03-17 Johan Dahlin <johan@gnome.org>
+ * testsuite/Makefile.am (check-local): distcheck fixes
+
+ * testsuite/common.py: Put in a couple of hacks to make distcheck
+ pass make check
+
+ * testsuite/interface.py: New test
+
* gst/gst.defs: Remove unused functions.
* gst/gst.override: Ditto
pyinterfaces_add_constants (m, "GST_");
if (PyErr_Occurred ()) {
- Py_FatalError ("can't initialize module gst.interfaces");
+ PyErr_Print ();
+ Py_FatalError ("can't initialize module gst.interfaces");
}
}
tests = \
+ common.py \
element.py \
+ interface.py \
pipeline.py
check-local:
- @$(PYTHON) runtests.py
+ @PYTHONPATH=$(top_builddir) $(PYTHON) $(srcdir)/runtests.py
@rm -fr *.pyc
EXTRA_DIST = $(tests) runtests.py
-
-#
+import dl
import os
import sys
import unittest
-sys.path.insert(0, '..')
+devloc = os.path.join('..', 'gst', '.libs')
+if os.path.exists(devloc):
+ sys.path.insert(0, devloc)
# Load GST and make sure we load it from the current build
-import gst
+
+sys.setdlopenflags(dl.RTLD_LAZY | dl.RTLD_GLOBAL)
+
+# We're importing _gst, since we don't have access to __init__.py
+# during distcheck where builddir != srcdir
+import _gst as gst
+
+# Put the fake module in sys.modules, otherwise the C modules
+# Can't find the classes accordingly
+sys.modules['gst'] = gst
+
+try:
+ import interfaces
+ gst.interfaces = interfaces
+ sys.modules['gst.interfaces'] = interfaces
+except ImportError:
+ pass
+
+try:
+ import play
+ gst.play = play
+ sys.modules['gst.play'] = play
+except ImportError:
+ pass
+
assert sys.modules.has_key('_gst')
assert os.path.basename(sys.modules['_gst'].__file__), \
os.path.join('..', 'gst', 'libs')
+
+del devloc, sys, os, dl
--- /dev/null
+from common import gst, unittest
+
+try:
+ from gst import interfaces
+except:
+ raise SystemExit
+
+import gobject
+
+class Availability(unittest.TestCase):
+ def testXOverlay(self):
+ assert hasattr(interfaces, 'XOverlay')
+ assert issubclass(interfaces.XOverlay, gobject.GInterface)
+
+ def testMixer(self):
+ assert hasattr(interfaces, 'Mixer')
+ assert issubclass(interfaces.Mixer, gobject.GInterface)
+
+if __name__ == "__main__":
+ unittest.main()
loader = TestLoader()
testRunner = TextTestRunner()
-for name in ('element', 'pipeline'):
+for name in ('element', 'interface', 'pipeline'):
print 'Testing', name
tests = loader.loadTestsFromName(name)
testRunner.run(tests)
--- /dev/null
+from common import gst, unittest
+
+try:
+ from gst import interfaces
+except:
+ raise SystemExit
+
+import gobject
+
+class Availability(unittest.TestCase):
+ def testXOverlay(self):
+ assert hasattr(interfaces, 'XOverlay')
+ assert issubclass(interfaces.XOverlay, gobject.GInterface)
+
+ def testMixer(self):
+ assert hasattr(interfaces, 'Mixer')
+ assert issubclass(interfaces.Mixer, gobject.GInterface)
+
+if __name__ == "__main__":
+ unittest.main()