]> code.ossystems Code Review - openembedded-core.git/commitdiff
valgrind: improvements for run-ptest
authorJackie Huang <jackie.huang@windriver.com>
Sun, 20 Aug 2017 13:21:28 +0000 (21:21 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Aug 2017 07:49:54 +0000 (08:49 +0100)
* Add statistic summary for run-ptest
* Ensure the script can be run anywhere

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/valgrind/valgrind/run-ptest

index f9a72ec4a9fb7055f14cdee09aa2c1d6909542ef..447d33c8cb8de67d029012e44f3aa03721e754ea 100755 (executable)
@@ -2,11 +2,24 @@
 
 # run-ptest - 'ptest' test infrastructure shell script that
 #   wraps the valgrind regression script vg_regtest. 
-#   Must be run in the /usr/lib/valgrind/ptest directory. 
 #
 # Dave Lerner <dave.lerner@windriver.com>
 ###############################################################
 VALGRINDLIB=@libdir@/valgrind
-tests/vg_regtest --all \
+LOG="${VALGRINDLIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
+
+cd ${VALGRINDLIB}/ptest && ./tests/vg_regtest --all \
     --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \
-       --yocto-ptest
+    --yocto-ptest 2>&1|tee ${LOG}
+
+passed=`grep PASS: ${LOG}|wc -l`
+failed=`grep FAIL: ${LOG}|wc -l`
+skipped=`grep 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}