#!/bin/sh
# autopkgtest check based on upstream check ($ make -C test)
# written for Debian by Jerome Benoit <calculus@rezozer.net> on behalf of the Debian Tex Maintainers team
# copyright: 2015-2016 Jerome Benoit <calculus@rezozer.net>
# distributed under the terms and conditions of GPL version 2 or later

set -ue

cp -prd test $ADTTMP

cat << EOF > $ADTTMP/test/GNUmakefile
#!/usr/bin/make -f

PERL = /usr/bin/perl

BIBTOOLPROG = /usr/bin/bibtool

default:

check:
	BIBTOOLPROG=\$(BIBTOOLPROG) \$(PERL) -MBUnit -e "exit all()" || find . -name '*.err*' -o -name '*.out*' -printf "\n%f" | sort | xargs tail -n +1

clean:
	rm -f *.out* *.err*

EOF

make -C $ADTTMP/test check

exit 0
