#! /bin/sh

#
# Self tests
#

set -e

driver="$TOP_BUILDDIR/mhd"
digest="$TOP_BUILDDIR/tests/0001-$$.digest"

$driver -h > /dev/null || true # -h always fail
$driver -l > /dev/null

# test 1
$driver README > $digest
$driver -c $digest > /dev/null

# test 2 (stdin)
cat << EOH > $digest
SHA512(README)= $($driver < README)
EOH
$driver -c < $digest > /dev/null

rm $digest
