Skip to contentSkip to conversation

valgrind: improvements for run-ptest

PATCH New [email protected] 1 participant 1 message Aug 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 valgrind: improvements for run-ptest

From: Jackie Huang <[email protected]>

* Add statistic summary for run-ptest
* Ensure the script can be run anywhere

---
 meta/recipes-devtools/valgrind/valgrind/run-ptest | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
meta/recipes-devtools/valgrind/valgrind/run-ptest +16 -3
index f9a72ec4a9..447d33c8cb 100755
@@ -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 <[email protected]>
 ###############################################################
 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}
Signature · 1 line
2.11.0