#! /bin/sh

# Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.

TEXMFCNF=$srcdir/../kpathsea
TEXFONTMAPS="$srcdir/tests;$srcdir/data"
DVIPDFMXINPUTS="$srcdir/tests;$srcdir/data"
TEXPICTS=$srcdir/tests
export TEXMFCNF TEXFONTMAPS DVIPDFMXINPUTS TEXPICTS

failed=

echo "*** xdvipdfmx --version" \
	&& ./xdvipdfmx --version \
	&& echo && echo "xdvipdfmx-version tests OK" && echo \
	|| failed="$failed xdvipdfmx-version"

echo "*** xdvipdfmx --help" \
	&& ./xdvipdfmx --help \
	&& echo && echo "xdvipdfmx-help tests OK" && echo \
	|| failed="$failed xdvipdfmx-help"

echo "*** xdvipdfmx -v -o image2.pdf image" && echo \
	&& ./xdvipdfmx -v -o image2.pdf $srcdir/tests/image \
	&& echo && echo "xdvipdfmx-image tests OK" && echo \
	|| failed="$failed xdvipdfmx-image"	

test -z "$failed" && exit 0
echo
echo "failed tests:$failed"
exit 1