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>
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>
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>
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>
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>
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>
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>