Commit Graph

30 Commits

Author SHA1 Message Date
Matthias Clasen
0dc946da63 testsuite: Assorted leak fixes
All found by asan.
2020-07-08 17:44:49 -04:00
Matthias Clasen
c22af88235 tests: Allow setting a subdir for output
meson seems somewhat weak when it comes to handling
test output. We need to get the output from different
test runs into different locations, and the only
way to communicate from a test setup with the actual
test code seems the environment, so use that.

Make all tests that produce output in files respect
a TEST_OUTPUT_SUBDIR environment variable which specifies
the name of a subdirectory to use. This is combined
with the existing --output argument, which specifies
a per-test location.

Affected tests are reftests, css performance tests
and gsk compare tests.
2020-05-15 14:11:53 -04:00
Matthias Clasen
7233a70d47 reftest: get backtraces
In the hope of making ci-only failures less of a black hole,
add a backtrace to the messsage for criticals.

This could eventually go into GLib (pass backtrace symbols along
as a log field for criticals), but for now this will do.
2020-04-12 11:44:13 -04:00
Matthias Clasen
dc4b7131f1 testsuite: Don't exit unsuccessfully when using TAP
The meson TAP parser doesn't take this lightly and
forgets all about xfails when we exit(1), so don't.
2020-03-20 11:55:26 -04:00
Benjamin Otte
b1a257c0c3 reftest: Plug memleak 2020-03-06 05:52:44 +01:00
Benjamin Otte
062244ab71 testsuite: Make creating the output dir not racy
Fixes #1942
2019-06-09 23:17:10 +02:00
Benjamin Otte
84351ba9e5 reftests: Be more graceful about errors
The nice thing about that is that we can then log messages about the
errors to the log.

And then we can read the logs of the CI machinery and actually know
what's going on.
2019-04-13 01:48:28 +02:00
Christoph Reiter
1253e7bfcb tests: Make GSETTINGS_SCHEMA_DIR point to the compiled schemas in the build dir
With autotools the schemas were compiled into each test suite directory
and the tests set GSETTINGS_SCHEMA_DIR to the test build directory.

With meson's gnome.compile_schemas() we can not define a target directory
so just make sure it is built in the gtk directory and set GSETTINGS_SCHEMA_DIR
to the gtk build directory when running the tests.

This makes the gtk+:gtk suite pass when no gtk is installed on the system.
2018-02-17 09:48:12 +01:00
Benjamin Otte
9151e0b9f5 stylecontext: Port to use display instead of screen 2017-10-31 03:05:54 +01:00
Chun-wei Fan
171ff43340 tests: Include system headers appropriately
Don't include unistd.h on Windows, and include the appropriate headers on
Windows as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-07-21 23:36:03 +08:00
Benjamin Otte
4322b69528 cssprovider: Return void, not TRUE
Parsing a css file always succeeds as CSS can recover from parsing
errors.
2016-10-17 17:41:03 +02:00
Cosimo Cecchi
d9dd7eb757 reftests: override GSETTINGS_SCHEMA_DIR when running tests
The reftest depends on a schema we install ourselves. Instruct GIO to
look in the build directory to avoid a cyclic dep.

https://bugzilla.gnome.org/show_bug.cgi?id=768930
2016-07-25 08:34:52 -04:00
Matthias Clasen
40bb2a1616 reftests: Add a way to compare different runs
gtk-reftest already had an --output=DIR option to tell it where
to save all the resulting images. Now you can combine this with
the --compare-with=DIR option in a second run to make gtk-reftest
compare the .out.png files from the first run with the .out.png
files of the current run, instead of producing .ref.png files.

The intended use for this is to verify that changes do not affect
the generated output.
2015-03-20 16:42:04 -04:00
Matthias Clasen
c5f2f86ff9 Drop an unused function 2014-11-30 19:58:08 -05:00
Rico Tzschichholz
aa08b87ab6 reftest: Add missing include of reftest-snapshot.h 2014-09-22 15:19:51 +02:00
Benjamin Otte
2e6dd4082f reftest: Split our more functionality
Split actually taking the snapshot into its own file.
2014-09-21 18:58:45 +02:00
Benjamin Otte
0182d1ed38 reftest: Split out some functionality into own file
Comparing two surfaces is something that can be nicely factored out.
2014-09-21 18:58:45 +02:00
Benjamin Otte
2120ccfd5e reftests: Make gcc happy 2014-08-14 19:52:59 +02:00
Matthias Clasen
80a8257302 Fix reftests for builddir != srcdir
Make gtk-reftest consult the REFTEST_MODULE_DIR environment
variable to find out where to look for modules, and fix the
libtool hack to construct the .libs subdirectory correctly.
2014-08-10 19:11:39 -04:00
Matthias Clasen
b86f5a4086 Add a way to delay snapshots in reftests
This adds an inhibit api that code from the reftest module
can use to delay the taking of the snapshot. Also refactor
the code in gtk-reftest to use the inhibit mechanism for
its own delaying of the snapshot until after the first
expose.
2014-06-02 22:35:59 -04:00
Matthias Clasen
5880c9e365 gtk-reftest: Don't warn needlessly
Only warn about the --direction argument if the option was
actually specified.
2014-05-30 23:30:56 -04:00
Benjamin Otte
690fb31fb4 gtk-reftest: Clarify --direction argument parameters
... and print a proper error message when the parameter is not
recognized.
2014-05-31 05:19:41 +02:00
Benjamin Otte
8bba9b6a4a gtk-reftest: Allow loading code for reftests
When connecting signal names, gtk-reftest now allows you to use a colon
in the signal handler name like so:
  module:function_name
where module is a module loaded from the same directory (or the .libs
subdirectory for compatibility with uninstalled libtool) as the running
test and the function is resolved in that module. Of course, normal
function names work as before.
2014-05-31 05:19:41 +02:00
Benjamin Otte
1e4fea7ca9 reftests: Automatically connect signals 2014-05-31 05:19:40 +02:00
Benjamin Otte
f2258cb05c reftests: Create the surface after running the main loop
Running the main loop may cause resizes, so creating the surface based
on the size before running it seems wrong.
2014-05-11 03:23:55 +02:00
Benjamin Otte
01fe1282fc reftests: Remove unused argument from function 2014-03-05 21:03:36 +01:00
Matthias Clasen
39f95f1b9b Add a --direction option to gtk-reftest
gtk_test_init() hardcodes the locale to "C", so the --direction
option is useful to check reftests in rtl.
2013-06-29 20:03:29 -04:00
Matthias Clasen
ab7b83d97c typo fix 2013-06-29 19:55:14 -04:00
Matthias Clasen
c8a392612b Use g_test_get_dir in test to locate files
This makes the tests work both installed and for make check.
2013-05-29 21:37:05 -04:00
Benjamin Otte
172303f550 build: Move tests/reftests to testsuite/reftests 2013-05-15 15:37:17 +02:00