229cbf
#!/usr/bin/bash
229cbf
# Print reftest failures and compose them to html
229cbf
229cbf
TEST_DIR="$1"
229cbf
TEST_FLAVOUR="$2"
229cbf
OUTPUT_FILE="failures-reftest$TEST_FLAVOUR.html"
229cbf
229cbf
grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" -e "IMAGE 1 (TEST):" -e "IMAGE 2 (REFERENCE):" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > $OUTPUT_FILE
229cbf
sed -i '/REFTEST   IMAGE 1/a ">' $OUTPUT_FILE
229cbf
sed -i '/REFTEST   IMAGE 2/a ">

' $OUTPUT_FILE
229cbf
sed -i '/REFTEST TEST/a 
' $OUTPUT_FILE
229cbf
sed -i -e 's/^REFTEST   IMAGE 1 (TEST): /
229cbf
sed -i -e 's/^REFTEST   IMAGE 2 (REFERENCE): /