diff --git a/test/Makefile.am b/test/Makefile.am index 1617b56dc..5b5d613a9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -481,7 +481,7 @@ check-ref-missing: release-verify-sane-tests: check-ref-missing results.tar: - @tar cf $@ index.html testtable.js *.log; \ + @tar cf $@ index.html testtable.js *.log output/*.log; \ for i in output/*.fail.png ; do \ testname=$${i#output/} ; \ testname=$${testname%%.*} ; \ diff --git a/test/cairo-test-private.h b/test/cairo-test-private.h index e89eb70a2..bd0c0ac49 100644 --- a/test/cairo-test-private.h +++ b/test/cairo-test-private.h @@ -61,7 +61,8 @@ _cairo_test_context_init_for_test (cairo_test_context_t *ctx, void cairo_test_init (cairo_test_context_t *ctx, - const char *test_name); + const char *test_name, + const char *output); cairo_test_status_t cairo_test (const cairo_test_t *test); diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c index 58e40459c..28e4b5dc0 100644 --- a/test/cairo-test-runner.c +++ b/test/cairo-test-runner.c @@ -406,7 +406,7 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[]) static void _runner_init (cairo_test_runner_t *runner) { - cairo_test_init (&runner->base, "cairo-test-suite"); + cairo_test_init (&runner->base, "cairo-test-suite", "."); runner->passed = TRUE; diff --git a/test/cairo-test.c b/test/cairo-test.c index 837b76cc7..b2d6b3f33 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -126,7 +126,8 @@ static void _cairo_test_init (cairo_test_context_t *ctx, const cairo_test_context_t *parent, const cairo_test_t *test, - const char *test_name) + const char *test_name, + const char *output) { char *log_name; @@ -138,6 +139,7 @@ _cairo_test_init (cairo_test_context_t *ctx, ctx->test = test; ctx->test_name = _cairo_test_fixup_name (test_name); + ctx->output = output; ctx->malloc_failure = 0; #if HAVE_MEMFAULT @@ -151,7 +153,7 @@ _cairo_test_init (cairo_test_context_t *ctx, if (getenv ("CAIRO_TEST_TIMEOUT")) ctx->timeout = atoi (getenv ("CAIRO_TEST_TIMEOUT")); - xasprintf (&log_name, "%s%s", ctx->test_name, CAIRO_TEST_LOG_SUFFIX); + xasprintf (&log_name, "%s/%s%s", ctx->output, ctx->test_name, CAIRO_TEST_LOG_SUFFIX); _xunlink (NULL, log_name); ctx->log_file = fopen (log_name, "a"); @@ -209,14 +211,15 @@ _cairo_test_context_init_for_test (cairo_test_context_t *ctx, const cairo_test_context_t *parent, const cairo_test_t *test) { - _cairo_test_init (ctx, parent, test, test->name); + _cairo_test_init (ctx, parent, test, test->name, CAIRO_TEST_OUTPUT_DIR); } void cairo_test_init (cairo_test_context_t *ctx, - const char *test_name) + const char *test_name, + const char *output) { - _cairo_test_init (ctx, NULL, NULL, test_name); + _cairo_test_init (ctx, NULL, NULL, test_name, output); } static void @@ -472,7 +475,7 @@ cairo_test_target_has_similar (const cairo_test_context_t *ctx, return DIRECT; xasprintf (&path, "%s/%s", - _cairo_test_mkdir (CAIRO_TEST_OUTPUT_DIR) ? CAIRO_TEST_OUTPUT_DIR : ".", + _cairo_test_mkdir (ctx->output) ? ctx->output : ".", ctx->test_name); has_similar = DIRECT; @@ -815,9 +818,9 @@ cairo_test_for_target (cairo_test_context_t *ctx, target->file_extension); } - have_output_dir = _cairo_test_mkdir (CAIRO_TEST_OUTPUT_DIR); + have_output_dir = _cairo_test_mkdir (ctx->output); xasprintf (&base_path, "%s/%s", - have_output_dir ? CAIRO_TEST_OUTPUT_DIR : ".", + have_output_dir ? ctx->output : ".", base_name); xasprintf (&out_png_path, "%s" CAIRO_TEST_OUT_PNG, base_path); xasprintf (&diff_png_path, "%s" CAIRO_TEST_DIFF_PNG, base_path); @@ -1865,7 +1868,7 @@ cairo_test_expecting (const cairo_test_t *test) cairo_test_status_t ret = CAIRO_TEST_SUCCESS; size_t num_threads; - _cairo_test_init (&ctx, NULL, test, test->name); + _cairo_test_init (&ctx, NULL, test, test->name, CAIRO_TEST_OUTPUT_DIR); printf ("%s\n", test->description); #if CAIRO_HAS_REAL_PTHREAD diff --git a/test/cairo-test.h b/test/cairo-test.h index c4f38c559..dd4fcf937 100644 --- a/test/cairo-test.h +++ b/test/cairo-test.h @@ -220,6 +220,7 @@ struct _cairo_test_context { const char *test_name; FILE *log_file; + const char *output; const char *srcdir; /* directory containing sources and input data */ const char *refdir; /* directory containing reference images */ diff --git a/test/testtable.js b/test/testtable.js index 8cf715677..6c25938c8 100644 --- a/test/testtable.js +++ b/test/testtable.js @@ -63,7 +63,7 @@ function fieldsToHTML (bColumns, values) { var r = Array (); for (var i = 0; i < fields.length; i++) if (fields[i] == "test") { - r.push (link (values[fields[i]], values[fields[i]] + ".log")); + r.push (link (values[fields[i]], "output/" + values[fields[i]] + ".log")); } else { tmpRE[i] = values[fields[i]]; r.push (span (values[fields[i]], prefix + "/" + tmpRE.join ("/") + "/", fields[i])); @@ -415,7 +415,7 @@ function parseTestList (listData) { if (words.length >= 2 && words[0][words[0].length-1] == ":" && inArray (words[1], logResults)) - parseFile (words[0].substr (0, words[0].length-1) + ".log", parseTest); + parseFile ("output/" + words[0].substr (0, words[0].length-1) + ".log", parseTest); } } @@ -425,4 +425,4 @@ function reloadAll() { parseFile ("cairo-test-suite.log", parseTestList); } -window.onload = reloadAll; \ No newline at end of file +window.onload = reloadAll;