|
@@ -102,6 +102,25 @@ If you are not in case_per_ok mode, the global status of the case will be set ac
|
|
|
|
|
|
|
|
Step results will always be whatever status is relevant to the particular step.
|
|
Step results will always be whatever status is relevant to the particular step.
|
|
|
|
|
|
|
|
|
|
+=head1 TAP Extensions
|
|
|
|
|
+
|
|
|
|
|
+=head2 Forcing status reported
|
|
|
|
|
+
|
|
|
|
|
+A line that begins like so:
|
|
|
|
|
+
|
|
|
|
|
+% mark_status=
|
|
|
|
|
+
|
|
|
|
|
+Will allow you to force the status of a test case to whatever is on the RHS of the = expression.
|
|
|
|
|
+
|
|
|
|
|
+Example (force test to retest in event of tool failure):
|
|
|
|
|
+
|
|
|
|
|
+ my $failed = do_something_possibly_causing_tool_failure();
|
|
|
|
|
+ print "% mark_status=retest" if $failed;
|
|
|
|
|
+
|
|
|
|
|
+Bogus statuses will cluck, but otherwise be ignored. Valid statuses are any of the required internal names in your TestRail install (see above).
|
|
|
|
|
+
|
|
|
|
|
+Multiple instances of this will ignore all but the latest valid status.
|
|
|
|
|
+
|
|
|
=cut
|
|
=cut
|
|
|
|
|
|
|
|
sub new {
|
|
sub new {
|
|
@@ -308,6 +327,14 @@ sub unknownCallback {
|
|
|
my $line = $test->as_string;
|
|
my $line = $test->as_string;
|
|
|
$self->{'raw_output'} .= "$line\n";
|
|
$self->{'raw_output'} .= "$line\n";
|
|
|
|
|
|
|
|
|
|
+ #Unofficial "Extensions" to TAP
|
|
|
|
|
+ my ($status_override) = $line =~ m/^% mark_status=([a-z|_]*)/;
|
|
|
|
|
+ if ($status_override) {
|
|
|
|
|
+ cluck "Unknown status override" unless defined $self->{'tr_opts'}->{$status_override}->{'id'};
|
|
|
|
|
+ $self->{'global_status'} = $self->{'tr_opts'}->{$status_override}->{'id'} if $self->{'tr_opts'}->{$status_override};
|
|
|
|
|
+ print "# Overriding status to $status_override (".$self->{'global_status'}.")...\n" if $self->{'global_status'};
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
#XXX I'd love to just rely on the 'name' attr in App::Prove::State::Result::Test, but...
|
|
#XXX I'd love to just rely on the 'name' attr in App::Prove::State::Result::Test, but...
|
|
|
#try to pick out the filename if we are running this on TAP in files, where App::Prove is uninvolved
|
|
#try to pick out the filename if we are running this on TAP in files, where App::Prove is uninvolved
|
|
|
my $file = TestRail::Utils::getFilenameFromTapLine($line);
|
|
my $file = TestRail::Utils::getFilenameFromTapLine($line);
|
|
@@ -487,6 +514,9 @@ sub EOFCallback {
|
|
|
$status = $self->{'tr_opts'}->{'todo_pass'}->{'id'} if $self->todo_passed() && !$self->failed() && $self->is_good_plan(); #If no fails, but a TODO pass, mark as TODO PASS
|
|
$status = $self->{'tr_opts'}->{'todo_pass'}->{'id'} if $self->todo_passed() && !$self->failed() && $self->is_good_plan(); #If no fails, but a TODO pass, mark as TODO PASS
|
|
|
$status = $self->{'tr_opts'}->{'skip'}->{'id'} if $self->skip_all(); #Skip all, whee
|
|
$status = $self->{'tr_opts'}->{'skip'}->{'id'} if $self->skip_all(); #Skip all, whee
|
|
|
|
|
|
|
|
|
|
+ #Global status override
|
|
|
|
|
+ $status = $self->{'global_status'} if $self->{'global_status'};
|
|
|
|
|
+
|
|
|
#Optional args
|
|
#Optional args
|
|
|
my $notes = $self->{'tr_opts'}->{'test_notes'};
|
|
my $notes = $self->{'tr_opts'}->{'test_notes'};
|
|
|
$notes = $self->{'raw_output'};
|
|
$notes = $self->{'raw_output'};
|