Improve instructions for when to add a test to the XFAIL list.

Print explanations for expected failures.
This commit is contained in:
Carl Worth 2005-04-14 10:02:58 +00:00
parent d1eb620a19
commit 65209fc39c
6 changed files with 47 additions and 16 deletions

View file

@ -1,3 +1,14 @@
2005-04-14 Carl Worth <cworth@cworth.org>
* test/Makefile.am: Improve instructions for when to add a test to
the XFAIL list.
* test/cairo-test.c: (cairo_test_expect_failure):
* test/cairo-test.h:
* test/pixman-rotate.c: (main):
* test/text-rotate.c: (main): Print explanations for expected
failures.
2005-04-14 Carl Worth <cworth@cworth.org>
* test/.cvsignore:

View file

@ -1,4 +1,4 @@
# All new test cases go here
# All test cases go here
TESTS = \
clip-twice \
coverage \
@ -22,9 +22,9 @@ translate-show-surface \
trap-clip \
user-data
# And all new tests go here too. I really don't like having to repeat
# this list. Anyone know a good way to avoid it? Can I use a wildcard
# here?
# All tests which have a reference image go here.
# I really don't like having to repeat this list. Anyone know a good
# way to avoid it? Can I use a wildcard here?
EXTRA_DIST = \
create-for-png-ref.png \
fill-rule-ref.png \
@ -43,17 +43,19 @@ transforms-ref.png \
translate-show-surface-ref.png \
trap-clip-ref.png
# Once we can draw the text-rotate.c test case correctly, we should
# create and add text-rotate-ref.png to the list of reference PNGs.
# This list is only for known bugs (not regressions). We do need to
# fix these before the next release, but they are expected to fail for
# now, so they don't need to hold up any new code commit.
# Any test for which the code committed to CVS is expected to fail
# should be listed here.
#
# When new bugs are found in committed code they can be listed
# here. New failures due to local, uncommitted code changes are
# regression bugs that should not be listed here. Instead they should
# be fixed before the code is committed.
# This way, we can avoid being bothered by reports of bugs we are
# aware of, but users can still report when tests start behaving in
# unexpected ways on their system.
#
# Of course, before any "release" of cairo we should eliminate
# everything from this list by fixing the bugs. (We don't necessarily
# have to be that strict for "snapshots" though.)
#
# Also, any test listed here should call cairo_test_expect_failure and
# provide an explanation for the expected failure.
XFAIL_TESTS = \
pixman-rotate \
text-rotate

View file

@ -97,6 +97,15 @@ xunlink (const char *pathname)
}
}
cairo_test_status_t
cairo_test_expect_failure (cairo_test_t *test,
cairo_test_draw_function_t draw,
const char *because)
{
printf ("%s is expected to fail %s\n", test->name, because);
return cairo_test (test, draw);
}
cairo_test_status_t
cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw)
{

View file

@ -47,6 +47,11 @@ typedef cairo_test_status_t (*cairo_test_draw_function_t) (cairo_t *cr, int wid
cairo_test_status_t
cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw);
cairo_test_status_t
cairo_test_expect_failure (cairo_test_t *test,
cairo_test_draw_function_t draw,
const char *reason);
cairo_pattern_t *
cairo_test_create_png_pattern (cairo_t *cr, const char *filename);

View file

@ -76,5 +76,7 @@ draw (cairo_t *cr, int width, int height)
int
main (void)
{
return cairo_test (&test, draw);
return cairo_test_expect_failure (&test, draw,
"because of a known off-by-one bug "
"when rotating a pixman image");
}

View file

@ -115,5 +115,7 @@ draw (cairo_t *cr, int width, int height)
int
main (void)
{
return cairo_test (&test, draw);
return cairo_test_expect_failure (&test, draw,
"because of known glyph positioning bugs "
"with rotated text");
}