Bug 14268 - Refactor text-antialias-{none,gray,subpixel}.c into a single text-antialias.c test
Summary: Refactor text-antialias-{none,gray,subpixel}.c into a single text-antialias.c...
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: freetype font backend (show other bugs)
Version: 1.5.7
Hardware: Other All
: medium enhancement
Assignee: Sylvain Pasche
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-27 14:57 UTC by Sylvain Pasche
Modified: 2011-06-25 04:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch (14.99 KB, patch)
2008-01-27 14:57 UTC, Sylvain Pasche
Details | Splinter Review

Description Sylvain Pasche 2008-01-27 14:57:40 UTC
Created attachment 13979 [details] [review]
patch

The purpose is to reduce code duplication, in particular if we want to add 4 more similar tests for the LCD filtering stuff.

I saw that "make check" accepts running more that one cairo_test in a single file. In this case the text-antialias test is generating 3 text-antialias-{none,gray,subpixe}.log files.

However there are places where it is assumed that one test maps to only one .log file. This can be found in all make rules using the $(TESTS:$(EXEEXT)=.log) construct (check-local, html, ...).

Should we try to get around this assumption? $(wildcard *.log) could be used instead, with the drawback that it could not detect tests that didn't generate .log files.

Another way to reduce duplication could be to include a .h file from all these text-antialias-{none,gray,subpixel}.c files with the shared drawing function.
Comment 1 Behdad Esfahbod 2008-01-27 14:59:59 UTC
We're not quite ready to move to multiple tests per source file yet.  That's planned though, for some time in the future...
Comment 2 Andrea Canciani 2011-06-25 04:44:06 UTC
The patch does not apply anymore, but the merge is possible.
It has been performed in:

commit ffdfdf2fa99dab340e03884267218b134d68265b
Author: Andrea Canciani <ranma42@gmail.com>
Date:   Sat Jun 25 10:29:04 2011 +0200

    test: Merge text-antialias-*
    
    The test-antialias-* tests perform the same operation with just a
    different antialias flag. Sharing the code ensures that they are kept
    in sync and permits adding new flags combinations easily.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=14268


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.