spa_interface_call() and friends will quietly do nothing if the version
doesn't match so we need an extra macro to know whether we can
spa_interface_call() for any given version.
This allows us to implement things like:
if (spa_interface_callback_version_min(1)
spa_interface_call(..., 1, func_v1)
else
spa_interface_call(..., 0, func_v0)
The tests using this function use the pw_log* macros which invoke
whichever logger pipewire has set. Since the default logging
implementation supports logging to a file anyway, let's just use that
instead of having to load the plugin ourselves.
For SPA libraries that we link against elsewhere in the tree, declare a
declare a dependency "foo_dep" for that library that specifies how to
link to it. Then use that dependency in the various targets.
This removes the knowledge of how to link with the library from the
target which can treat it as just another dependency.
In the case of optional libraries (e.g. the journal support lib) we can
then use declare_dependency() to declare an empty dependencies and thus
link them unconditionally in the target.
Allow one of "XEWIDT" to refer to none, errors, warnings, info, debug
and trace, respectively because they're immediately recognizable. Well,
except maybe the X.
PIPEWIRE_DEBUG="I" is equivalent to PIPEWIRE_DEBUG="3" for example.
Running under valgrind enforces --no-fork so any signal will cause valgrind
to error out, failing the test abnormally. This prevents us from running
our test suite through valgrind, we'd have to mark every test specifically
whether it should run under valgrind or not.
Easier is just to automatically skip tests expecting signals.
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.
All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
CID 1457494: Incorrect expression (ASSERT_SIDE_EFFECT)
Assignment "ai = (void *)((uint8_t *)pod + 16)" has a side effect. This code will work differently in a non-debug build.
550 spa_assert((ai = SPA_POD_ARRAY_VALUES(pod)) != NULL);
Patch generated with coccinelle snippet
@@
expression E1, E2;
@@
- spa_assert((E1 = E2) != NULL);
+ E1 = E2;
+ spa_assert(E1 != NULL);
And run again for == NULL
gcc 9 complains about `v` being potentially uninitialized. This is a false
positive, we'd exit() on any error before using `v` but the compiler doesn't
seem to know that. Let's shut up the warning.
If we don't have the capability to ptrace, we are probably running inside a
container, not the debugger. Check this first so we don't disable forking
mode.
Make this conditional on libcap - where libcap is not available always assume
we *do not* have a debugger attached. This is easier than telling everyone who
runs the tests in a confined system to install libcap.
Fixes#1285
Move the spa tests to the pwtest framework. The pod tests have only been
wrapped in the function callers, they don't use the variuos pwtest helpers -
too much work for very little gain here. Can be done incrementally if needed.
Note that this removes the spa tests from the installed tests. Arguably,
installing those tests was unnecessary anyway since they are static binaries
and don't load anything. So having them installed runs the same tests as
having them run in the source tree.
Goal for the pwtest framework is to allow for installed tests, just not there
yet.