Tests in the parser need 1 or 2 files:
1) test.css
2) test.ref.css (optional, defaults to test.css)
The test instantiates a CSS provider, loads test.css, then dumps the
loaded file to test.out.css and then checks that that file matches
test.ref.css. If not, it dumps a diff between those two to the log and
fails.
You want to run the test with --verbose to get the output dumped to
stdout.
See the documentation in the script.
Tests are not yet added as the output from the 2 included scripts
doesn't match and the intended reference output first needs to be agreed
on.
GtkArrow and the align properties use different methods (float vs int)
to center the arrow. If the size of the arrow is odd, this will cause a
rendering that differs by half a pixel. So we request an even size for
both the arrow and the container and everything works out.
This is a special-purpose button that can be used together with
GPermission objects to control the sensitivity of system settings.
Suitable permission objects can e.g. be obtained from PolicyKit.
http://bugzilla.gnome.org/show_bug.cgi?id=626457
This now allows text view to render text with alpha values in
the text foreground and backgrounds, the work is almost complete,
currently the error-underline-color is still a GdkColor style property
and since we use only GdkRGBA for rendering it needs to be converted
and applied, probably a new rgba version of the style property should
also be introduced.
This commit adds tests/testtextview that must be run from the tests/
directory to show translucent text in action.
If we have a toplevel, and not a popup window, do wait an additional
0.5s to give the WM/server enough time to actually create the window.
This is a hack and there should be a better solution. But it works.
Please use POPUP windows for tests unless the test must use toplevel
windows.
Checks that the size requests for labels are as they should be for
required and natural size given various combinations of wrap, ellipsize,
width-chars and max-width-chars.
See
http://mail.gnome.org/archives/gtk-devel-list/2011-April/msg00036.html
for the discussion spawning this test.
Add a new test runner supposed to do a lot of generic tests. Run it like
this:
./gtk-reftest [OPTIONS] TESTFILE [TESTFILES...]
where FILE is a GtkBuilder ui file to run.
For a general test named "test", you want to have the following files:
1) test.ui
2) test.ref.ui
3) test.css (optional)
The test will then check that test.ui and test.ref.ui are rendered
identically with the provided css.
In detail, for every provided TESTFILE the test runner will:
1) Add the css to the default screen
2) Load the test.ui file and the test.ref.ui file
3) Grab the first GtkWindow subclass widget
4) gtk_widget_show() it and take a snapshot image of its contents into
a cairo surface.
5) Compare the two images to be bitwise identical. If they are not, a
diff image will be created hilighting the differences.
6) Save the images as png files to the output directory named:
- test.out.png (rendering of test.ui)
- test.ref.png (rendering of test.ref.ui)
- test.diff.png (optional, differences from step 5)
7) Fail the test if the two images are not bitwise identical
Credit for the idea of reftests goes to Mozilla and in particular David
Baron. For a larger introduction of why reftests are useful, see
http://weblogs.mozillazine.org/roc/archives/2008/12/reftests.html