[test] Use '.' as the field separator in the names

We frequently use '-' within the test name or format name and so we
encounter confusion as '-' is also used as the field separator. At times
this has caused a new test to break an old test because the new test would
match one of the old test's target specific reference images. So switch
everything over to use '.' between fields (test name, target, format,
subtest, etc.).
This commit is contained in:
Chris Wilson 2008-10-31 13:50:55 +00:00
parent e90073f7dd
commit 992f74d884
715 changed files with 782 additions and 752 deletions

8
test/.gitignore vendored
View file

@ -17,10 +17,10 @@ pdf2png
ps2png
svg2png
valgrind-log
*-out.*
*-pass.*
*-fail.*
*-diff.png
*.out.*
*.pass.*
*.fail.*
*.diff.png
*.manifest
*.gcda
*.gcno

File diff suppressed because it is too large Load diff

View file

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 148 B

View file

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View file

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 148 B

View file

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 128 B

View file

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

View file

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 830 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 830 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 941 B

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View file

Before

Width:  |  Height:  |  Size: 950 B

After

Width:  |  Height:  |  Size: 950 B

View file

Before

Width:  |  Height:  |  Size: 890 B

After

Width:  |  Height:  |  Size: 890 B

View file

@ -95,9 +95,9 @@ static const char *fail_face = "", *xfail_face="", *normal_face = "";
static cairo_bool_t print_fail_on_stdout;
#define CAIRO_TEST_LOG_SUFFIX ".log"
#define CAIRO_TEST_PNG_SUFFIX "-out.png"
#define CAIRO_TEST_REF_SUFFIX "-ref.png"
#define CAIRO_TEST_DIFF_SUFFIX "-diff.png"
#define CAIRO_TEST_PNG_SUFFIX ".out.png"
#define CAIRO_TEST_REF_SUFFIX ".ref.png"
#define CAIRO_TEST_DIFF_SUFFIX ".diff.png"
#define CAIRO_TEST_OUTPUT_DIR "output"
#define NUM_DEVICE_OFFSETS 2
@ -325,6 +325,7 @@ cairo_test_reference_image_filename (const cairo_test_context_t *ctx,
const char *base_name,
const char *test_name,
const char *target_name,
const char *base_target_name,
const char *format)
{
char *ref_name = NULL;
@ -342,7 +343,8 @@ cairo_test_reference_image_filename (const cairo_test_context_t *ctx,
}
/* Next look for a target/format-specific reference image. */
xasprintf (&ref_name, "%s/%s-%s-%s%s", ctx->srcdir,
xasprintf (&ref_name, "%s/%s.%s.%s%s",
ctx->srcdir,
test_name,
target_name,
format,
@ -353,7 +355,8 @@ cairo_test_reference_image_filename (const cairo_test_context_t *ctx,
goto done;
/* Next, look for target-specific reference image. */
xasprintf (&ref_name, "%s/%s-%s%s", ctx->srcdir,
xasprintf (&ref_name, "%s/%s.%s%s",
ctx->srcdir,
test_name,
target_name,
CAIRO_TEST_REF_SUFFIX);
@ -362,8 +365,32 @@ cairo_test_reference_image_filename (const cairo_test_context_t *ctx,
else
goto done;
/* Next look for a base/format-specific reference image. */
xasprintf (&ref_name, "%s/%s.%s.%s%s",
ctx->srcdir,
test_name,
base_target_name,
format,
CAIRO_TEST_REF_SUFFIX);
if (access (ref_name, F_OK) != 0)
free (ref_name);
else
goto done;
/* Next, look for base-specific reference image. */
xasprintf (&ref_name, "%s/%s.%s%s",
ctx->srcdir,
test_name,
base_target_name,
CAIRO_TEST_REF_SUFFIX);
if (access (ref_name, F_OK) != 0)
free (ref_name);
else
goto done;
/* Next, look for format-specific reference image. */
xasprintf (&ref_name, "%s/%s-%s%s", ctx->srcdir,
xasprintf (&ref_name, "%s/%s.%s%s",
ctx->srcdir,
test_name,
format,
CAIRO_TEST_REF_SUFFIX);
@ -641,19 +668,19 @@ cairo_test_for_target (cairo_test_context_t *ctx,
/* Get the strings ready that we'll need. */
format = cairo_boilerplate_content_name (target->content);
if (dev_offset)
xasprintf (&offset_str, "-%d", dev_offset);
xasprintf (&offset_str, ".%d", dev_offset);
else
offset_str = (char *) empty_str;
if (ctx->thread)
xasprintf (&thread_str, "-thread%d", ctx->thread);
xasprintf (&thread_str, ".thread%d", ctx->thread);
else
thread_str = (char *) empty_str;
xasprintf (&base_name, "%s-%s-%s%s%s%s",
xasprintf (&base_name, "%s.%s.%s%s%s%s",
ctx->test_name,
target->name,
format,
similar ? "-similar" : "",
similar ? ".similar" : "",
offset_str,
thread_str);
@ -667,6 +694,7 @@ cairo_test_for_target (cairo_test_context_t *ctx,
base_name,
ctx->test_name,
target->name,
target->basename,
format);
have_output_dir = _cairo_test_mkdir (CAIRO_TEST_OUTPUT_DIR);
xasprintf (&base_path, "%s/%s",
@ -890,11 +918,11 @@ REPEAT:
}
if (target->file_extension != NULL) { /* compare vector surfaces */
xasprintf (&test_filename, "%s-out%s",
xasprintf (&test_filename, "%s.out%s",
base_path, target->file_extension);
xasprintf (&pass_filename, "%s-pass%s",
xasprintf (&pass_filename, "%s.pass%s",
base_path, target->file_extension);
xasprintf (&fail_filename, "%s-fail%s",
xasprintf (&fail_filename, "%s.fail%s",
base_path, target->file_extension);
if (cairo_test_file_is_older (pass_filename, ref_path))
@ -944,8 +972,8 @@ REPEAT:
/* binary compare png files (no decompression) */
if (target->file_extension == NULL) {
xasprintf (&test_filename, "%s", png_path);
xasprintf (&pass_filename, "%s-pass.png", base_path);
xasprintf (&fail_filename, "%s-fail.png", base_path);
xasprintf (&pass_filename, "%s.pass.png", base_path);
xasprintf (&fail_filename, "%s.fail.png", base_path);
if (cairo_test_files_equal (test_filename, pass_filename)) {
/* identical output as last known PASS, pass */
@ -1133,7 +1161,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
dev_offset);
if (ctx->thread == 0) {
printf ("%s-%s-%s [%d]%s:\t", ctx->test_name, target->name,
printf ("%s.%s.%s [%d]%s:\t", ctx->test_name, target->name,
cairo_boilerplate_content_name (target->content),
dev_offset,
similar ? " (similar)": "");
@ -1200,7 +1228,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
fflush (stdout);
}
cairo_test_log (ctx, "CRASHED\n");
fprintf (stderr, "%s-%s-%s [%d]%s:\t%s!!!CRASHED!!!%s\n",
fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!CRASHED!!!%s\n",
ctx->test_name, target->name,
cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
fail_face, normal_face);
@ -1216,7 +1244,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
printf ("\r");
fflush (stdout);
}
fprintf (stderr, "%s-%s-%s [%d]%s:\t%sXFAIL%s\n",
fprintf (stderr, "%s.%s.%s [%d]%s:\t%sXFAIL%s\n",
ctx->test_name, target->name,
cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
xfail_face, normal_face);
@ -1229,7 +1257,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
printf ("\r");
fflush (stdout);
}
fprintf (stderr, "%s-%s-%s [%d]%s:\t%sFAIL%s\n",
fprintf (stderr, "%s.%s.%s [%d]%s:\t%sFAIL%s\n",
ctx->test_name, target->name,
cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
fail_face, normal_face);
@ -1242,7 +1270,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
#if _POSIX_THREAD_SAFE_FUNCTIONS
flockfile (stdout);
#endif
printf ("%s-%s-%s %d [%d]:\t",
printf ("%s.%s.%s %d [%d]:\t",
ctx->test_name, target->name,
cairo_boilerplate_content_name (target->content),
ctx->thread,

View file

@ -232,6 +232,7 @@ cairo_test_reference_image_filename (const cairo_test_context_t *ctx,
const char *base_name,
const char *test_name,
const char *target_name,
const char *base_target_name,
const char *format);
cairo_surface_t *

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 118 B

View file

Before

Width:  |  Height:  |  Size: 195 B

After

Width:  |  Height:  |  Size: 195 B

View file

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

View file

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 310 B

View file

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 302 B

View file

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 310 B

View file

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 302 B

View file

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 431 B

View file

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B

View file

Before

Width:  |  Height:  |  Size: 651 B

After

Width:  |  Height:  |  Size: 651 B

View file

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 636 B

View file

Before

Width:  |  Height:  |  Size: 651 B

After

Width:  |  Height:  |  Size: 651 B

View file

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 636 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 956 B

After

Width:  |  Height:  |  Size: 956 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 955 B

After

Width:  |  Height:  |  Size: 955 B

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 8 KiB

After

Width:  |  Height:  |  Size: 8 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 179 B

View file

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 179 B

View file

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 179 B

View file

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 179 B

View file

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 203 B

View file

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 199 B

View file

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 575 B

View file

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

View file

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 575 B

View file

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 343 B

View file

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 343 B

View file

Before

Width:  |  Height:  |  Size: 350 B

After

Width:  |  Height:  |  Size: 350 B

View file

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 401 B

View file

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

View file

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

View file

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

View file

Before

Width:  |  Height:  |  Size: 448 B

After

Width:  |  Height:  |  Size: 448 B

View file

Before

Width:  |  Height:  |  Size: 448 B

After

Width:  |  Height:  |  Size: 448 B

View file

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 401 B

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 474 B

View file

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 474 B

View file

Before

Width:  |  Height:  |  Size: 579 B

After

Width:  |  Height:  |  Size: 579 B

View file

@ -57,7 +57,7 @@
#define WIDTH_IN_POINTS (WIDTH_IN_INCHES * 72.0)
#define HEIGHT_IN_POINTS (HEIGHT_IN_INCHES * 72.0)
#define BASENAME "create-for-stream-out"
#define BASENAME "create-for-stream.out"
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)

View file

@ -53,7 +53,7 @@ draw (cairo_t *cr, int width, int height)
cairo_surface_t *surface;
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-stream-ref.png");
"create-from-png-stream.ref.png");
file = fopen (filename, "rb");
if (file == NULL) {

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

View file

Before

Width:  |  Height:  |  Size: 150 B

After

Width:  |  Height:  |  Size: 150 B

View file

@ -50,7 +50,7 @@ draw (cairo_t *cr, int width, int height)
cairo_surface_t *surface;
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-ref.png");
"create-from-png.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
@ -105,7 +105,7 @@ preamble (cairo_test_context_t *ctx)
/* cheekily test error propagation from the user write funcs as well ... */
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-ref.png");
"create-from-png.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
@ -144,7 +144,7 @@ preamble (cairo_test_context_t *ctx)
/* check that loading alpha/opaque PNGs generate the correct surfaces */
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-alpha-ref.png");
"create-from-png.alpha.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
cairo_test_log (ctx, "Error reading PNG image %s: %s\n",
@ -160,7 +160,7 @@ preamble (cairo_test_context_t *ctx)
cairo_surface_destroy (surface);
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-ref.png");
"create-from-png.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
cairo_test_log (ctx, "Error reading PNG image %s: %s\n",
@ -177,7 +177,7 @@ preamble (cairo_test_context_t *ctx)
/* check paletted PNGs */
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-indexed-alpha-ref.png");
"create-from-png.indexed-alpha.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
cairo_test_log (ctx, "Error reading PNG image %s: %s\n",
@ -193,7 +193,7 @@ preamble (cairo_test_context_t *ctx)
cairo_surface_destroy (surface);
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-indexed-ref.png");
"create-from-png.indexed.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
cairo_test_log (ctx, "Error reading PNG image %s: %s\n",
@ -210,7 +210,7 @@ preamble (cairo_test_context_t *ctx)
/* check grayscale PNGs */
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-gray-alpha-ref.png");
"create-from-png.gray-alpha.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
cairo_test_log (ctx, "Error reading PNG image %s: %s\n",
@ -226,7 +226,7 @@ preamble (cairo_test_context_t *ctx)
cairo_surface_destroy (surface);
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png-gray-ref.png");
"create-from-png.gray.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
cairo_test_log (ctx, "Error reading PNG image %s: %s\n",

View file

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 142 B

View file

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 124 B

View file

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 172 B

View file

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

View file

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Some files were not shown because too many files have changed in this diff Show more