liblockdep: Add pthread_mutex_t test suite
This is a rather simple and basic test suite to test common locking issues. Beyond tests, it also shows how to use the library. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: torvalds@linux-foundation.org Link: http://lkml.kernel.org/r/1371163284-6346-5-git-send-email-sasha.levin@oracle.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
27
tools/lib/lockdep/run_tests.sh
Normal file
27
tools/lib/lockdep/run_tests.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#! /bin/bash
|
||||
|
||||
make &> /dev/null
|
||||
|
||||
for i in `ls tests/*.c`; do
|
||||
testname=$(basename -s .c "$i")
|
||||
gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null
|
||||
echo -ne "$testname... "
|
||||
if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then
|
||||
echo "PASSED!"
|
||||
else
|
||||
echo "FAILED!"
|
||||
fi
|
||||
rm tests/$testname
|
||||
done
|
||||
|
||||
for i in `ls tests/*.c`; do
|
||||
testname=$(basename -s .c "$i")
|
||||
gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null
|
||||
echo -ne "(PRELOAD) $testname... "
|
||||
if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then
|
||||
echo "PASSED!"
|
||||
else
|
||||
echo "FAILED!"
|
||||
fi
|
||||
rm tests/$testname
|
||||
done
|
Reference in New Issue
Block a user