File: testrunner.py

package info (click to toggle)
grilo-plugins 0.3.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,348 kB
  • sloc: ansic: 52,656; xml: 2,879; python: 1,137; makefile: 9
file content (29 lines) | stat: -rwxr-xr-x 542 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python

import unittest
import glob
import sys

# https://bugzilla.gnome.org/show_bug.cgi?id=748455
exit (0)

test_loader = unittest.defaultTestLoader

names = []
args = sys.argv[1:]

if args:
    for item in args:
        names.append(item[:-3])
else:
    for filename in glob.iglob("test_*.py"):
        names.append(filename[:-3])

test_suites = []
for name in names:
    test_suites.append(test_loader.loadTestsFromName(name))

runner = unittest.TextTestRunner(verbosity=2)

for suite in test_suites:
    runner.run(suite)