2016-11-24 15:54:51 +00:00
|
|
|
plugin_test_shell_desktop = shared_library(
|
|
|
|
'weston-test-desktop-shell',
|
|
|
|
'weston-test-desktop-shell.c',
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: common_inc,
|
2020-10-17 18:03:09 +00:00
|
|
|
dependencies: [ dep_lib_desktop, dep_libweston_public, dep_libexec_weston ],
|
2016-11-24 15:54:51 +00:00
|
|
|
name_prefix: '',
|
|
|
|
install: false
|
|
|
|
)
|
|
|
|
env_modmap += 'weston-test-desktop-shell.so=@0@;'.format(plugin_test_shell_desktop.full_path())
|
|
|
|
|
|
|
|
lib_test_runner = static_library(
|
|
|
|
'test-runner',
|
|
|
|
'weston-test-runner.c',
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
dependencies: [
|
|
|
|
dep_libweston_private_h_deps,
|
|
|
|
dep_wayland_client,
|
|
|
|
],
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: common_inc,
|
2016-11-24 15:54:51 +00:00
|
|
|
install: false,
|
|
|
|
)
|
2020-01-27 10:15:20 +00:00
|
|
|
dep_test_runner = declare_dependency(
|
|
|
|
dependencies: dep_wayland_client,
|
|
|
|
link_with: lib_test_runner
|
|
|
|
)
|
2016-11-24 15:54:51 +00:00
|
|
|
|
|
|
|
lib_test_client = static_library(
|
|
|
|
'test-client',
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
[
|
|
|
|
'weston-test-client-helper.c',
|
|
|
|
'weston-test-fixture-compositor.c',
|
|
|
|
weston_test_client_protocol_h,
|
2020-10-17 18:03:09 +00:00
|
|
|
weston_screenshooter_protocol_c,
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
weston_test_protocol_c,
|
2020-03-11 15:11:03 +00:00
|
|
|
viewporter_client_protocol_h,
|
|
|
|
viewporter_protocol_c,
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
],
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: common_inc,
|
2016-11-24 15:54:51 +00:00
|
|
|
dependencies: [
|
|
|
|
dep_libshared,
|
|
|
|
dep_wayland_client,
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
dep_libexec_weston,
|
2016-11-24 15:54:51 +00:00
|
|
|
dep_pixman,
|
|
|
|
dependency('cairo'),
|
|
|
|
],
|
|
|
|
install: false,
|
|
|
|
)
|
|
|
|
dep_test_client = declare_dependency(
|
|
|
|
link_with: lib_test_client,
|
2020-03-11 15:11:03 +00:00
|
|
|
sources: [
|
|
|
|
viewporter_client_protocol_h,
|
|
|
|
],
|
2016-11-24 15:54:51 +00:00
|
|
|
dependencies: [
|
2018-12-13 20:20:16 +00:00
|
|
|
dep_wayland_client,
|
2016-11-24 15:54:51 +00:00
|
|
|
dep_test_runner,
|
|
|
|
dep_pixman,
|
2020-05-06 14:21:03 +00:00
|
|
|
dependency('libudev', version: '>= 136'),
|
2016-11-24 15:54:51 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
exe_plugin_test = shared_library(
|
|
|
|
'test-plugin',
|
|
|
|
'weston-test.c',
|
|
|
|
weston_test_server_protocol_h,
|
|
|
|
weston_test_protocol_c,
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: common_inc,
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
dependencies: [
|
|
|
|
dep_libexec_weston,
|
|
|
|
dep_libweston_private,
|
|
|
|
dep_threads
|
|
|
|
],
|
2016-11-24 15:54:51 +00:00
|
|
|
name_prefix: '',
|
|
|
|
install: false,
|
|
|
|
)
|
|
|
|
|
|
|
|
deps_zuc = [ dep_libshared ]
|
2021-03-03 14:05:00 +00:00
|
|
|
config_h.set10('ENABLE_JUNIT_XML', get_option('test-junit-xml'))
|
2016-11-24 15:54:51 +00:00
|
|
|
if get_option('test-junit-xml')
|
2019-01-08 18:05:09 +00:00
|
|
|
d = dependency('libxml-2.0', version: '>= 2.6', required: false)
|
|
|
|
if not d.found()
|
|
|
|
error('JUnit XML support requires libxml-2.0 >= 2.6 which was not found. Or, you can use \'-Dtest-junit-xml=false\'.')
|
|
|
|
endif
|
|
|
|
deps_zuc += d
|
2016-11-24 15:54:51 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
lib_zuc = static_library(
|
|
|
|
'zunitc',
|
|
|
|
'../tools/zunitc/inc/zunitc/zunitc.h',
|
|
|
|
'../tools/zunitc/inc/zunitc/zunitc_impl.h',
|
|
|
|
'../tools/zunitc/src/zuc_base_logger.c',
|
|
|
|
'../tools/zunitc/src/zuc_base_logger.h',
|
|
|
|
'../tools/zunitc/src/zuc_collector.c',
|
|
|
|
'../tools/zunitc/src/zuc_collector.h',
|
|
|
|
'../tools/zunitc/src/zuc_context.h',
|
|
|
|
'../tools/zunitc/src/zuc_event.h',
|
|
|
|
'../tools/zunitc/src/zuc_event_listener.h',
|
|
|
|
'../tools/zunitc/src/zuc_junit_reporter.c',
|
|
|
|
'../tools/zunitc/src/zuc_junit_reporter.h',
|
|
|
|
'../tools/zunitc/src/zuc_types.h',
|
|
|
|
'../tools/zunitc/src/zunitc_impl.c',
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: [ common_inc, include_directories('../tools/zunitc/inc') ],
|
2016-11-24 15:54:51 +00:00
|
|
|
dependencies: deps_zuc,
|
|
|
|
)
|
|
|
|
dep_zuc = declare_dependency(
|
|
|
|
link_with: lib_zuc,
|
|
|
|
dependencies: dep_libshared,
|
|
|
|
include_directories: include_directories('../tools/zunitc/inc')
|
|
|
|
)
|
|
|
|
|
|
|
|
lib_zucmain = static_library(
|
|
|
|
'zunitcmain',
|
|
|
|
'../tools/zunitc/src/main.c',
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: [ common_inc, include_directories('../tools/zunitc/inc') ],
|
2016-11-24 15:54:51 +00:00
|
|
|
dependencies: [ dep_libshared, dep_zuc ],
|
|
|
|
)
|
|
|
|
dep_zucmain = declare_dependency(
|
|
|
|
link_with: lib_zucmain,
|
|
|
|
dependencies: dep_zuc
|
|
|
|
)
|
|
|
|
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
tests = [
|
2021-04-16 14:42:40 +00:00
|
|
|
{
|
|
|
|
'name': 'alpha-blending',
|
|
|
|
'dep_objs': dep_libm,
|
|
|
|
},
|
2019-11-13 13:45:10 +00:00
|
|
|
{ 'name': 'bad-buffer', },
|
2020-02-27 15:04:45 +00:00
|
|
|
{ 'name': 'buffer-transforms', },
|
2021-03-29 11:53:09 +00:00
|
|
|
{ 'name': 'color-manager', },
|
2019-11-13 13:35:22 +00:00
|
|
|
{ 'name': 'devices', },
|
2021-03-15 20:48:45 +00:00
|
|
|
{
|
|
|
|
'name': 'drm-formats',
|
|
|
|
'dep_objs': dep_libdrm_headers,
|
|
|
|
},
|
2020-11-12 12:18:11 +00:00
|
|
|
{ 'name': 'drm-smoke', },
|
2019-11-13 13:45:10 +00:00
|
|
|
{ 'name': 'event', },
|
2019-11-11 15:29:41 +00:00
|
|
|
{ 'name': 'internal-screenshot', },
|
2019-11-13 13:45:10 +00:00
|
|
|
{
|
|
|
|
'name': 'keyboard',
|
|
|
|
'sources': [
|
|
|
|
'keyboard-test.c',
|
|
|
|
'input-timestamps-helper.c',
|
|
|
|
input_timestamps_unstable_v1_client_protocol_h,
|
|
|
|
input_timestamps_unstable_v1_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
2019-11-13 14:28:20 +00:00
|
|
|
{
|
|
|
|
'name': 'linux-explicit-synchronization',
|
|
|
|
'sources': [
|
|
|
|
'linux-explicit-synchronization-test.c',
|
|
|
|
linux_explicit_synchronization_unstable_v1_client_protocol_h,
|
|
|
|
linux_explicit_synchronization_unstable_v1_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
2020-12-04 13:20:11 +00:00
|
|
|
{ 'name': 'output-damage', },
|
tests: add output transform tests
This goes through all output transforms with two different buffer transforms
and verifies the visual output against reference images.
This commit introduces a new test input image 'basic-test-card.png'. It is a
small image with deliberately odd and indivisible dimensions to provoke bad
assumptions about image sizes. It contains red, green and blue areas which are
actually text that makes it very obvious if you have e.g. color channels
swapped. It has a white thick circle to highlight aspect ratio issues, and an
orange cross to show a mixed color. The white border is for contrast and a 1px
wide detail. The whole design makes it clear if the image happens to be rotated
or flipped in any way.
The image has one pixel wide transparent border so that bilinear sampling
filter near the edges of the image would produce the same colors with both
Pixman- and GL-renderers which handle the out-of-image samples fundamentally
differently: Pixman assumes (0, 0, 0, 0) samples outside of the image, while
GL-renderer clamps sample coordinates to the edge essentially repeating the
edge pixels.
It would have been "easy" to create a full matrix of
every output scale & transform x every buffer scale & transform, but that
would have resulted in 2 renderers * 8 output transforms * 3 output scales *
8 buffer transforms * 3 buffer scales = 1152 test cases that would have all
ran strictly serially because our test harness has no parallelism inside one
test program. That would have been slow to run, and need a lot more reference
images too.
Instead, I chose to iterate separately through all output scales & transforms
(this patch) and all buffer scales & transforms (next patch). This limits the
number of test cases in this patch to 56, and allows the two test programs to
run in parallel.
I did not even pick all possible scale & transform combinations here, but just
what I think is a representative sub-set to hopefully exercise all the code
paths.
https://gitlab.freedesktop.org/wayland/weston/issues/52
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-21 10:00:28 +00:00
|
|
|
{ 'name': 'output-transforms', },
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
{ 'name': 'plugin-registry', },
|
2019-11-13 13:45:10 +00:00
|
|
|
{
|
|
|
|
'name': 'pointer',
|
|
|
|
'sources': [
|
|
|
|
'pointer-test.c',
|
|
|
|
'input-timestamps-helper.c',
|
|
|
|
input_timestamps_unstable_v1_client_protocol_h,
|
|
|
|
input_timestamps_unstable_v1_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
2021-06-09 08:01:07 +00:00
|
|
|
{ 'name': 'pointer-shot', },
|
2019-11-13 13:45:10 +00:00
|
|
|
{
|
|
|
|
'name': 'presentation',
|
|
|
|
'sources': [
|
|
|
|
'presentation-test.c',
|
|
|
|
presentation_time_client_protocol_h,
|
|
|
|
presentation_time_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
2021-05-18 11:58:02 +00:00
|
|
|
{
|
|
|
|
'name': 'roles',
|
|
|
|
'sources': [
|
|
|
|
'roles-test.c',
|
|
|
|
xdg_shell_client_protocol_h,
|
|
|
|
xdg_shell_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
2019-11-07 10:59:30 +00:00
|
|
|
{ 'name': 'string', },
|
2019-11-13 13:45:10 +00:00
|
|
|
{ 'name': 'subsurface', },
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
{ 'name': 'subsurface-shot', },
|
2019-11-13 12:20:45 +00:00
|
|
|
{ 'name': 'surface', },
|
|
|
|
{ 'name': 'surface-global', },
|
2019-11-13 13:45:10 +00:00
|
|
|
{
|
|
|
|
'name': 'text',
|
|
|
|
'sources': [
|
|
|
|
'text-test.c',
|
|
|
|
text_input_unstable_v1_client_protocol_h,
|
|
|
|
text_input_unstable_v1_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'touch',
|
|
|
|
'sources': [
|
|
|
|
'touch-test.c',
|
|
|
|
'input-timestamps-helper.c',
|
|
|
|
input_timestamps_unstable_v1_client_protocol_h,
|
|
|
|
input_timestamps_unstable_v1_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
2019-11-07 10:59:30 +00:00
|
|
|
{
|
|
|
|
'name': 'vertex-clip',
|
|
|
|
'dep_objs': dep_vertex_clipping,
|
|
|
|
},
|
2020-03-11 15:11:03 +00:00
|
|
|
{ 'name': 'viewporter', },
|
2020-03-11 15:43:44 +00:00
|
|
|
{ 'name': 'viewporter-shot', },
|
2020-12-09 13:14:11 +00:00
|
|
|
{
|
|
|
|
'name': 'yuv-buffer',
|
|
|
|
'dep_objs': [
|
|
|
|
dep_libdrm_headers,
|
|
|
|
dep_libm,
|
|
|
|
],
|
|
|
|
},
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
]
|
|
|
|
|
2016-11-24 15:54:51 +00:00
|
|
|
tests_standalone = [
|
|
|
|
['config-parser', [], [ dep_zucmain ]],
|
2019-04-05 14:09:28 +00:00
|
|
|
['matrix', [], [ dep_libm, dep_matrix_c ]],
|
2016-11-24 15:54:51 +00:00
|
|
|
['timespec', [], [ dep_zucmain ]],
|
|
|
|
['zuc',
|
|
|
|
[
|
|
|
|
'../tools/zunitc/test/fixtures_test.c',
|
|
|
|
'../tools/zunitc/test/zunitc_test.c'
|
|
|
|
],
|
|
|
|
[ dep_zucmain ]
|
|
|
|
],
|
|
|
|
]
|
|
|
|
|
|
|
|
if get_option('xwayland')
|
2019-01-07 19:33:08 +00:00
|
|
|
d = dependency('x11', required: false)
|
|
|
|
if not d.found()
|
|
|
|
error('Xwayland tests require libX11 which was not found. Or, you can use \'-Dxwayland=false\'.')
|
|
|
|
endif
|
2019-11-13 14:41:46 +00:00
|
|
|
tests += {
|
|
|
|
'name': 'xwayland',
|
|
|
|
'dep_objs': d,
|
|
|
|
}
|
2016-11-24 15:54:51 +00:00
|
|
|
endif
|
|
|
|
|
2019-11-13 12:39:22 +00:00
|
|
|
# Manual test plugin, not used in the automatic suite
|
|
|
|
surface_screenshot_test = shared_library(
|
|
|
|
'test-surface-screenshot',
|
|
|
|
'surface-screenshot-test.c',
|
|
|
|
include_directories: common_inc,
|
|
|
|
dependencies: [ dep_libweston_private, dep_libshared ],
|
|
|
|
name_prefix: '',
|
|
|
|
install: false,
|
|
|
|
)
|
2016-11-24 15:54:51 +00:00
|
|
|
|
|
|
|
if get_option('shell-ivi')
|
2019-11-11 13:30:07 +00:00
|
|
|
ivi_layout_test_plugin = shared_library(
|
|
|
|
'test-ivi-layout',
|
|
|
|
[
|
|
|
|
'ivi-layout-test-plugin.c',
|
|
|
|
weston_test_server_protocol_h,
|
|
|
|
weston_test_protocol_c,
|
|
|
|
],
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: common_inc,
|
2019-11-11 13:30:07 +00:00
|
|
|
dependencies: [ dep_libweston_private, dep_libexec_weston ],
|
|
|
|
name_prefix: '',
|
|
|
|
install: false,
|
2016-11-24 15:54:51 +00:00
|
|
|
)
|
2019-11-11 13:30:07 +00:00
|
|
|
env_modmap += 'test-ivi-layout.so=' + ivi_layout_test_plugin.full_path() + ';'
|
2016-11-24 15:54:51 +00:00
|
|
|
|
2019-11-11 13:30:07 +00:00
|
|
|
tests += [
|
|
|
|
{
|
|
|
|
'name': 'ivi-layout-client',
|
|
|
|
'sources': [
|
|
|
|
'ivi-layout-test-client.c',
|
|
|
|
ivi_application_client_protocol_h,
|
|
|
|
ivi_application_protocol_c,
|
|
|
|
],
|
|
|
|
'test_deps': [ ivi_layout_test_plugin ],
|
|
|
|
},
|
2019-11-11 14:28:28 +00:00
|
|
|
{ 'name': 'ivi-layout-internal', },
|
2019-11-11 15:17:57 +00:00
|
|
|
{
|
|
|
|
'name': 'ivi-shell-app',
|
|
|
|
'sources': [
|
|
|
|
'ivi-shell-app-test.c',
|
|
|
|
ivi_application_client_protocol_h,
|
|
|
|
ivi_application_protocol_c,
|
|
|
|
],
|
|
|
|
},
|
2019-11-11 13:30:07 +00:00
|
|
|
]
|
2016-11-24 15:54:51 +00:00
|
|
|
endif
|
|
|
|
|
2019-11-01 13:39:30 +00:00
|
|
|
test_config_h = configuration_data()
|
|
|
|
test_config_h.set_quoted('WESTON_TEST_REFERENCE_PATH', meson.current_source_dir() + '/reference')
|
|
|
|
test_config_h.set_quoted('WESTON_MODULE_MAP', env_modmap)
|
|
|
|
test_config_h.set_quoted('WESTON_DATA_DIR', join_paths(meson.current_source_dir(), '..', 'data'))
|
|
|
|
test_config_h.set_quoted('TESTSUITE_PLUGIN_PATH', exe_plugin_test.full_path())
|
2021-03-03 12:21:01 +00:00
|
|
|
test_config_h.set10('WESTON_TEST_SKIP_IS_FAILURE', get_option('test-skip-is-failure'))
|
2019-11-01 13:39:30 +00:00
|
|
|
configure_file(output: 'test-config.h', configuration: test_config_h)
|
|
|
|
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
foreach t : tests
|
|
|
|
t_name = 'test-' + t.get('name')
|
|
|
|
t_sources = t.get('sources', [t.get('name') + '-test.c'])
|
|
|
|
t_sources += weston_test_client_protocol_h
|
|
|
|
|
|
|
|
t_deps = [ dep_test_client, dep_libweston_private_h ]
|
|
|
|
t_deps += t.get('dep_objs', [])
|
|
|
|
|
|
|
|
t_exe = executable(
|
|
|
|
t_name,
|
|
|
|
t_sources,
|
|
|
|
c_args: [
|
|
|
|
'-DUNIT_TEST',
|
|
|
|
'-DTHIS_TEST_NAME="' + t_name + '"',
|
|
|
|
],
|
|
|
|
build_by_default: true,
|
|
|
|
include_directories: common_inc,
|
|
|
|
dependencies: t_deps,
|
|
|
|
install: false,
|
|
|
|
)
|
|
|
|
|
2021-02-08 12:31:35 +00:00
|
|
|
test(
|
|
|
|
t.get('name'),
|
|
|
|
t_exe,
|
|
|
|
depends: t.get('test_deps', []),
|
2021-09-22 13:29:05 +00:00
|
|
|
timeout: 120,
|
2021-02-08 12:31:35 +00:00
|
|
|
protocol: 'tap'
|
|
|
|
)
|
tests: thread-based client harness
This replaces the old test harness with a new one.
The old harness relied on fork()'ing each test which makes tests independent,
but makes debugging them harder. The new harness runs client code in a thread
instead of a new process. A side-effect of not fork()'ing anymore is that any
failure will stop running a test series short. Fortunately we do not have any
tests that are expected to crash or fail.
The old harness executed 'weston' from Meson, with lots of setup as both
command line options and environment variables. The new harness executes
wet_main() instead: the test program itself calls the compositor main function
to execute the compositor in-process. Command line arguments are configured in
the test program itself, not in meson.build. Environment variables aside, you
are able to run a test by simply executing the test program, even if it is a
plugin test.
The new harness adds a new type of iteration: fixtures. For now, fixtures are
used to set up the compositor for tests that need a compositor. If necessary, a
fixture setup may include a data array of arbitrary type for executing the test
series for each element in the array. This will be most useful for running
screenshooting tests with both Pixman- and GL-renderers.
The new harness outputs TAP formatted results into stdout. Meson is not
switched to consume TAP yet though, because it would require a Meson version
requirement bump and would not have any benefits at this time. OTOH outputting
TAP is trivial and sets up a clear precedent of random test chatter belonging
to stderr.
This commit migrates only few tests to actually make use of the new features:
roles is a basic client test, subsurface-shot is a client test that
demonstrates the fixture array, and plugin-registry is a plugin test. The rest
of the tests will be migrated later.
Once all tests are migrated, we can remove the test-specific setup from
meson.build, leaving only the actual build instructions in there.
The not migrated tests and stand-alone tests suffer only a minor change: they
no longer fork() for each TEST(), otherwise they keep running as before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-01 12:02:15 +00:00
|
|
|
endforeach
|
|
|
|
|
2016-11-24 15:54:51 +00:00
|
|
|
# FIXME: the multiple loops is lame. rethink this.
|
|
|
|
foreach t : tests_standalone
|
|
|
|
if t[0] != 'zuc'
|
|
|
|
srcs_t = [
|
|
|
|
'@0@-test.c'.format(t.get(0)),
|
|
|
|
weston_test_client_protocol_h,
|
|
|
|
]
|
|
|
|
else
|
|
|
|
srcs_t = []
|
|
|
|
endif
|
|
|
|
|
|
|
|
if t.length() > 1
|
|
|
|
srcs_t += t.get(1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if t.length() > 2
|
|
|
|
deps_t = t[2]
|
|
|
|
else
|
|
|
|
deps_t = [ dep_test_client ]
|
|
|
|
endif
|
|
|
|
|
|
|
|
exe_t = executable(
|
|
|
|
'test-@0@'.format(t.get(0)),
|
|
|
|
srcs_t,
|
|
|
|
c_args: [ '-DUNIT_TEST' ],
|
|
|
|
build_by_default: true,
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: common_inc,
|
2016-11-24 15:54:51 +00:00
|
|
|
dependencies: deps_t,
|
|
|
|
install: false,
|
|
|
|
)
|
|
|
|
|
|
|
|
# matrix-test is a manual test
|
|
|
|
if t[0] != 'matrix'
|
|
|
|
test(t.get(0), exe_t)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2019-04-05 09:45:46 +00:00
|
|
|
if get_option('backend-drm')
|
|
|
|
executable(
|
|
|
|
'setbacklight',
|
|
|
|
'setbacklight.c',
|
|
|
|
dependencies: [
|
|
|
|
dep_backlight,
|
|
|
|
dep_libdrm,
|
|
|
|
dependency('libudev')
|
|
|
|
],
|
2019-04-05 14:09:28 +00:00
|
|
|
include_directories: common_inc,
|
2019-04-05 09:45:46 +00:00
|
|
|
install: false
|
|
|
|
)
|
|
|
|
endif
|