Announce that the test with the specified name failed. Optionally, it is
possible to specify a reason it failed.
+The alias "fail" will also work.
+
xfail
~~~~~
xfail: <NAME>
Announce that the test with the specified name failed but that the failure
was expected, e.g. it's a test for a known bug that hasn't been fixed yet.
+Alternatively it is also possible to simply return "failure:" here but
+specify in the samba4-knownfailures file that it is failing.
skip
~~~~
Announce that the test with the specified name was skipped. Optionally a
reason can be specified.
-knownfail
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-knownfail: <NAME>
-knownfail: <NAME> [ REASON ]
+time
+~~~~
+time: YYYY-MM-DD HH:mm:ssZ
+
+Announce the current time. This may be used to calculate the duration of
+various tests.
-Announce that the test with the specified name was run and failed as expected.
-Alternatively it is also possible to simply return "failure:" here but
-specify in the samba4-knownfailures file that it is failing.
+prefix
+~~~~~~
+prefix: Prefix
+
+Change the global prefix for test names. To unset the prefix, specify an empty
+string.
Environments
============
-# Simple Perl module for parsing the Subunit protocol
-# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
+# Perl module for parsing and generating the Subunit protocol
+# Copyright (C) 2008-2009 Jelmer Vernooij <jelmer@samba.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
my $unexpected_ok = 0;
my $expected_fail = 0;
my $unexpected_fail = 0;
+ my $prefix = "";
my $unexpected_err = 0;
my $orig_open_len = $#$open_tests;
push (@$open_tests, $1);
} elsif (/^time: (\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)Z\n/) {
$msg_ops->report_time(mktime($6, $5, $4, $3, $2, $1));
+ } elsif (/^prefix: (.*)\n/) {
+ $prefix = $1;
} elsif (/^(success|successful|failure|fail|skip|knownfail|error|xfail): (.*?)( \[)?([ \t]*)\n/) {
$msg_ops->control_msg($_);
my $result = $1;
printf "time: %04d-%02d-%02d %02d:%02d:%02dZ\n", $year+1900, $mon, $mday, $hour, $min, $sec;
}
+sub prefix($)
+{
+ my ($prefix) = @_;
+ print "prefix: $prefix\n";
+}
+
1;
my $pcap_file = setup_pcap($name);
Subunit::report_time(time());
+ Subunit::prefix($name);
Subunit::start_test($name);
my $ret = system("$cmd 2>&1");
}
my $envlog = getlog_env($envname);
if ($envlog ne "") {
- print "ENVLOG: $envlog\n";
+ print "envlog: $envlog\n";
}
- print "CMD: $cmd\n";
+ print "command: $cmd\n";
my $exitcode = $ret >> 8;