Skip to content

Commit

Permalink
icon-explorer: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Mar 18, 2024
1 parent fbfd2b0 commit 2e3c925
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/icon-explorer/bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,30 @@ echo '<?xml version="1.0" encoding="UTF-8"?>' > diff.xml
echo '<testsuites>' >> diff.xml
echo ' <testsuite name="Test Suite" device="emulator-18730" tests="4" failures="0" time="86">' >> diff.xml

EXIT=0
for i in *.png; do
pixels=$(compare -crop 1440x3120+0+100 -metric AE $i snapshot/$i diff/$i 2>&1 || true)
if [ -z "$CI" ]; then
echo $i: $pixels
fi
if [ "$pixels" != "0" ]; then
EXIT=1
echo "$i: FAILURE - $pixels pixels different"

echo " <testcase id=\"$i\" name=\"$i\" time=\"1\" status=\"FAILURE\">" >> diff.xml
echo " <failure message=\"$pixels pixels different\"/>" >> diff.xml
echo " <properties>" >> diff.xml
echo " <property name=\"attachment\" value=\"diff/$i\" />" >> diff.xml
echo " </properties>" >> diff.xml
echo " </testcase>" >> diff.xml
else
echo "$i: SUCCESS"

echo " <testcase id=\"$i\" name=\"$i\" time=\"1\" status=\"SUCCESS\"/>" >> diff.xml
fi
done

echo ' </testsuite>' >> diff.xml
echo '</testsuites>' >> diff.xml

exit $EXIT

0 comments on commit 2e3c925

Please sign in to comment.