#!/bin/bash
set -e

if [ "$AUTOPKGTEST_ARTIFACTS" ]; then
    cd "$AUTOPKGTEST_ARTIFACTS"
elif [ "$AUTOPKGTEST_TMP" ]; then
    cd "$AUTOPKGTEST_TMP"
else
    echo 'Writing xtruss log to .'
fi

: ${XTRUSS:=xtruss}

set -x

xvfb-run -a \
	 $XTRUSS -o xtruss.out \
	 xwininfo -root

grep '^GetGeometry' xtruss.out
grep -P '^QueryTree\(window=w\#\w+\) = \{root=.*, parent=None\}$' xtruss.out

echo ok.
