#!/bin/sh

set -e

mkdir -p test-profile/extensions tmp
printf '%s/build/dist/' "$(pwd)" > 'test-profile/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}'
printf /usr/share/xul-ext/jsunit/ > 'test-profile/extensions/jsunit@enigmail.net'
printf 'user_pref("extensions.autoDisableScopes", 14);\n' > test-profile/prefs.js
export TMPDIR="$(pwd)/tmp"
export XAUTHORITY="$(pwd)/tmp/.Xauthority"

make check
find /tmp -ls
mkdir -p /tmp/.X11-unix
# FIXME: this does not return non-zero on failure (see
# https://bugs.debian.org/900792):
startx $(which make) unit -- $(which Xvfb) 
