提交 5ecb8e94 编写于 作者: B Bart Van Assche 提交者: Ingo Molnar

tools/lib/lockdep/tests: Improve testing accuracy

Instead of checking whether the tests produced any output, check the
output itself. This patch avoids that e.g. debug output causes the
message "PASSED!" to be reported for failed tests.
Signed-off-by: NBart Van Assche <bvanassche@acm.org>
Signed-off-by: NPeter 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-4-bvanassche@acm.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 7e979887
...@@ -11,7 +11,7 @@ find tests -name '*.c' | sort | while read -r i; do ...@@ -11,7 +11,7 @@ find tests -name '*.c' | sort | while read -r i; do
testname=$(basename "$i" .c) testname=$(basename "$i" .c)
echo -ne "$testname... " echo -ne "$testname... "
if gcc -o "tests/$testname" -pthread "$i" liblockdep.a -Iinclude -D__USE_LIBLOCKDEP && if gcc -o "tests/$testname" -pthread "$i" liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &&
[ "$(timeout 1 "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then timeout 1 "tests/$testname" 2>&1 | "tests/${testname}.sh"; then
echo "PASSED!" echo "PASSED!"
else else
echo "FAILED!" echo "FAILED!"
...@@ -23,7 +23,8 @@ find tests -name '*.c' | sort | while read -r i; do ...@@ -23,7 +23,8 @@ find tests -name '*.c' | sort | while read -r i; do
testname=$(basename "$i" .c) testname=$(basename "$i" .c)
echo -ne "(PRELOAD) $testname... " echo -ne "(PRELOAD) $testname... "
if gcc -o "tests/$testname" -pthread -Iinclude "$i" && if gcc -o "tests/$testname" -pthread -Iinclude "$i" &&
[ "$(timeout 1 ./lockdep "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then timeout 1 ./lockdep "tests/$testname" 2>&1 |
"tests/${testname}.sh"; then
echo "PASSED!" echo "PASSED!"
else else
echo "FAILED!" echo "FAILED!"
......
#!/bin/bash
grep -q 'WARNING: possible recursive locking detected'
#!/bin/bash
grep -q 'WARNING: possible recursive locking detected'
#!/bin/bash
grep -q 'WARNING: possible circular locking dependency detected'
#!/bin/bash
grep -q 'WARNING: possible circular locking dependency detected'
#!/bin/bash
grep -q 'WARNING: possible circular locking dependency detected'
#!/bin/bash
grep -q 'WARNING: possible circular locking dependency detected'
#!/bin/bash
grep -q 'WARNING: possible circular locking dependency detected'
#!/bin/bash
grep -q 'WARNING: possible circular locking dependency detected'
#!/bin/bash
grep -q 'WARNING: possible circular locking dependency detected'
#!/bin/bash
grep -q 'WARNING: possible recursive locking detected'
#!/bin/bash
grep -q 'WARNING: bad unlock balance detected'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册