Skip to content

Commit c6b87ee

Browse files
committed
hm2-idrom test: dump error logs to stdout on failure
stdout and dmesg are the only debug channels on buildbot. Also, fix .gitignore of test artifacts.
1 parent 9898998 commit c6b87ee

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Diff for: tests/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
result
22
stderr
33
bitops.0/bitops
4-
hm2-idrom/realtime.log.*
4+
hm2-idrom/realtime.log*

Diff for: tests/hm2-idrom/test.sh

+17-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ realtime stop
2525
LOG=realtime.log
2626
retval=0
2727

28+
# clean up after previous runs
29+
test -f ${LOG}.* && rm -f ${LOG}.*
30+
2831
TEST_PATTERN=0
2932
while [ ! -z "${Error[$TEST_PATTERN]}" ]; do
3033

@@ -39,12 +42,24 @@ while [ ! -z "${Error[$TEST_PATTERN]}" ]; do
3942

4043
realtime stop
4144

42-
if [ `egrep -e "${Error[$TEST_PATTERN]}" realtime.log | wc -l` != 1 ] ; then
43-
echo failed test $TEST_PATTERN: pattern "'${Error[$TEST_PATTERN]}'" not found
45+
if [ `egrep -e "${Error[$TEST_PATTERN]}" realtime.log | wc -l` != 1 ]; then
46+
echo failed test $TEST_PATTERN: pattern not found:
47+
echo "${Error[$TEST_PATTERN]}"
4448
cp $LOG ${LOG}.$TEST_PATTERN # save logs from errored tests
4549
retval=1
4650
fi
4751
TEST_PATTERN=$(($TEST_PATTERN+1))
4852
done
4953
rm -f $LOG
54+
55+
# if there's a failure, dump the log to stdout for debugging in buildbot
56+
if test $retval = 1; then
57+
for f in ${LOG}.*; do
58+
echo "************************************************************"
59+
echo "Failed test logfile $f:"
60+
cat $f
61+
echo
62+
done
63+
fi
64+
5065
exit $retval

0 commit comments

Comments
 (0)