Skip to content

Commit 4db87db

Browse files
author
Aaron Roller
authored
Merge pull request #14 from AutoModality/12/bad-grep
12/bad grep
2 parents afda90f + 09ce987 commit 4db87db

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,3 @@ jobs:
7171
path: ${{ env.RESULTS_PATH }}
7272
7373
```
74-

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)