-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
FILENAME=$1 | ||
|
||
if [ ! -e "$FILENAME" ]; then | ||
echo "Error: File '$FILENAME' not found." | ||
exit 1 | ||
fi | ||
|
||
echo "Analyzing headless test results from file: '$FILENAME'" | ||
if grep -q 'title="FAILED"' "$FILENAME"; then | ||
failed_info=$(grep -oE '<div id="[^"]+" title="FAILED">([^<]+)' "$FILENAME" | awk 'NR==1 {print substr($0, index($0,$4))}') | ||
echo $failed_info | ||
FAILED_INFO=$(grep -oE '<div id="[^"]+" title="FAILED">([^<]+)' "$FILENAME" | awk 'NR==1 {print substr($0, index($0,$4))}') | ||
echo "$FAILED_INFO" | ||
exit 1 | ||
elif grep -q 'title="OK"' "$FILENAME"; then | ||
grep -oE '<div id="[^"]+" title="OK">([^<]+)' "$FILENAME" | awk '{print substr($0, index($0,$4))}' | ||
echo "Success: all tests passed." | ||
else | ||
cat "$FILENAME" | ||
echo "No test results found. Check $FILENAME output." | ||
echo "No test results found. Check '$FILENAME' output." | ||
exit 1 | ||
fi |