Commit graph

7 commits

Author SHA1 Message Date
Pekka Paalanen
e57eb5b15d tests: return status from each test definition
Add a status return value to every test definition. There are no
behavioral changes, previously the RESULT_OK was simply assumed.

The benefit of this is that in the future individual tests can also
return RESULT_SKIP, so that we can keep statistics of skipped tests.

ivi-layout-internal-test.c has the only case where a test function may
return early. That one is set to return RESULT_HARD_ERROR to match the
compositor exit code already there.

Also documentation is updated.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-30 15:07:35 +03:00
Loïc Molinari
c855bc7af0 tests: Port all test clients to the new test asserts
This commit gets rid of libc's abort() usage in the test suite using
test asserts instead.

Asserts run in the server as plugins aren't converted because they are
shared between server and client.

Co-authored-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-26 23:50:41 +01:00
Marius Vlad
207fed2710 Revert "shared/helpers.h: Migrate helpers.h to libweston"
This is problematic as we don't have namespacing for these and some of
the macros can interfere with other defines.

This reverts commit 8634c7e349.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-01-17 10:18:26 +02:00
Marius Vlad
8634c7e349 shared/helpers.h: Migrate helpers.h to libweston
As weston_windowed_output_get_api needs ARRAY_LENGTH() move helpers to a
libweston/ so other users can re-use that instead of re-defining these
all over. Easier for other front-ends to make use of them.

With this change windowed-output-api.h also includes the helpers header.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-11-25 11:26:35 +00:00
Daniel Stone
2cdb473690 custom-env: Add helper to parse combined env/arg strings
Users like desktop-shell want to parse a provided string containing a
combination of environment and arg, e.g.: ENV=stuff /path/to/thing --good

Add support to custom-env for parsing this, with tests, so we can delete
the custom implementation inside desktop-shell.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00
Daniel Stone
e568a025e1 custom-env: Add support for argument array
execve() takes the same form for arguments as environment: an array of
constant pointers to mutable strings, terminated by a NULL.

To make it easier for users who want to build up their own argument
strings to pass to execve, add support for argument arrays to custom_env.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00
Daniel Stone
2a9cae17d8 custom-env: Add tests for environment handling
Test the basic stuff: initialising from a known environment, setting a
new variable, overwriting a previous variable, and getting the resulting
array to pass to execve.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-07-19 14:12:37 +00:00