[oe-commits] [openembedded-core] 03/04: libevent: add granularity to ptest log

git at git.openembedded.org git at git.openembedded.org
Sat Sep 7 12:09:20 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit fb17b46e202cc08277d3eeb34872067c73a6bfbc
Author: Trevor Gamblin <trevor.gamblin at windriver.com>
AuthorDate: Fri Sep 6 14:51:59 2019 -0400

    libevent: add granularity to ptest log
    
    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.
    
    libevent's ptest output did not comply with the automake-style output
    "result: testname", and reported a FAIL status at the end of the test
    run if any of the libevent tests failed. This patch makes the log
    consistent with the automake style:
    
        PASS: http/cancel_by_host_no_ns
        PASS: http/cancel_inactive_server
        PASS: http/cancel_by_host_no_ns_inactive_server
        SKIPPED: http/cancel_by_host_server_timeout
        SKIPPED: http/cancel_server_timeout
    
    and provides a summary as follows:
    
        === Test Summary ===
        TOTAL: 316
        PASSED: 300
        FAILED: 0
        SKIPPED: 16
        DURATION: 87
        END: /usr/lib/libevent/ptest
    
    Signed-off-by: Trevor Gamblin <trevor.gamblin at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-support/libevent/libevent/run-ptest | 34 +++++++++++++++---------
 meta/recipes-support/libevent/libevent_2.1.11.bb |  3 +++
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-support/libevent/libevent/run-ptest b/meta/recipes-support/libevent/libevent/run-ptest
index 0241851..080806d 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 <trevor.gamblin at windriver.com>
+###############################################################
+LIBEVENTLIB=@libdir@/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>&1| sed -e '/OK/ s/^/PASS: / ; /FAILED/ s/^/FAIL: / ; /SKIPPED/ s/^/SKIP: / ; /DISABLED/ s/^/SKIP: /' | cut -f1,2 -d ':' | tee -a ${LOG}
 done
 
-if [ $fail -eq 0 ]
-then
-	echo "PASS: libevent"
-else
-	echo "FAIL: libevent"
-fi
+passed=`grep PASS ${LOG}|wc -l`
+failed=`grep FAIL ${LOG}|wc -l`
+skipped=`grep -E SKIP ${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}
diff --git a/meta/recipes-support/libevent/libevent_2.1.11.bb b/meta/recipes-support/libevent/libevent_2.1.11.bb
index 1e18f0a..f005ab8 100644
--- a/meta/recipes-support/libevent/libevent_2.1.11.bb
+++ b/meta/recipes-support/libevent/libevent_2.1.11.bb
@@ -43,4 +43,7 @@ do_install_ptest() {
 	do
 		install -m 0755 $file ${D}${PTEST_PATH}/test
 	done
+        
+        # handle multilib
+        sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list