~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to buildout-templates/bin/retest.in

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-22 14:40:43 UTC
  • mfrom: (14532.4.1 fix-retest)
  • Revision ID: launchpad@pqm.canonical.com-20111222144043-r2j0w1aza305xzrt
[r=allenap][no-qa] Makes bin/retest colorize the output when stdout
 is a tty, and ensures that non-story tests are found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import re
30
30
import sys
31
31
from itertools import takewhile
32
 
from pprint import pprint
33
32
 
34
33
${python-relative-path-setup}
35
34
 
50
49
    match = STORY_RE.match(test)
51
50
    if match:
52
51
        return match.group(1)
 
52
    else:
 
53
        return test
53
54
 
54
55
 
55
56
def gen_test_lines(lines):
80
81
def run_tests(tests):
81
82
    """Given a set of tests, run them as one group."""
82
83
    print "Running tests:"
83
 
    pprint(sorted(tests))
84
 
    args = ['-vv']
 
84
    for test in tests:
 
85
        print "  %s" % test
 
86
    args = ['-vvc'] if sys.stdout.isatty() else ['-vv']
85
87
    for test in tests:
86
88
        args.append('-t')
87
 
        args.append(test)
 
89
        args.append(re.escape(test))
88
90
    os.execl(TEST, TEST, *args)
89
91
 
90
92