gstreamer/testsuite/common.py
Johan Dahlin fba1f21b1d 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
2004-03-17 12:41:08 +00:00

40 lines
916 B
Python

import dl
import os
import sys
import unittest
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
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