Commit 7e979887 authored by Bart Van Assche's avatar Bart Van Assche Committed by Ingo Molnar

tools/lib/lockdep/tests: Fix shellcheck warnings

Use find instead of ls to avoid splitting filenames that contain spaces.
Use rm -f instead of if ... then rm ...; fi. This patch addresses all
shellcheck complaints about the run_tests.sh shell script.
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarPeter 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-3-bvanassche@acm.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent da087b22
...@@ -7,7 +7,7 @@ if ! make >/dev/null; then ...@@ -7,7 +7,7 @@ if ! make >/dev/null; then
exit 1 exit 1
fi fi
for i in `ls tests/*.c`; do 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 &&
...@@ -16,12 +16,10 @@ for i in `ls tests/*.c`; do ...@@ -16,12 +16,10 @@ for i in `ls tests/*.c`; do
else else
echo "FAILED!" echo "FAILED!"
fi fi
if [ -f "tests/$testname" ]; then rm -f "tests/$testname"
rm tests/$testname
fi
done done
for i in `ls tests/*.c`; do 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" &&
...@@ -30,7 +28,5 @@ for i in `ls tests/*.c`; do ...@@ -30,7 +28,5 @@ for i in `ls tests/*.c`; do
else else
echo "FAILED!" echo "FAILED!"
fi fi
if [ -f "tests/$testname" ]; then rm -f "tests/$testname"
rm tests/$testname
fi
done done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment