Skip to content

Commit 692d67a

Browse files
authored
Merge pull request #1173 from ldorau/Check_valgrind_log_files
Check valgrind log files
2 parents 5c659c8 + 6483c54 commit 692d67a

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

test/test_valgrind.sh

+23-1
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,33 @@ echo
188188
echo "======================================================================"
189189
echo
190190

191-
for log in $(ls -1 ${PATH_TESTS}.log ${PATH_EXAMPLES}.log); do
191+
LOG_FILES=""
192+
NT=$(ls -1 ${PATH_TESTS}.log 2>/dev/null | wc -l)
193+
if [ $NT -gt 0 ]; then
194+
LOG_FILES="$LOG_FILES $(ls -1 ${PATH_TESTS}.log | xargs)"
195+
fi
196+
NE=$(ls -1 ${PATH_EXAMPLES}.log 2>/dev/null | wc -l)
197+
if [ $NE -gt 0 ]; then
198+
LOG_FILES="$LOG_FILES $(ls -1 ${PATH_EXAMPLES}.log | xargs)"
199+
fi
200+
if [ $(($NT + $NE)) -eq 0 ]; then
201+
echo
202+
echo "FATAL ERROR: no log files found, but number of failed tests equals $ANY_TEST_FAILED!"
203+
echo
204+
exit 1
205+
fi
206+
207+
for log in $LOG_FILES; do
192208
echo ">>>>>>> LOG $log"
193209
cat $log
194210
echo
195211
echo
196212
done
197213

214+
if [ $(($NT + $NE)) -ne $ANY_TEST_FAILED ]; then
215+
echo
216+
echo "ERROR: incorrect number of log files: ANY_TEST_FAILED=$ANY_TEST_FAILED != ($NT + $NE)"
217+
echo
218+
fi
219+
198220
exit 1

0 commit comments

Comments
 (0)