From 0cb0427f134c8fdd79880642abef0ad1f115c3b3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 27 Apr 2012 12:50:36 +1000 Subject: selftest: Place the test environment at the end of the failure lines This allows a knownfail entry to be added for only one environment, rather than all environments. Andrew Bartlett --- selftest/filter-subunit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'selftest/filter-subunit') diff --git a/selftest/filter-subunit b/selftest/filter-subunit index bced14b101..2ed1430b69 100755 --- a/selftest/filter-subunit +++ b/selftest/filter-subunit @@ -40,6 +40,8 @@ parser.add_option("--fail-immediately", action="store_true", help="Whether to stop on the first error", default=False) parser.add_option("--prefix", type="string", help="Add prefix to all test names") +parser.add_option("--suffix", type="string", + help="Add suffix to all test names") parser.add_option("--fail-on-empty", default=False, action="store_true", help="Fail if there was no subunit output") parser.add_option("--list", default=False, @@ -48,10 +50,13 @@ opts, args = parser.parse_args() if opts.list: prefix = opts.prefix + suffix = opts.suffix if not prefix: prefix = "" + if not suffix: + suffix = "" for l in sys.stdin: - sys.stdout.write("%s%s\n" % (prefix, l.rstrip())) + sys.stdout.write("%s%s%s\n" % (prefix, l.rstrip(), suffix)) sys.exit(0) if opts.expected_failures: @@ -79,7 +84,7 @@ def handle_sigint(sig, stack): signal.signal(signal.SIGINT, handle_sigint) out = subunithelper.SubunitOps(sys.stdout) -msg_ops = subunithelper.FilterOps(out, opts.prefix, expected_failures, +msg_ops = subunithelper.FilterOps(out, opts.prefix, opts.suffix, expected_failures, opts.strip_passed_output, fail_immediately=opts.fail_immediately, flapping=flapping) -- cgit