Skip to content

Commit da087b2

Browse files
bvanasscheingomolnar
authored andcommitted
tools/lib/lockdep/tests: Display compiler warning and error messages
If compilation of liblockdep fails, display an error message and exit immediately. Display compiler warning and error messages that are generated while building a test. Only run a test if compilation of it succeeded. 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-2-bvanassche@acm.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 2421b7f commit da087b2

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎tools/lib/lockdep/run_tests.sh‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#! /bin/bash
22
# SPDX-License-Identifier: GPL-2.0
33

4-
make &> /dev/null
4+
if ! make >/dev/null; then
5+
echo "Building liblockdep failed."
6+
echo "FAILED!"
7+
exit 1
8+
fi
59

610
for i in `ls tests/*.c`; do
711
testname=$(basename "$i" .c)
8-
gcc -o tests/$testname -pthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null
912
echo -ne "$testname... "
10-
if [ $(timeout 1 ./tests/$testname 2>&1 | wc -l) -gt 0 ]; then
13+
if gcc -o "tests/$testname" -pthread "$i" liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &&
14+
[ "$(timeout 1 "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then
1115
echo "PASSED!"
1216
else
1317
echo "FAILED!"
@@ -19,9 +23,9 @@ done
1923

2024
for i in `ls tests/*.c`; do
2125
testname=$(basename "$i" .c)
22-
gcc -o tests/$testname -pthread -Iinclude $i &> /dev/null
2326
echo -ne "(PRELOAD) $testname... "
24-
if [ $(timeout 1 ./lockdep ./tests/$testname 2>&1 | wc -l) -gt 0 ]; then
27+
if gcc -o "tests/$testname" -pthread -Iinclude "$i" &&
28+
[ "$(timeout 1 ./lockdep "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then
2529
echo "PASSED!"
2630
else
2731
echo "FAILED!"

0 commit comments

Comments
 (0)