[cairo-commit] test/Makefile.am

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Jan 23 11:58:09 PST 2008


 test/Makefile.am |   36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

New commits:
commit e7c0a69dcb627abb677f84473a9e3857b2d89a69
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jan 23 14:57:42 2008 -0500

    [test] Also check for reference images listed in Makefile.am but missing
    in git, and if this is not a git checkout, in source directory.

diff --git a/test/Makefile.am b/test/Makefile.am
index 7ba6c5d..207f6e3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -712,20 +712,38 @@ index.html: $(srcdir)/make-html.pl $(TESTS:$(EXEEXT)=.log)
 
 # Identify identical reference images
 check-ref-dups:
-	@sha1sum *-ref.png > ref.hash
-	@join ref.hash ref.hash | grep -v -E '( .*-ref.png).*\1' | cut -d' ' -f 1-2 | sort -u
+	@( cd "$(scrdir)" && sha1sum *-ref.png ) > ref.hash; \
+	join ref.hash ref.hash | grep -v -E '( .*-ref.png).*\1' | cut -d' ' -f 1-2 | sort -u
 
 # Not exactly the best script in the world...
 check-ref-missing:
-	@missing=""; \
-	for i in `git ls-files *-ref.png`; do \
-	    echo ${REFERENCE_IMAGES} | grep -sq $$i || missing="$$missing $$i" ; \
+	@cd "$(srcdir)"; \
+	REFS=`git ls-files "*-ref.png"`; \
+	test x = "x$$REFS" && REFS=`ls *-ref.png`; \
+	ret=true; \
+	missing=""; \
+	for i in $$REFS; do \
+	    echo "" $(REFERENCE_IMAGES) "" | grep -sq " $$i " || missing="$$missing $$i" ; \
 	done ; \
 	if test -n "$$missing"; then \
-		echo "Some reference files are not included in the distribution." ;\
-		echo "Missing from REFERENCE_IMAGES:$$missing" ; \
-		exit 1; \
-	fi
+		echo "*** Error: Sanity check failed"; \
+		echo "Some reference files are not included in the distribution."; \
+		echo "You probably need to add these to Makefile.am's REFERENCE_IMAGES."; \
+		echo "Missing: $$missing"; \
+		ret=false; \
+	fi >&2; \
+	missing=""; \
+	for i in $(REFERENCE_IMAGES); do \
+	    echo "" $$REFS "" | grep -sq " $$i " || missing="$$missing $$i" ; \
+	done ; \
+	if test -n "$$missing"; then \
+		echo "*** Error: Sanity check failed"; \
+		echo "Some reference files included in the distribution do not exist"; \
+		echo "or are not in git.  You probably want to add these to git first."; \
+		echo "Missing: $$missing"; \
+		ret=false; \
+	fi >&2; \
+	$$ret
 
 release-verify-sane-tests: check-ref-missing
 


More information about the cairo-commit mailing list