aboutsummaryrefslogtreecommitdiff
path: root/test/html
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-06-01 16:02:03 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-06-01 20:24:32 +0200
commita9b0dbf86eff75ff1f756e6121424f60287713dc (patch)
tree61b79f5d899ed135c8b496b155ec1d02e83eb45d /test/html
parent620126ab1a1fff783ccf71155e0831f35ae8bf83 (diff)
Ensure the compare command can fail safely
As we run the driver with "set -e", it will stop on the first failure. The compare(1) command from magick exits with non-zero when the inputs are not equal: > The compare program returns 2 on error, 0 if the images are similar, > or a value between 0 and 1 if they are not similar. So, to prevent it from interrupting the cleanup steps after the comparison, we make it always success.
Diffstat (limited to 'test/html')
-rwxr-xr-xtest/html/driver.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/html/driver.sh b/test/html/driver.sh
index 5c69fcde..08bdb13e 100755
--- a/test/html/driver.sh
+++ b/test/html/driver.sh
@@ -77,7 +77,7 @@ function test_file() {
render_page "$ref_file" "$wdir/ref.png"
# AE = Absolute Error count of the number of different pixels
- diffcount=$(compare -metric AE "$wdir/html.png" "$wdir/ref.png" "$wdir/diff.png" 2>&1)
+ diffcount=$(compare -metric AE "$wdir/html.png" "$wdir/ref.png" "$wdir/diff.png" 2>&1 || true)
# The test passes only if both images are identical
if [ "$diffcount" = "0" ]; then