diff --git a/build.py b/build.py index 0bfd1568..bb9ecb34 100755 --- a/build.py +++ b/build.py @@ -160,6 +160,8 @@ def main(args): continue # ignore empty command-line args (possible with the buildbot) elif cmd.startswith('test_'): testOne(cmd, options, args) + elif cmd.startswith('unittests/test_'): + testOne(os.path.basename(cmd), options, args) elif 'cmd_'+cmd in globals(): function = globals()['cmd_'+cmd] function(options, args) @@ -983,6 +985,9 @@ def cmd_test(options, args): def testOne(name, options, args): cmdTimer = CommandTimer('test %s:' % name) pwd = pushDir(phoenixDir()) + if name.endswith('.py') or name.endswith('.pyc'): + i = name.rfind('.') + name = name[:i] runcmd('"%s" unittests/%s.py %s' % (PYTHON, name, '-v' if options.verbose else ''), fatal=False)