mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 08:52:27 +00:00
Here on Ubuntu/precise I have GNU/coreutils v8.13 installed
where 'basename -s' is not supported.
The result is that run_tests.sh is not done properly.
How to reproduce:
$ cd $BUILD_DIR
$ LC_ALL=C make -C tools/ liblockdep
$ cd tools/lib/lockdep/
$ LC_ALL=C ./run_tests.sh
basename: invalid option -- 's'
Try `basename --help' for more information.
... timeout: failed to run command `./tests/': Permission denied
FAILED!
rm: cannot remove `tests/': Is a directory
Due to unsupported basename the tests programs are not generated
and cannot be removed.
Fix this by doing a compatible basename invocation and check for
the existence of generated tests programs.
For more details see this LKML thread:
http://marc.info/?t=145906667300001&r=1&w=2
Signed-off-by: Sedat Dilek <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Sasha Levin <[email protected]> (maintainer:LIBLOCKDEP)
Cc: Shuah Khan <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: linux-fsdevel <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
32 lines
728 B
Bash
Executable File
32 lines
728 B
Bash
Executable File
#! /bin/bash
|
|
|
|
make &> /dev/null
|
|
|
|
for i in `ls tests/*.c`; do
|
|
testname=$(basename "$i" .c)
|
|
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
|
|
if [ -f "tests/$testname" ]; then
|
|
rm tests/$testname
|
|
fi
|
|
done
|
|
|
|
for i in `ls tests/*.c`; do
|
|
testname=$(basename "$i" .c)
|
|
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
|
|
if [ -f "tests/$testname" ]; then
|
|
rm tests/$testname
|
|
fi
|
|
done
|