#!/bin/sh
set -ex

# dep8 smoke test for rdiff-backup
# Author: Otto Kekäläinen <otto@debian.org>
#
# This very simple test just checks that the binary starts and prints out
# the usual complaint:
#   Fatal Error: No arguments given
#   See the rdiff-backup manual page for more information.

if rdiff-backup --print-statistics 2>&1 | grep -qF 'rdiff-backup: error: Action backup requires 2 location(s) instead of [].'
then
  echo "Basic smoke test passed"
else
  echo "Error: Basic smoke test failed, rdiff-backup might not even run"
  exit 1
fi

if rdiff-backup --version | grep -q 'DEV'
then
  echo "Error: Version is 'DEV'"
  exit 1
else
  echo "Version test passed"
fi
