mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +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']
|
SKIP_FILES = ['common', 'runtests']
|
||||||
|
|
||||||
def gettestnames():
|
def gettestnames(which):
|
||||||
dir = os.path.split(os.path.abspath(__file__))[0]
|
if not which:
|
||||||
files = [os.path.basename(p) for p in glob.glob('%s/*.py' % dir)]
|
dir = os.path.split(os.path.abspath(__file__))[0]
|
||||||
names = map(lambda x: x[:-3], files)
|
which = [os.path.basename(p) for p in glob.glob('%s/*.py' % dir)]
|
||||||
map(names.remove, SKIP_FILES)
|
|
||||||
|
names = map(lambda x: x[:-3], which)
|
||||||
|
for f in SKIP_FILES:
|
||||||
|
if f in names:
|
||||||
|
names.remove(f)
|
||||||
return names
|
return names
|
||||||
|
|
||||||
suite = unittest.TestSuite()
|
suite = unittest.TestSuite()
|
||||||
loader = unittest.TestLoader()
|
loader = unittest.TestLoader()
|
||||||
|
|
||||||
for name in gettestnames():
|
for name in gettestnames(sys.argv[1:]):
|
||||||
suite.addTest(loader.loadTestsFromName(name))
|
suite.addTest(loader.loadTestsFromName(name))
|
||||||
|
|
||||||
descriptions = 1
|
descriptions = 1
|
||||||
|
|
Loading…
Reference in a new issue