• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/samba-3.5.8/lib/subunit/
1#!/usr/bin/perl
2# Simple script that converts Perl test harness output to 
3# Subunit
4# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
5# Published under the GNU GPL, v3 or later
6
7my $firstline = 1;
8my $error = 0;
9while(<STDIN>) {
10	if ($firstline) {
11		$firstline = 0;
12		next;
13	}
14	if (/^not ok (\d+) - (.*)$/) {
15		print "test: $2\n";
16		print "failure: $2\n";
17		$error = 1;
18	} elsif (/^ok (\d+) - (.*)$/) {
19		print "test: $2\n";
20		print "success: $2\n";
21	} elsif (/^ok (\d+)$/) {
22		print "test: $1\n";
23		print "success: $1\n";
24	} elsif (/^ok (\d+) # skip (.*)$/) {
25		print "test: $1\n";
26		print "skip: $1 [\n$2\n]\n";
27	} elsif (/^not ok (\d+)$/) {
28		print "test: $1\n";
29		print "failure: $1\n";
30		$error = 1;
31	} else {
32		print;
33	}
34}
35exit $error;
36