#!/bin/sh -e

indir=${PWD}/examples/c
scriptdir=${PWD}/debian/tests/scripts
outdir=${ADT_ARTIFACTS-/tmp/morbig-package-test}/ocaml-api
mkdir -p ${outdir}
cd ${outdir}
cp ${indir}/dump.c ${indir}/Makefile .
cp ${scriptdir}/*.sh .
# This test fails on ppc64el
if [ `dpkg --print-architecture` = 'ppc64el' ] ; then
  echo "Don't fail testsuite on ppc64el, this test always failed there"
  make || true
  for script in *.sh; do
      ./dump ${script} > /dev/null || true
  done
else
  make
  for script in *.sh; do
      ./dump ${script} > /dev/null
  done
fi
