Linux Audio

Check our new training course

Loading...
v3.15
 1#! /bin/bash
 
 2
 3make &> /dev/null
 
 
 
 
 4
 5for i in `ls tests/*.c`; do
 6	testname=$(basename -s .c "$i")
 7	gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null
 8	echo -ne "$testname... "
 9	if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then
 
10		echo "PASSED!"
11	else
12		echo "FAILED!"
13	fi
14	rm tests/$testname
15done
16
17for i in `ls tests/*.c`; do
18	testname=$(basename -s .c "$i")
19	gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null
20	echo -ne "(PRELOAD) $testname... "
21	if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then
 
 
22		echo "PASSED!"
23	else
24		echo "FAILED!"
25	fi
26	rm tests/$testname
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27done
v5.4
 1#! /bin/bash
 2# SPDX-License-Identifier: GPL-2.0
 3
 4if ! make >/dev/null; then
 5    echo "Building liblockdep failed."
 6    echo "FAILED!"
 7    exit 1
 8fi
 9
10find 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
15		echo "PASSED!"
16	else
17		echo "FAILED!"
18	fi
19	rm -f "tests/$testname"
20done
21
22find 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
28		echo "PASSED!"
29	else
30		echo "FAILED!"
31	fi
32	rm -f "tests/$testname"
33done
34
35find 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
42		echo "PASSED!"
43	else
44		echo "FAILED!"
45	fi
46	rm -f "tests/$testname"
47done