#!/bin/sh
set -e

TEMP=${AUTOPKGTEST_TMP:-${TMPDIR:-/tmp}}
TDIR=$(mktemp -d $TEMP/smokeXXXXXX)
export HOME=$AUTOPKGTEST_TMP

# create some configuration needed in home
mkdir -p ${HOME}/.when
touch ${HOME}/.when/calendar
echo 'editor = sensible-editor' > ${HOME}/.when/preferences

# create temporary directory
mkdir -p ${TDIR}

# copy Makefile
cp -a Makefile ${TDIR}

# change directory to temporary test directory
cd ${TDIR}

# run testsuite with installed when
make test
