#!/bin/bash

mkdir -p config
cat > config/autoconf.mk <<EOF
XPI_MODULE_VERS = $(dpkg-parsechangelog -S Version | sed s'/-[^-]*$//')

PERL = /usr/bin/perl
PYTHON = /usr/bin/python3

TB_PATH = "/usr/bin/thunderbird"
TB_ARGS = --headless --profile $(pwd)/test-profile

JSUNIT = $(pwd)/util/run-jsunit /usr/bin/perl /usr/bin/thunderbird --headless --profile $(pwd)/test-profile
EOF
debian/run-tests autopkgtest
test_ret=$?
printf 'looking at filesystems:\n'
cat /proc/mounts
printf 'contents of %s/test-profile/enigmail.sqlite:\n' "$(pwd)"
echo .dump | sqlite3 $(pwd)/test-profile/enigmail.sqlite
exit "$test_ret"
