mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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:
parent
339261e4e2
commit
fba1f21b1d
8 changed files with 85 additions and 7 deletions
|
@ -1,5 +1,12 @@
|
||||||
2004-03-17 Johan Dahlin <johan@gnome.org>
|
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.defs: Remove unused functions.
|
||||||
|
|
||||||
* gst/gst.override: Ditto
|
* gst/gst.override: Ditto
|
||||||
|
|
|
@ -45,6 +45,7 @@ initinterfaces (void)
|
||||||
pyinterfaces_add_constants (m, "GST_");
|
pyinterfaces_add_constants (m, "GST_");
|
||||||
|
|
||||||
if (PyErr_Occurred ()) {
|
if (PyErr_Occurred ()) {
|
||||||
|
PyErr_Print ();
|
||||||
Py_FatalError ("can't initialize module gst.interfaces");
|
Py_FatalError ("can't initialize module gst.interfaces");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
testsuite/.gitignore
vendored
Normal file
1
testsuite/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.pyc
|
|
@ -1,10 +1,11 @@
|
||||||
tests = \
|
tests = \
|
||||||
|
common.py \
|
||||||
element.py \
|
element.py \
|
||||||
|
interface.py \
|
||||||
pipeline.py
|
pipeline.py
|
||||||
|
|
||||||
check-local:
|
check-local:
|
||||||
@$(PYTHON) runtests.py
|
@PYTHONPATH=$(top_builddir) $(PYTHON) $(srcdir)/runtests.py
|
||||||
@rm -fr *.pyc
|
@rm -fr *.pyc
|
||||||
|
|
||||||
EXTRA_DIST = $(tests) runtests.py
|
EXTRA_DIST = $(tests) runtests.py
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,40 @@
|
||||||
#
|
import dl
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
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
|
# 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 sys.modules.has_key('_gst')
|
||||||
assert os.path.basename(sys.modules['_gst'].__file__), \
|
assert os.path.basename(sys.modules['_gst'].__file__), \
|
||||||
os.path.join('..', 'gst', 'libs')
|
os.path.join('..', 'gst', 'libs')
|
||||||
|
|
||||||
|
del devloc, sys, os, dl
|
||||||
|
|
20
testsuite/interface.py
Normal file
20
testsuite/interface.py
Normal 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()
|
|
@ -6,7 +6,7 @@ from types import ClassType
|
||||||
loader = TestLoader()
|
loader = TestLoader()
|
||||||
testRunner = TextTestRunner()
|
testRunner = TextTestRunner()
|
||||||
|
|
||||||
for name in ('element', 'pipeline'):
|
for name in ('element', 'interface', 'pipeline'):
|
||||||
print 'Testing', name
|
print 'Testing', name
|
||||||
tests = loader.loadTestsFromName(name)
|
tests = loader.loadTestsFromName(name)
|
||||||
testRunner.run(tests)
|
testRunner.run(tests)
|
||||||
|
|
20
testsuite/test_interface.py
Normal file
20
testsuite/test_interface.py
Normal 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()
|
Loading…
Reference in a new issue