summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2019-12-14 18:38:08 +0000
committerFrediano Ziglio <freddy77@gmail.com>2020-04-28 17:14:04 +0100
commit721cd5a1ef60e1045a3822a5cbe384f3113866f2 (patch)
tree57dc95787b26ad03671895490c8bb0213111a48e
parent9de14924464503b0fec7934997a5ff1858b45dfc (diff)
ci: Use magick.exe executable under Windows
On Windows beside the various single executables like Linux there's a single "magick" executable you can use specifying what you want to do. Having a single executable avoids the trick to fix "convert" problem and is easier to port, you just have to copy the single executable. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
-rwxr-xr-xtest-png18
1 files changed, 8 insertions, 10 deletions
diff --git a/test-png b/test-png
index b0fe1d2..8e4bdd9 100755
--- a/test-png
+++ b/test-png
@@ -19,16 +19,14 @@ verbose() {
# under Windows we don't need to run test under Wine
WINE=wine
+MAGICK=
if [ "x`uname -s`" != xLinux ]; then
WINE=
+ if command -V magick.exe &> /dev/null; then
+ MAGICK=magick.exe
+ fi
fi
-# this fixes search under Windows which often detect convert utility
-# under system directory, look for the one in the same directory as
-# mogrify
-CONVERT="$(command -v mogrify)"
-CONVERT="${CONVERT//mogrify/convert}"
-
# MSVC build put executables under <Configuration> directory
IMAGETEST=imagetest.exe
if [ -e ./Release/imagetest.exe ]; then
@@ -36,7 +34,7 @@ if [ -e ./Release/imagetest.exe ]; then
fi
compare_images() {
- DIFF=$(compare -metric AE $1 $2 - 2>&1 > /dev/null || true)
+ DIFF=$($MAGICK compare -metric AE $1 $2 - 2>&1 > /dev/null || true)
if [ "$DIFF" != "0" ]; then
error "Images $1 and $2 are too different, diff $DIFF"
fi
@@ -44,11 +42,11 @@ compare_images() {
do_test() {
echo "Running image $IMAGE with '$*'..."
- $CONVERT $IMAGE "$@" $IN
+ $MAGICK convert $IMAGE "$@" $IN
$WINE $IMAGETEST $IN $OUT_BMP $OUT
verbose ls -lh $IN
- verbose identify $IN
- verbose identify $OUT_BMP
+ verbose $MAGICK identify $IN
+ verbose $MAGICK identify $OUT_BMP
compare_images $IN $OUT
compare_images $IN $OUT_BMP
rm -f $IN $OUT $OUT_BMP