mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
7e9798871a
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: 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-3-bvanassche@acm.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
33 lines
810 B
Bash
Executable File
33 lines
810 B
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
if ! make >/dev/null; then
|
|
echo "Building liblockdep failed."
|
|
echo "FAILED!"
|
|
exit 1
|
|
fi
|
|
|
|
find tests -name '*.c' | sort | while read -r i; do
|
|
testname=$(basename "$i" .c)
|
|
echo -ne "$testname... "
|
|
if gcc -o "tests/$testname" -pthread "$i" liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &&
|
|
[ "$(timeout 1 "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then
|
|
echo "PASSED!"
|
|
else
|
|
echo "FAILED!"
|
|
fi
|
|
rm -f "tests/$testname"
|
|
done
|
|
|
|
find tests -name '*.c' | sort | while read -r i; do
|
|
testname=$(basename "$i" .c)
|
|
echo -ne "(PRELOAD) $testname... "
|
|
if gcc -o "tests/$testname" -pthread -Iinclude "$i" &&
|
|
[ "$(timeout 1 ./lockdep "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then
|
|
echo "PASSED!"
|
|
else
|
|
echo "FAILED!"
|
|
fi
|
|
rm -f "tests/$testname"
|
|
done
|