This improves test coverage.

Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Waiman Long <long...@redhat.com>
Cc: Johannes Berg <johan...@sipsolutions.net>
Signed-off-by: Bart Van Assche <bvanass...@acm.org>
---
 tools/lib/lockdep/run_tests.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh
index bc36178329a8..c8fbd0306960 100755
--- a/tools/lib/lockdep/run_tests.sh
+++ b/tools/lib/lockdep/run_tests.sh
@@ -31,3 +31,17 @@ find tests -name '*.c' | sort | while read -r i; do
        fi
        rm -f "tests/$testname"
 done
+
+find tests -name '*.c' | sort | while read -r i; do
+       testname=$(basename "$i" .c)
+       echo -ne "(PRELOAD + Valgrind) $testname... "
+       if gcc -o "tests/$testname" -pthread -Iinclude "$i" &&
+               { timeout 10 valgrind --read-var-info=yes ./lockdep 
"./tests/$testname" >& "tests/${testname}.vg.out"; true; } &&
+               "tests/${testname}.sh" < "tests/${testname}.vg.out" &&
+               ! grep -Eq '(^==[0-9]*== (Invalid |Uninitialised ))|Mismatched 
free|Source and destination overlap| UME ' "tests/${testname}.vg.out"; then
+               echo "PASSED!"
+       else
+               echo "FAILED!"
+       fi
+       rm -f "tests/$testname"
+done
-- 
2.20.0.rc2.403.gdbc3b29805-goog

Reply via email to