summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-04 10:04:30 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-04 10:04:30 +0100
commit8b55703d760a0032772d7f9b1d17438b2db3f1b4 (patch)
treef8fb08246e8ad6137fb55d343b6ec764c5c539fc /test
parent8b4151a5e59cd2036e32c0eeb13afe420a434e19 (diff)
test: Amend check-refs.sh to support out-of-tree builds
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am4
-rwxr-xr-xtest/check-refs.sh19
2 files changed, 6 insertions, 17 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 6096eb0c7..a9495dc5b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -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; \
diff --git a/test/check-refs.sh b/test/check-refs.sh
index b9b1031b6..74abe9f85 100755
--- a/test/check-refs.sh
+++ b/test/check-refs.sh
@@ -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