4 # Copyright (C)2009 EQL Data Inc. and contributors.
5 # Licensed under the GNU Library General Public License, version 2.
6 # See the included file named LICENSE for license information.
9 import sys, imp, types, os, os.path
12 def runtest(modname, fname, f):
14 print 'Testing "%s" in %s.py:' % (fname, modname)
19 print traceback.format_exc()
20 tb = sys.exc_info()[2]
21 wvtest._result(e, traceback.extract_tb(tb)[-1],
24 for modname in sys.argv[1:]:
25 if modname.endswith('.py'):
26 modname = modname[:-3]
28 print 'Importing: %s' % modname
29 wvtest._registered = []
30 mod = __import__(modname, None, None, [])
32 for t in wvtest._registered:
33 runtest(modname, t.func_name, t)
36 print 'WvTest: %d tests, %d failures.' % (wvtest._tests, wvtest._fails)