Files
gtk/testsuite/reftests
Alexander Larsson 5059854a2e reftest: Clean up reftest_inhibit_snapshot()
This was done in a weird way where we always call reftest_uninhibit_snapshot()
on paint, and then re-inhibited it if it wasn't inhibited. To make this
work it also started with an extra inhibit.

This is very contorted and based on how this historically worked. This
changes it to just do:

  if (inhibit_count > 0)
    return;

And keep inhibit_count at its initial zero value unless it is actually
inhibited.
2020-06-04 15:45:29 +02:00
..
2020-04-09 17:50:29 -04:00
2020-05-11 22:21:33 -04:00
2020-05-11 22:21:33 -04:00
2016-04-12 16:59:40 -07:00
2015-10-27 20:06:24 -04:00
2015-10-27 20:06:24 -04:00
2016-04-12 16:59:40 -07:00
2020-05-04 22:53:08 -04:00
2020-04-09 17:50:29 -04:00
2019-07-31 08:04:03 -04:00
2015-10-27 20:06:24 -04:00
2020-05-11 22:21:33 -04:00
2020-05-11 22:21:33 -04:00
2015-10-27 20:06:24 -04:00
2020-04-17 10:57:36 -04:00
2015-10-27 20:06:24 -04:00
2020-04-09 17:50:29 -04:00
2020-04-09 17:50:29 -04:00
2020-05-11 22:21:33 -04:00
2020-05-11 22:21:33 -04:00
2020-05-19 08:32:33 +02:00
2020-05-19 08:32:33 +02:00
2015-10-27 20:06:24 -04:00

gtk-reftest is 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