aboutsummaryrefslogtreecommitdiff
path: root/test-suite/failures.sh
blob: c89a488fb2c4994eaf76be130efacb4c359a5f89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash

# This script gathers the failures of a test.log after running the test-suite
# and shows in an easier to understand way. It's meant to be used by run.sh

if [[ $1 = '' ]]; then
  echo "syntax: $0 test.log"
  exit -1
fi
LOG=$1
DIR="`pwd`/sandbox/test-[^/]\+/"

grep "TEST-FAIL" $1 | awk '{print $3}' | sed 's%'$DIR'%%' | sort -u > .log

RET=0
if [ -s .log ]; then
  COUNT=`wc -l .log | awk '{print $1}'`
  echo "=========== $COUNT Failures =============="
  cat .log
  echo
  echo "=========== Full Log =============="
  egrep "(: error:)|(TEST-FAIL)" $LOG | grep -v "llvm\.o" | uniq
  RET=1
fi
rm .log
exit $RET