2 # SPDX-License-Identifier: GPL-2.0
4 if ! make >/dev
/null
; then
5 echo "Building liblockdep failed."
10 find tests
-name '*.c' |
sort |
while read -r i
; do
11 testname
=$
(basename "$i" .c
)
12 echo -ne "$testname... "
13 if gcc
-o "tests/$testname" -pthread "$i" liblockdep.a
-Iinclude -D__USE_LIBLOCKDEP &&
14 timeout
1 "tests/$testname" 2>&1 |
/bin
/bash
"tests/${testname}.sh"; then
19 rm -f "tests/$testname"
22 find tests
-name '*.c' |
sort |
while read -r i
; do
23 testname
=$
(basename "$i" .c
)
24 echo -ne "(PRELOAD) $testname... "
25 if gcc
-o "tests/$testname" -pthread -Iinclude "$i" &&
26 timeout
1 .
/lockdep
"tests/$testname" 2>&1 |
27 /bin
/bash
"tests/${testname}.sh"; then
32 rm -f "tests/$testname"
35 find tests
-name '*.c' |
sort |
while read -r i
; do
36 testname
=$
(basename "$i" .c
)
37 echo -ne "(PRELOAD + Valgrind) $testname... "
38 if gcc
-o "tests/$testname" -pthread -Iinclude "$i" &&
39 { timeout
10 valgrind
--read-var-info=yes .
/lockdep
"./tests/$testname" >& "tests/${testname}.vg.out"; true
; } &&
40 /bin
/bash
"tests/${testname}.sh" < "tests/${testname}.vg.out" &&
41 ! grep -Eq '(^==[0-9]*== (Invalid |Uninitialised ))|Mismatched free|Source and destination overlap| UME ' "tests/${testname}.vg.out"; then
46 rm -f "tests/$testname"