#! /bin/sh
# One argument is required which is the path to the toplevel directory
# of the distribution.

top_srcdir=$1

trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="test.bin test.out"
# Make sure no files are left over.
rm -fr $tmpfiles

uudecode $top_srcdir/checks/testdata

uuencode test.bin test.bin > test.out

cmp $top_srcdir/checks/testdata test.out &> /dev/null
result=$?

rm -fr $tmpfiles

exit $result

# Preserve executable bits for this shell script.
# Thanks to Noah Friedman for this great trick.
Local Variables:
Eval: (defun frobme () (set-file-modes buffer-file-name file-mode))
Eval: (make-local-variable 'file-mode)
Eval: (setq file-mode (file-modes (buffer-file-name)))
Eval: (make-local-variable 'after-save-hook)
Eval: (add-hook 'after-save-hook 'frobme)
End:
