File: runtests.py

package info (click to toggle)
tomoe 0.6.0-1.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 51,396 kB
  • sloc: xml: 1,387,526; ansic: 11,515; sh: 9,072; ruby: 1,344; python: 762; makefile: 450
file content (32 lines) | stat: -rwxr-xr-x 845 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env python
# -*- coding: UTF=8 -*-
import glob
import os
import sys
import unittest
import test_common

dict_modules = os.getenv('DICT_MODULES').split()
SKIP_FILES = ['runtests', 'test_dict', 'test_common', 'test_dict_est', 'test_dict_mysql', 'test_dict_unihan', 'test_dict_xml']

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

def gettestnames():
    files = glob.glob('*.py')
    names = map(lambda x: x[:-3], files)
    dict_files = map(lambda x: 'test_dict_'+x , dict_modules)
    map(SKIP_FILES.remove, dict_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(verbosity=1)
testRunner.run(suite)

# vi:ts=4:nowrap:ai:expandtab