action="store_true", help="Fail if there was no subunit output")
parser.add_option("--list", default=False,
action="store_true", help="Operate in list mode")
+parser.add_option("--perf-test-output", default=False,
+ action="store_true", help="orientate output for performance measurement")
opts, args = parser.parse_args()
if opts.list:
sys.stdout.write("%s%s%s\n" % (opts.prefix, l.rstrip(), opts.suffix))
sys.exit(0)
+if opts.perf_test_output:
+ bad_options = []
+ for bad_opt in ('fail_immediately', 'strip_passed_output',
+ 'flapping', 'expected_failures'):
+ if getattr(opts, bad_opt):
+ bad_options.append(bad_opt)
+ if bad_options:
+ print >>sys.stderr, ("--perf-test-output is incompatible with --%s" %
+ (', --'.join(x.replace('_', '-')
+ for x in bad_options)))
+ sys.exit(1)
+
if opts.expected_failures:
expected_failures = subunithelper.read_test_regexes(opts.expected_failures)
else:
signal.signal(signal.SIGINT, handle_sigint)
out = subunithelper.SubunitOps(sys.stdout)
-msg_ops = subunithelper.FilterOps(out, opts.prefix, opts.suffix, expected_failures,
- opts.strip_passed_output,
- fail_immediately=opts.fail_immediately,
- flapping=flapping)
+
+if opts.perf_test_output:
+ msg_ops = subunithelper.PerfFilterOps(out, opts.prefix, opts.suffix)
+else:
+ msg_ops = subunithelper.FilterOps(out, opts.prefix, opts.suffix,
+ expected_failures,
+ opts.strip_passed_output,
+ fail_immediately=opts.fail_immediately,
+ flapping=flapping)
try:
ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)