mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
allow calling runtests on one test only
Original commit message from CVS: allow calling runtests on one test only
This commit is contained in:
parent
16bb9b838e
commit
aabc3e7be1
1 changed files with 10 additions and 6 deletions
|
@ -28,17 +28,21 @@ import unittest
|
|||
|
||||
SKIP_FILES = ['common', 'runtests']
|
||||
|
||||
def gettestnames():
|
||||
dir = os.path.split(os.path.abspath(__file__))[0]
|
||||
files = [os.path.basename(p) for p in glob.glob('%s/*.py' % dir)]
|
||||
names = map(lambda x: x[:-3], files)
|
||||
map(names.remove, SKIP_FILES)
|
||||
def gettestnames(which):
|
||||
if not which:
|
||||
dir = os.path.split(os.path.abspath(__file__))[0]
|
||||
which = [os.path.basename(p) for p in glob.glob('%s/*.py' % dir)]
|
||||
|
||||
names = map(lambda x: x[:-3], which)
|
||||
for f in SKIP_FILES:
|
||||
if f in names:
|
||||
names.remove(f)
|
||||
return names
|
||||
|
||||
suite = unittest.TestSuite()
|
||||
loader = unittest.TestLoader()
|
||||
|
||||
for name in gettestnames():
|
||||
for name in gettestnames(sys.argv[1:]):
|
||||
suite.addTest(loader.loadTestsFromName(name))
|
||||
|
||||
descriptions = 1
|
||||
|
|
Loading…
Reference in a new issue