tools/lib/lockdep/tests: Run lockdep tests a second time under Valgrind
authorBart Van Assche <bvanassche@acm.org>
Fri, 7 Dec 2018 01:11:28 +0000 (17:11 -0800)
committerIngo Molnar <mingo@kernel.org>
Tue, 11 Dec 2018 13:54:49 +0000 (14:54 +0100)
This improves test coverage.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <longman@redhat.com>
Cc: johannes.berg@intel.com
Cc: tj@kernel.org
Link: https://lkml.kernel.org/r/20181207011148.251812-5-bvanassche@acm.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/lib/lockdep/run_tests.sh

index bc36178..c8fbd03 100755 (executable)
@@ -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