#!/usr/bin/bash
set -e
# Especially t/03_show.t expects installed files in a working directory. Copy
# or symlink them there.
DIR=$(mktemp -d)
cp -a /usr/libexec/perl-PPI-PowerToys/* "$DIR"
mkdir -p "$DIR"/lib/PPI "$DIR"/script "$DIR"/blib/lib/auto "$DIR"/blib/arch
ln -s /usr/share/perl5/vendor_perl/PPI/PowerToys.pm "$DIR"/lib/PPI
ln -s /usr/bin/ppi_copyright "$DIR"/script
ln -s /usr/bin/ppi_version "$DIR"/script
pushd "$DIR"
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
popd
rm -r "$DIR"
