#!/bin/sh

# Set by TESTS_ENVIRONMENT in Makefile.am
abs_top_srcdir=$ABS_TOP_SRCDIR
abs_top_builddir=$ABS_TOP_BUILDDIR

if [ ! -f $abs_top_builddir/tools/exp_combine ]; then
  echo "Skipping test-exp-combine due to lack of exp_combine executable"
  exit 77
else
  $abs_top_builddir/tools/exp_combine                              \
          $abs_top_builddir/tests/simple/exp-combine.hdr           \
          $abs_top_srcdir/tests/compositions/data/parliament_0.png \
          $abs_top_srcdir/tests/compositions/data/parliament_1.png \
          $abs_top_srcdir/tests/compositions/data/parliament_2.png \
  && $abs_top_builddir/tools/gegl-imgcmp                           \
          $abs_top_srcdir/tests/simple/reference/exp-combine.hdr   \
          $abs_top_builddir/tests/simple/exp-combine.hdr
  returncode=$?
  # if [ $returncode -eq 0 ]; then
  #   rm -f $abs_top_builddir/tests/simple/test-exp-combine.hdr
  # fi
fi

exit $returncode
# echo "WARNING: The result of this test is being ignored!"
# exit 0
