#!/bin/sh
# Build a program against librsync-dev and run a signature/delta/patch round
# trip with it.
set -e
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
    CROSS_COMPILE=
fi
inputs=$PWD/tests/changes.input
"${CROSS_COMPILE}gcc" -Wall -o "$AUTOPKGTEST_TMP/roundtrip" debian/tests/test-librsync-dev.c -lrsync
cd "$AUTOPKGTEST_TMP"
./roundtrip "$inputs/01.input" "$inputs/02.input" sig delta out
cmp "$inputs/02.input" out
echo "round trip OK"
