1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#!/bin/sh
#
# Author: Paul Hardy, unifoundry <at> unifoundry.com
#
# Copyright (C) 2018, 2019, 2020 Paul Hardy
#
# LICENSE:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
set -e
# The input file to convert
INFILE=../examples/byzantine.prep
# The output file of the conversion
OUTFILE=test-prep-1.beta
# The reference file to compare the output against
CMPFILE=../examples/byzantine.beta
#
# Create temporary directory for test
# output if AUTOPKGTEST_TMP is undefined.
# Debian GNU/Linux defines AUTOPKGTEST_TMP.
#
if [ "x${AUTOPKGTEST_TMP}" = "x" ] ; then
TEST_TMP=$(mktemp -d)
trap "\rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
else
TEST_TMP=${AUTOPKGTEST_TMP}
fi
#
# Point to the source directory for test.
#
if [ "x${srcdir}" = "x" ] ; then
srcdir=.
fi
#
# Point to binary executable; unibetacode_bindir
# should be defined for "make installcheck".
# Otherwise, leave undefined for "make check".
#
if [ "x${unibetacode_bindir}" = "x" ] ; then
unibetacode_bindir=../src
fi
${unibetacode_bindir}/unibetaprep \
< ${srcdir}/${INFILE} \
> ${TEST_TMP}/${OUTFILE}
diff ${srcdir}/${CMPFILE} ${TEST_TMP}/${OUTFILE} || \
(echo "test-prep-1 FAILED; output in ${TEST_TMP}/${OUTFILE}" ; exit 1)
#
# If AUTOPKGTEST_TMP was defined, don't remove it;
# a Debian calling process will take care of that.
#
if [ "x${AUTOPKGTEST_TMP}" = "x" ] ; then
\rm -rf ${TEST_TMP}
fi
|