#!/bin/bash
set -e

pkg=libtingea-dev

export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"

for i in *.c ; do gcc -o $(basename $i .c) $i -ltingea ; done

./cff_bitpat
# FIXME: ./cff_edit -h  has non-zero exit code
./cff_hashfile
./cff_link
# ./cff_match  has non-zero exit code
./cff_optoid
./cff_pagesize
./cff_rand
./cff_read
./cff_reap -h
# FIXME: ./cff_sow dumps core!
./cff_tring
./cff_tst
./cff_ttwhy
# FIXME: ./cff_unit_ceilfloor has non-zero exit code
