#!/bin/bash
set -e

pkg="pftools"

if [ "$ADTTMP" = "" ] ; then
  ADTTMP=$(mktemp -d /tmp/${pkg}-${testbin}-test.XXXXXX)
  trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM
fi

cd $ADTTMP

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

. ./test.sh | \
    sed -e '/^MA/s/\(N_SCORE=[68].5\)0*/\1/' \
        -e '/^DT  */d' \
        -e 's:CC   /GENERATED_BY="/usr/bin/pfmake:CC   /GENERATED_BY="./pfmake:' > test.runtime
zcat test.out | grep -v '^DT  *'  > test.compare
diff -u test.compare test.runtime
