gtk2/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
..
721800-0px-dotted-border.css
721800-0px-dotted-border.ref.ui
721800-0px-dotted-border.ui
actionbar.css
actionbar.ref.ui
actionbar.ui
align-expand.sh
animation-direction.c
animation-direction.css
animation-direction.ref.ui
animation-direction.ui
animation-fill-mode-iteration-count.css
animation-fill-mode-iteration-count.ref.ui
animation-fill-mode-iteration-count.ui
background-area.css
background-area.ref.ui
background-area.ui
background-blend-mode-clip-interaction.css
background-blend-mode-clip-interaction.ref.ui
background-blend-mode-clip-interaction.ui
background-color-transparent.css reftests: Avoid theme influence 2020-04-24 15:19:24 -04:00
background-color-transparent.ref.ui reftests: Avoid decorations 2020-04-24 15:18:02 -04:00
background-color-transparent.ui reftests: Avoid decorations 2020-04-24 15:18:02 -04:00
background-image-multiple.css
background-image-multiple.ref.ui reftests: Use transform syntax 2020-04-25 12:47:17 -04:00
background-image-multiple.ui
background-origin.css
background-origin.ref.ui
background-origin.ui reftests: Fix the background-origin test 2020-05-22 10:48:33 -04:00
background-position-repeat-bg.png
background-position-repeat.css
background-position-repeat.ref.ui
background-position-repeat.ui
background-position-simple.css
background-position-simple.ref.ui
background-position-simple.ui
background-position.css
background-position.ref.ui
background-position.ui
background-positioning-area-empty.ref.ui
background-positioning-area-empty.ui
background-repeat.css
background-repeat.ref.ui
background-repeat.ui
background-size-keywords.css
background-size-keywords.ref.ui
background-size-keywords.ui
background-size-zero.css
background-size-zero.ref.ui
background-size-zero.ui
background-size.css
background-size.ref.ui
background-size.ui
background-window-transparent.css
background-window-transparent.ref.ui
background-window-transparent.ui
bad-color-names.css
bad-color-names.ref.ui
bad-color-names.ui
border-color-default.css
border-color-default.ref.ui
border-color-default.ui
border-corner-zero-width-rendering.css
border-corner-zero-width-rendering.ref.ui
border-corner-zero-width-rendering.ui
border-half-pixel.css
border-half-pixel.ref.ui
border-half-pixel.ui
border-image-3-balls-green-squished.png
border-image-3-balls-green.png
border-image-3-balls-yellow-squished.png
border-image-3-balls-yellow.png
border-image-ball-green.png
border-image-ball-red.png
border-image-ball-yellow.png
border-image-balls.png
border-image-excess-size.css
border-image-excess-size.ref.ui
border-image-excess-size.ui
border-image-url-scaled.css
border-image-url-scaled.ref.ui
border-image-url-scaled.ui
border-image-url.css
border-image-url.ref.ui
border-image-url.ui
border-radius-clamp.css
border-radius-clamp.ref.ui
border-radius-clamp.ui
border-rgb.png
border-rgb@2.png
border-style-none.css
border-style-none.ref.ui
border-style-none.ui
border-style.css
border-style.ref.ui
border-style.ui
box-order.css
box-order.ref.ui
box-order.ui
box-pseudo-classes.css
box-pseudo-classes.ref.ui
box-pseudo-classes.ui
box-shadow-changes-modify-clip.css
box-shadow-changes-modify-clip.ref.ui
box-shadow-changes-modify-clip.ui
box-shadow-spec-inset.css
box-shadow-spec-inset.ref.ui
box-shadow-spec-inset.ui
box-shadow-spread.css
box-shadow-spread.ref.ui
box-shadow-spread.ui
box-shadow-with-blend-mode.css
box-shadow-with-blend-mode.ref.ui
box-shadow-with-blend-mode.ui
button-wrapping.ref.ui paned: Redo the api 2020-05-11 22:21:33 -04:00
button-wrapping.ui paned: Redo the api 2020-05-11 22:21:33 -04:00
color-transition.css
color-transition.ref.ui
color-transition.ui
cross-fade-syntax.css
cross-fade-syntax.ref.ui
cross-fade-syntax.ui
css-currentcolor-alpha.css
css-currentcolor-alpha.ref.ui
css-currentcolor-alpha.ui
css-em-label-size.css
css-em-label-size.ref.ui
css-em-label-size.ui
css-image-aspect-ratio.css
css-image-aspect-ratio.ref.ui
css-image-aspect-ratio.ui
css-image-color-aspect-ratio.css
css-image-color-aspect-ratio.ref.ui
css-image-color-aspect-ratio.ui
css-match-class.css
css-match-class.ref.ui
css-match-class.ui
css-match-descendant-later.css
css-match-descendant-later.ref.ui
css-match-descendant-later.ui
css-match-exact.css
css-match-exact.ref.ui
css-match-exact.ui
css-match-import-import.css
css-match-import.css
css-match-import.ref.ui
css-match-import.ui
css-match-inherit-different-state.css
css-match-inherit-different-state.ref.ui
css-match-inherit-different-state.ui
css-match-inherit.css
css-match-inherit.ref.ui
css-match-inherit.ui
css-match-name.css
css-match-name.ref.ui
css-match-name.ui
css-match-siblings.css
css-match-siblings.ref.ui
css-match-siblings.ui
css-match-type.css
css-match-type.ref.ui
css-match-type.ui
css-multi-state.css
css-multi-state.ref.ui
css-multi-state.ui
css-rem-label-size.css
css-rem-label-size.ref.ui
css-rem-label-size.ui
data-url.css
data-url.ref.ui
data-url.ui
expand-expander.c
expander.ref.ui
expander.ui
fixed-widget-stacking.ref.ui
fixed-widget-stacking.ui
flipping-icons.ref.ui testsuite: Update a testcase 2020-05-04 22:53:08 -04:00
flipping-icons.ui testsuite: Update a testcase 2020-05-04 22:53:08 -04:00
font-sizes-names.css
font-sizes-names.ref.ui
font-sizes-names.ui
frame-inhibitor.c
green-20x20.png
grid-empty-with-spacing.ref.ui
grid-empty-with-spacing.ui
grid-expand.css
grid-expand.ref.ui
grid-expand.ui
grid-homogeneous.css
grid-homogeneous.ref.ui
grid-homogeneous.ui
grid-spacing1.ref.ui
grid-spacing1.ui
grid-spacing2.ref.ui
grid-spacing2.ui
grid-spacing3.css
grid-spacing3.ref.ui
grid-spacing3.ui
grid-wfh.ref.ui
grid-wfh.ui
gtk-icontheme-sizing.css
gtk-icontheme-sizing.ref.ui
gtk-icontheme-sizing.ui
gtk-image-effect-inherit.css
gtk-image-effect-inherit.ref.ui
gtk-image-effect-inherit.ui
gtk-reftest.c tests: Allow setting a subdir for output 2020-05-15 14:11:53 -04:00
gtk-reftest.h
icon-effect-missing.css
icon-effect-missing.ref.ui
icon-effect-missing.ui
icon-shadow-no-transform.css
icon-shadow-no-transform.ref.ui
icon-shadow-no-transform.ui
icon-style-basics.css
icon-style-basics.ref.ui
icon-style-basics.ui
icon-vfuncs.css
icon-vfuncs.ref.ui
icon-vfuncs.ui
iconview-empty.css
iconview-empty.ref.ui
iconview-empty.ui
image-compare.c
image-icon-name-use-fallback.ref.ui
image-icon-name-use-fallback.ui
image-icon-shadow-clipping.css
image-icon-shadow-clipping.ref.ui
image-icon-shadow-clipping.ui
image-load-from-file.css
image-load-from-file.ref.ui
image-load-from-file.ui
label-attribute-preference.css
label-attribute-preference.ref.ui
label-attribute-preference.ui
label-background.css
label-background.ref.ui
label-background.ui
label-box-shadow-clip.css
label-box-shadow-clip.ref.ui
label-box-shadow-clip.ui
label-clipping.css
label-clipping.ref.ui
label-clipping.ui
label-ellipsize-small.ref.ui
label-ellipsize-small.ui
label-ellipsize-with-big.ref.ui
label-ellipsize-with-big.ui
label-fonts.css
label-fonts.ref.ui
label-fonts.ui
label-shadows.css
label-shadows.ref.ui
label-shadows.ui
label-sizing.css
label-sizing.ref.ui paned: Redo the api 2020-05-11 22:21:33 -04:00
label-sizing.ui paned: Redo the api 2020-05-11 22:21:33 -04:00
label-small-ellipsized.ref.ui
label-small-ellipsized.ui
label-text-shadow-changes-modify-clip.css
label-text-shadow-changes-modify-clip.ref.ui
label-text-shadow-changes-modify-clip.ui
label-text-shadow-clipping.css
label-text-shadow-clipping.ref.ui
label-text-shadow-clipping.ui
label-width-chars-dont-shrink.ref.ui
label-width-chars-dont-shrink.ui
label-wrap-justify.ref.ui
label-wrap-justify.ui
letter-spacing.c
letter-spacing.css
letter-spacing.ref.ui
letter-spacing.ui
linear-gradient-transition-to-other.css
linear-gradient-transition-to-other.ref.ui
linear-gradient-transition-to-other.ui
linear-gradient.css
linear-gradient.ref.ui
linear-gradient.ui
link-coloring.css
link-coloring.ref.ui
link-coloring.ui
marble.xpm
meson.build testsuite: Re-add the sizegroups-evolution reftest 2020-05-22 17:10:28 -04:00
messagedialog-secondarytext.ref.ui
messagedialog-secondarytext.ui
named-colors.css
named-colors.ref.ui
named-colors.ui
no-colors.css
no-colors.ref.ui
no-colors.ui
nonresizable-size.ref.ui
nonresizable-size.ui
notebook-tab-position.css
notebook-tab-position.ref.ui
notebook-tab-position.ui
nth-child.css
nth-child.ref.ui
nth-child.ui
opacity-initial.css
opacity-initial.ref.ui
opacity-initial.ui
opacity.css
opacity.ref.ui
opacity.ui
overlay-no-main-widget.ref.ui
overlay-no-main-widget.ui
paned-undersized.css
paned-undersized.ref.ui paned: Redo the api 2020-05-11 22:21:33 -04:00
paned-undersized.ui paned: Redo the api 2020-05-11 22:21:33 -04:00
partial-rounded-border.css
partial-rounded-border.ref.ui
partial-rounded-border.ui
picture-load-invalid-file.ref.ui
picture-load-invalid-file.ui
pseudoclass-on-box.css
pseudoclass-on-box.ref.ui
pseudoclass-on-box.ui
pseudoclass-on-parent.css
pseudoclass-on-parent.ref.ui
pseudoclass-on-parent.ui
quit-mnemonic.css
quit-mnemonic.ref.ui
quit-mnemonic.ui
README
reference-background-origin.png
reftest-compare.c reftests: Pass common_cflags 2020-05-19 08:32:33 +02:00
reftest-compare.h
reftest-module.c reftests: Pass common_cflags 2020-05-19 08:32:33 +02:00
reftest-module.h
reftest-snapshot.c reftest: Clean up reftest_inhibit_snapshot() 2020-06-04 15:45:29 +02:00
reftest-snapshot.h
reftests-dark.test.in
reftests-hc.test.in
reftests-hci.test.in
reftests.test.in
repeating-radial-gradient-at-beginning.css
repeating-radial-gradient-at-beginning.ref.ui
repeating-radial-gradient-at-beginning.ui
reset-to-defaults.css
revealer-extra-size.ref.ui
revealer-extra-size.ui
revealer-wrappable-contents.ref.ui
revealer-wrappable-contents.ui
rotated-layout.ref.ui
rotated-layout.ui
separator-size.css
separator-size.ref.ui
separator-size.ui
set-default-direction.c Use gtk_window_set_child throughout 2020-05-04 22:53:08 -04:00
set-default-direction.ref.ui
set-default-direction.ui
shadow-clip-rounding.css
shadow-clip-rounding.ref.ui
shadow-clip-rounding.ui
shorthand-entry-border.css
shorthand-entry-border.ref.ui
shorthand-entry-border.ui
sibling-pseudoclasses.css
sibling-pseudoclasses.ref.ui
sibling-pseudoclasses.ui
simple.ref.ui
simple.ui
sizegroups-basics.css
sizegroups-basics.ref.ui
sizegroups-basics.ui
sizegroups-evolution-identity-page.ref.ui
sizegroups-evolution-identity-page.ui
sizegroups-get-preferred-null.ref.ui
sizegroups-get-preferred-null.ui
statusbar-remove-all.c
statusbar-remove-all.ref.ui
statusbar-remove-all.ui
style-context-save-inheritance.css
style-context-save-inheritance.ref.ui
style-context-save-inheritance.ui
style-properties-only-child.css
style-properties-only-child.ref.ui
style-properties-only-child.ui
symbolic-icon-translucent-color.css
symbolic-icon-translucent-color.ref.ui
symbolic-icon-translucent-color.ui
textview-border-windows.c
textview-border-windows.css
textview-border-windows.ref.ui
textview-border-windows.ui reftests: Avoid text caret from interfering 2020-04-24 18:33:57 -04:00
textview-margins.css
textview-margins.ref.ui
textview-margins.ui
textview-tags.c
textview-tags.css
textview-tags.ref.ui
textview-tags.ui
treeview-crash-too-wide.ref.ui reftests: Stop using shadow-type 2020-04-17 11:06:16 -04:00
treeview-crash-too-wide.ui reftests: Stop using shadow-type 2020-04-17 11:06:16 -04:00
treeview-fixed-height.css
treeview-fixed-height.ref.ui
treeview-fixed-height.ui
treeview-headers-hidden.ref.ui
treeview-headers-hidden.ui
unresolvable.css
unresolvable.ref.ui
unresolvable.ui
window-border-width.ref.ui
window-border-width.ui
window-default-size.ref.ui
window-default-size.ui
window-height-for-width.ref.ui
window-height-for-width.ui
window-show-contents-on-map.ref.ui
window-show-contents-on-map.ui reftests: Fix the window-show-contents-on-map test 2020-04-26 09:16:25 -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