Skip to content

Commit 09ce987

Browse files
author
Aaron Roller
authored
Merge pull request #13 from steve-taylor/master
fix: stop reporting errors when there are none
2 parents 65886f7 + e0b6223 commit 09ce987

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

detection.sh

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,11 @@ 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"
3322
return 1
3423
fi
3524
}

0 commit comments

Comments
 (0)