#!/bin/sh

# executables
BABEL=$1
CONVERT=$2
COMPARE=$3

# files
OBFILE=$4
IMAGEDIR=$5
IMAGEFILE=$6
REF_IMAGE=$7

echo $BABEL ${OBFILE} ${IMAGEDIR}/${IMAGEFILE}.svg
$BABEL ${OBFILE} ${IMAGEDIR}/${IMAGEFILE}.svg

echo $CONVERT ${IMAGEDIR}/${IMAGEFILE}.svg ${IMAGEDIR}/${IMAGEFILE}.png
$CONVERT ${IMAGEDIR}/${IMAGEFILE}.svg ${IMAGEDIR}/${IMAGEFILE}.png

echo $COMPARE -metric AE ${IMAGEDIR}/${IMAGEFILE}.png ${REF_IMAGE} ${IMAGEDIR}/${IMAGEFILE}_diff.png
$COMPARE -metric AE ${IMAGEDIR}/${IMAGEFILE}.png ${REF_IMAGE} ${IMAGEDIR}/${IMAGEFILE}_diff.png
