~ubuntu-branches/ubuntu/vivid/python-clips/vivid

« back to all changes in this revision

Viewing changes to testsuite/tests.py

  • Committer: Package Import Robot
  • Author(s): Thorsten Alteholz
  • Date: 2013-04-08 18:00:07 UTC
  • Revision ID: package-import@ubuntu.com-20130408180007-a6r8lqqixt23uisd
Tags: upstream-1.0.7.348+clips
ImportĀ upstreamĀ versionĀ 1.0.7.348+clips

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# tests.py
 
2
# perform some unit tests
 
3
# revision $Id: tests.py 188 2004-11-10 20:04:34Z Franz $
 
4
 
 
5
import unittest
 
6
import glob
 
7
 
 
8
execfile('test_00.py')
 
9
for x in glob.glob("test_[a-z]*.py"): execfile(x)
 
10
def is_test_class(x):
 
11
    try: return issubclass(eval(x), ctestcase)
 
12
    except: return False
 
13
def is_test_function(x):
 
14
    try: return x.startswith('ctf_')
 
15
    except: return False
 
16
 
 
17
suite = unittest.TestSuite()
 
18
for x in filter(is_test_class, dir()):
 
19
    for y in filter(is_test_function, dir(eval(x))):
 
20
        suite.addTest(eval("%s('%s')" % (x, y)))
 
21
 
 
22
unittest.TextTestRunner(verbosity=2).run(suite)
 
23
 
 
24
 
 
25
# end.