File: runtests.py

package info (click to toggle)
gnome-python 2.28.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,288 kB
  • sloc: sh: 10,219; ansic: 7,997; xml: 2,464; python: 1,886; makefile: 392
file content (36 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (4)
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
30
31
32
33
34
35
36
#!/usr/bin/env python
import glob
import os
import sys
import unittest

#SKIP_FILES = ['common', 'runtests']

if len(sys.argv) > 1:
    builddir = sys.argv[1]
    no_import_hooks = True
else:
    builddir = '..'
    no_import_hooks = False

import common
common.run_import_tests(builddir, no_import_hooks)


dir = os.path.split(os.path.abspath(__file__))[0]
os.chdir(dir)

def gettestnames():
    files = glob.glob('test*.py')
    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()
testRunner.run(suite)