File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,14 @@ find_fail(){
1414 target=$1
1515 file=$2
1616 suite_line=$( cat " $file " | grep " $target " )
17- if echo " $suite_line " | grep " failures=\" 0\" " ; then
18- if echo " $suite_line " | grep -L " errors=\" [1-9]\d*\" " ; then
19- echo " Error found in $file : $suite_line "
20- return 1
21- else
22- return 0
23- fi
24- elif echo " $suite_line " | grep -L " errors=\" 0\" " ; then
25- if echo " $suite_line " | grep -L " failures=\" [1-9]\d*\" " ; then
26- echo " Error found in $file : $suite_line "
27- return 1
28- else
29- return 0
30- fi
31- else
32- echo " Failure found in $file : $suite_line "
17+ if echo " $suite_line " | grep -q -E " failures=\" [1-9]\\ d*\" " ; then
18+ echo " Failure(s) found in $file : $suite_line "
19+ return 1
20+ elif echo " $suite_line " | grep -q -E " errors=\" [1-9]\\ d*\" " ; then
21+ echo " Error(s) found in $file : $suite_line "
22+ return 1
23+ elif echo " $suite_line " | grep -qv -E " failures=\" 0\" " ; then
24+ echo " Test report may be malformed: No errors were detected, but the failures attribute is missing from the testsuite element."
3325 return 1
3426 fi
3527}
You can’t perform that action at this time.
0 commit comments