#!/bin/sh

set -e

# Sanity check
test -n "${AUTOPKGTEST_TMP}"

# Copy all tests to an empty directory and change to it.
cp -pr tests "${AUTOPKGTEST_TMP}/"
cd "${AUTOPKGTEST_TMP}/"

# Use installed copy instead of built one
sed -e 's:\$builddir/src/zile:/usr/bin/zile:g' -i tests/run-lisp-tests.pl

# Run all tests
perl tests/run-lisp-tests.pl $(find tests -name '*.el') > /dev/null
