mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 03:30:10 +01:00
glcpp: Make test suite test for valgrind cleanliness.
As it turns out, 4 of our current tests are not valgrind clean, (use after free errors or so), so this will be helpful for investigating and fixing those.
This commit is contained in:
parent
3a530b8ef6
commit
d1500f8a19
1 changed files with 21 additions and 1 deletions
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
total=0
|
||||
pass=0
|
||||
clean=0
|
||||
|
||||
echo "====== Testing for correctness ======"
|
||||
for test in *.c; do
|
||||
echo -n "Testing $test..."
|
||||
../glcpp < $test > $test.out
|
||||
|
|
@ -16,10 +18,28 @@ for test in *.c; do
|
|||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "$pass/$total tests returned correct results"
|
||||
echo ""
|
||||
|
||||
if [ "$pass" = "$total" ] ; then
|
||||
echo "====== Testing for valgrind cleanliness ======"
|
||||
for test in *.c; do
|
||||
echo -n "Testing $test with valgrind..."
|
||||
if valgrind --error-exitcode=1 --log-file=$test.valgrind-errors ../glcpp < $test >/dev/null; then
|
||||
echo "CLEAN"
|
||||
clean=$((clean+1))
|
||||
rm $test.valgrind-errors
|
||||
else
|
||||
echo "ERRORS"
|
||||
cat $test.valgrind-errors
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "$pass/$total tests returned correct results"
|
||||
echo "$clean/$total tests are valgrind-clean"
|
||||
|
||||
if [ "$pass" = "$total" ] && [ "$clean" = "$total" ]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue