metan-ucw / runltp-ng

Minimalistic LTP testrunner
11 stars 16 forks source link

Add retval field to results #41

Closed asmorodskyi closed 3 years ago

mdoucha commented 3 years ago

This is what you need to do in parse_retval():

if (!defined($ret)) {
    $result->{'broken'}++;
    push @{$result->{'retval'}}, 'undefined';
    $stat->{'broken'}++;
    return;
}

push @{$result->{'retval'}}, $ret;

if ($ret == 0) {
...

The of course also initialize $result->{'retval'} to empty array in run_ltp() and copy the value to the output in openqa_filter().

asmorodskyi commented 3 years ago

This is what you need to do in parse_retval():

if (!defined($ret)) {
  $result->{'broken'}++;
  push @{$result->{'retval'}}, 'undefined';
  $stat->{'broken'}++;
  return;
}

push @{$result->{'retval'}}, $ret;

if ($ret == 0) {
...

The of course also initialize $result->{'retval'} to empty array in run_ltp() and copy the value to the output in openqa_filter().

not sure about parse_retval_openposix , should I touch it ?

mdoucha commented 3 years ago

not sure about parse_retval_openposix , should I touch it ?

On second thought, it'd be better to handle this in run_ltp() right before parsing retval:

$result->{'runs'} += 1;
push @{$result->{'retval'}}, (defined($ret) ? $ret : 'undefined');

if ($runtest =~ "openposix") {
metan-ucw commented 3 years ago

Looks good to me, @pevik will you merge it or should I?

pevik commented 3 years ago

Ah, forget to add @mdoucha Reviewed-by: tag, sorry.