<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>On 9/6/19 10:26 AM, Richard Purdie wrote:<br>
    </p>
    <blockquote type="cite"
cite="mid:d1e5a94c07b6298a2c5d5041de7910e935eea06d.camel@linuxfoundation.org">
      <pre class="moz-quote-pre" wrap="">On Fri, 2019-09-06 at 10:04 -0400, Trevor Gamblin wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">From: Trevor Gamblin <a class="moz-txt-link-rfc2396E" href="mailto:trevor.gamblin@windriver.com">&lt;trevor.gamblin@windriver.com&gt;</a>

The libevent ptest used to report only a global pass or a fail
result.
Count individual PASS, FAIL, SKIP results. The SKIP results now
include tests that are disabled in the libevent code.

Signed-off-by: Trevor Gamblin <a class="moz-txt-link-rfc2396E" href="mailto:trevor.gamblin@windriver.com">&lt;trevor.gamblin@windriver.com&gt;</a>
---
 .../libevent/libevent/run-ptest               | 34 ++++++++++++-----
--
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-support/libevent/libevent/run-ptest
b/meta/recipes-support/libevent/libevent/run-ptest
index 0241851c70..b7d945246f 100644
--- a/meta/recipes-support/libevent/libevent/run-ptest
+++ b/meta/recipes-support/libevent/libevent/run-ptest
@@ -1,18 +1,28 @@
 #!/bin/sh
 
-fail=0
+# run-ptest - 'ptest' test infrastructure shell script that
+#   wraps the libevent test scripts 
+#
+# Trevor Gamblin <a class="moz-txt-link-rfc2396E" href="mailto:trevor.gamblin@windriver.com">&lt;trevor.gamblin@windriver.com&gt;</a>
+###############################################################
+LIBEVENTLIB=/usr/lib/libevent
+LOG="${LIBEVENTLIB}/ptest/libevent_ptest_$(date +%Y%m%d-%H%M%S).log"
+
+cd ${LIBEVENTLIB}/ptest 
+
 for test in ./test/*
 do
-        $test
-        if [ $? -ne 0 ]
-        then
-                fail=1
-        fi
+    $test 2&gt;&amp;1|tee -a ${LOG}
 done
 
-if [ $fail -eq 0 ]
-then
-        echo "PASS: libevent"
-else
-        echo "FAIL: libevent"
-fi
+passed=`grep OK ${LOG}|wc -l`
+failed=`grep FAILED ${LOG}|wc -l`
+skipped=`grep -E 'DISABLED|SKIPPED' ${LOG}|wc -l`
+all=$((passed + failed + skipped))
+
+(   echo "=== Test Summary ==="
+    echo "TOTAL: ${all}"
+    echo "PASSED: ${passed}"
+    echo "FAILED: ${failed}"
+    echo "SKIPPED: ${skipped}"
+) | tee -a ${LOG}
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Does this work correctly such that ptest-runner picks up the individual
test pass/fail results? I thought the tests would need individual
pass/fail lines for that to work?

Cheers,

Richard


</pre>
    </blockquote>
    <p>They do have individual pass/fail results in the ptest-runner
      output, but those don't match up with the pass/fail usually
      provided by ptest, so the log is parsed for
      OK/FAILED/SKIPPED/DISABLED and translated. Example output:</p>
    <code>write_cb: write 12<br>
      write_cb: write -1<br>
      === Test Summary ===<br>
      TOTAL: 316<br>
      PASSED: 300<br>
      FAILED: 0<br>
      SKIPPED: 16<br>
      DURATION: 87<br>
      END: /usr/lib/libevent/ptest<br>
      2019-09-06T14:50<br>
      STOP: ptest-runner</code><br>
    <p>Compare with the last log from autobuilder
(<a class="moz-txt-link-freetext" href="https://autobuilder.yocto.io/pub/non-release/20190829-10/testresults/qemux86-64-ptest/libevent.log">https://autobuilder.yocto.io/pub/non-release/20190829-10/testresults/qemux86-64-ptest/libevent.log</a>):</p>
    <p><code>write_cb: write 12</code><code><br>
      </code><code>write_cb: write -1</code><code><br>
      </code><code>FAIL: libevent</code><code><br>
      </code><code>DURATION: 116</code></p>
    <p><code></code>I'm working on a v2 to address multilib - I'll add
      the example output to the commit as well.<br>
    </p>
  </body>
</html>