test: Amend check-refs.sh to support out-of-tree builds

This commit is contained in:
Chris Wilson 2013-07-04 10:04:30 +01:00
parent 8b4151a5e5
commit 8b55703d76
2 changed files with 6 additions and 17 deletions

View file

@ -450,11 +450,11 @@ $(NOLOG_TESTS_LOG):
# Identify identical reference images
check-ref-dups: check-refs.sh $(top_builddir)/test/pdiff/perceptualdiff
cd $(srcdir) && sh ./check-refs.sh
sh $(srcdir)/check-refs.sh $(top_builddir)/test/pdiff/perceptualdiff
# Remove identical reference images (DANGEROUS)
clean-ref-dups: check-refs.sh $(top_builddir)/test/pdiff/perceptualdiff
cd $(srcdir) && sh ./check-refs.sh | cut -d' ' -f2 | while read f; do git rm "reference/$$f"; done
sh $(srcdir)/check-refs.sh | cut -d' ' -f2 | while read f; do git rm "reference/$$f"; done
results.tar:
@tar cf $@ index.html testtable.js *.log output/*.log; \

View file

@ -1,23 +1,12 @@
#!/bin/bash
current_dir=$(pwd)
cd $(dirname $0)/reference || exit
# Move to the reference directory as needed
if [ $(basename $current_dir) != 'test' ]; then
if [ -d test ]; then
cd test || exit 1
fi
fi
if [ $(basename $current_dir) != 'reference' ]; then
if [ -d reference ]; then
cd reference || exit 2
fi
fi
pdiff=../pdiff/perceptualdiff
pdiff=$1
[ -n "$pdiff" ] || pdiff=../pdiff/perceptualdiff
if [ ! -e "${pdiff}" ]; then
echo "Error: requires ${pdiff} executable"
exit 3
exit 128
fi
for file in *.ref.png; do