[PATCH] test: Fix CAIRO_REF_DIR

Uli Schlachter <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Ever since the test output was moved from test/ to test/output/, using
CAIRO_REF_DIR to make the test suite succeed no longer works. The test suite was
looking for the wrong file names.

This patch makes this work again. However, I am not sure that this really is the
correct fix. It just seems to work. :-)

Reported-by: Darxus <[email protected]>
Signed-off-by: Uli Schlachter <[email protected]>
---
 test/README       |    2 +-
 test/cairo-test.c |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/test/README b/test/README
index b8effea..fef240d 100644
--- a/test/README
+++ b/test/README
@@ -156,7 +156,7 @@ your changes. The process looks like this:

         # Let's save those output images
         mkdir /some/directory/
-        cp test/*-out.png /some/directory/
+        cp -r test/output /some/directory/

         # hack, hack, hack

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 076b014..a3a587a 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -307,11 +307,10 @@ cairo_test_reference_filename (const cairo_test_context_t
*ctx,
     char *ref_name = NULL;

     /* First look for a previous build for comparison. */
-    if (ctx->refdir != NULL) {
-	xasprintf (&ref_name, "%s/%s%s%s",
+    if (ctx->refdir != NULL && strcmp(suffix, CAIRO_TEST_REF_SUFFIX) == 0) {
+	xasprintf (&ref_name, "%s/%s" CAIRO_TEST_OUT_SUFFIX "%s",
 		   ctx->refdir,
 		   base_name,
-		   suffix,
 		   extension);
 	if (access (ref_name, F_OK) != 0)
 	    free (ref_name);
-- 
1.7.10.4
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.