2004-03-08 19:22:15 +00:00
|
|
|
#!/usr/bin/env python
|
2005-09-01 10:36:07 +00:00
|
|
|
# -*- Mode: Python -*-
|
|
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
|
|
|
#
|
|
|
|
# gst-python - Python bindings for GStreamer
|
|
|
|
# Copyright (C) 2002 David I. Lehn
|
|
|
|
# Copyright (C) 2004 Johan Dahlin
|
|
|
|
# Copyright (C) 2005 Edward Hervey
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
2004-05-01 15:35:32 +00:00
|
|
|
import glob
|
2004-06-21 08:38:23 +00:00
|
|
|
import os
|
2004-03-08 19:22:15 +00:00
|
|
|
import sys
|
2004-05-01 15:35:32 +00:00
|
|
|
import unittest
|
2004-03-08 19:22:15 +00:00
|
|
|
|
2004-05-01 15:35:32 +00:00
|
|
|
SKIP_FILES = ['common', 'runtests']
|
2004-03-08 19:22:15 +00:00
|
|
|
|
2004-05-01 15:35:32 +00:00
|
|
|
def gettestnames():
|
2005-06-17 10:59:47 +00:00
|
|
|
dir = os.path.split(os.path.abspath(__file__))[0]
|
|
|
|
files = [os.path.basename(p) for p in glob.glob('%s/*.py' % dir)]
|
2004-05-01 15:35:32 +00:00
|
|
|
names = map(lambda x: x[:-3], files)
|
|
|
|
map(names.remove, SKIP_FILES)
|
|
|
|
return names
|
|
|
|
|
|
|
|
suite = unittest.TestSuite()
|
|
|
|
loader = unittest.TestLoader()
|
|
|
|
|
|
|
|
for name in gettestnames():
|
|
|
|
suite.addTest(loader.loadTestsFromName(name))
|
|
|
|
|
|
|
|
testRunner = unittest.TextTestRunner()
|
2005-06-17 10:59:47 +00:00
|
|
|
result = testRunner.run(suite)
|
|
|
|
if result.failures or result.errors:
|
|
|
|
sys.exit(1)
|