testsuite/Makefile.am (check-local): distcheck fixes

Original commit message from CVS:
* 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
This commit is contained in:
Johan Dahlin 2004-03-17 12:41:08 +00:00
parent 339261e4e2
commit fba1f21b1d
8 changed files with 85 additions and 7 deletions

View file

@ -1,5 +1,12 @@
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

View file

@ -45,6 +45,7 @@ initinterfaces (void)
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");
}
}

1
testsuite/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.pyc

View file

@ -1,10 +1,11 @@
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

View file

@ -1,12 +1,40 @@
#
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

20
testsuite/interface.py Normal file
View file

@ -0,0 +1,20 @@
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()

View file

@ -6,7 +6,7 @@ from types import ClassType
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)

View file

@ -0,0 +1,20 @@
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()