Commit graph

53 commits

Author SHA1 Message Date
Peter Hutterer
9a65d90e88 test: move the spa tests to pwtest
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.
2021-06-09 18:00:59 +10:00
Peter Hutterer
7909c99ead test: convert two spa tests to pwtest 2021-06-09 18:00:39 +10:00
Peter Hutterer
0054319d88 meson.build: add -D_GNU_SOURCE to the project arguments
This appends it to every compilation command so we can get rid of the c_args
for (almost all) executables.
2021-06-09 07:47:51 +00:00
Peter Hutterer
fee4d0eae1 spa: switch the include header test to C++ by default
If we have a C++ compiler, compile all the #include tests with that - it'll
pick up any issues that a C compiler will pick up anyway. This saves us from
having a separate C++ compiler test and it'll test each header separately for
C++ compatibility..
2021-06-09 07:43:46 +00:00
Peter Hutterer
f3a98debec spa: don't run the spa_scnprintf abort test under valgrind
valgrind doesn't know we expect this to fail, so let's not confuse it
2021-06-08 20:21:50 +10:00
Peter Hutterer
d08d989412 spa: add a test for missing includes
For each header in the spa directory, generate a compilation test that
includes just that header. This way we can pick up missing #includes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-07 10:31:17 +00:00
Peter Hutterer
db989d851d spa: auto-generate the cpp compilation test
Replace the manually maintained header list with a Python script that finds
all header files and includes them in order. This adds another 25 or so
previously headers to the C++ compilation tests.
2021-06-07 07:20:21 +00:00
Peter Hutterer
81cc466752 spa: the cpp test is a compilation test only
No point installing or even running it, we don't do anything here.
2021-06-04 18:46:29 +10:00
Peter Hutterer
223f20709d meson: replace join_paths(a, b) with a / b
More readable and from the meson reference manual:
(since 0.49.0) Using the/ operator on strings is equivalent to calling join_paths.
2021-04-15 06:57:00 +00:00
Wim Taymans
62cdec8448 spa: move json parser to utils
Add unit test
Add escape function
2020-11-28 15:34:01 +01:00
Simon McVittie
b852b58f82 Optionally install examples and tests
This makes it easier to test PipeWire in its "as-installed" state,
for example in an OS distribution.

The .test metadata files in ${datadir}/installed-tests/${package} are
a convention taken from GNOME's installed-tests initiative, allowing a
generic test-runner like gnome-desktop-testing to discover and run tests
in an automatic way.

The installation path ${libexecdir}/installed-tests/${package} is also
a convention borrowed from GNOME's installed-tests initiative.

In addition to the automated tests, I've installed example executables
in the same place, for manual testing. They could be separated into
a different directory if desired, but they seem like they have more
similarities with the automated tests than differences: both are there
to test that PipeWire works correctly, and neither should be relied on
for production use. Some examples are installed in deeper subdirectories
to avoid name clashes.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-16 17:58:02 +00:00
Wim Taymans
6e9d3bdb36 tests: add small dict benchmark 2020-01-14 13:52:08 +01:00
Wim Taymans
ac24743b2e the epoll shim should only be used by the system library.
All other places should use the system library to get the right
fds.
2019-11-19 15:16:18 +01:00
Gleb Popov
fd937fa378 On FreeBSD, add dependency on epoll-shim library.
FreeBSD doesn't provide timerfd and eventfd functions. These are implemented in
3rd party library called epoll-shim. Link targets requiring these functions to
this library.
2019-11-19 13:41:40 +01:00
Wim Taymans
54f6834de4 io: add clock_id to clock
Can be used to determine if we need to slave or not.
Add node abi test
Fix some headers
2019-10-23 13:13:01 +02:00
George Kiagiadakis
71eb538fba meson: prefix the names of the tests so that they are unique in the tree
meson < 0.46 does not allow two targets to share the same name;
meson >= 0.46 relaxes that requirement, but I see no reason to require
a new version of meson just for this
2019-02-13 11:22:45 +01:00
Wim Taymans
6f586602af audioconvert: add unit test for format conversion
Add unit test for fmt conversion and fix some bugs
Add empty fmt-ops benchmark
2019-01-23 15:59:54 +01:00
Wim Taymans
351fb9ce29 pod: improve parser and builder
Remove the spa_pod_iter helpers
Remove builder/parser vararg recurse option, you have to
manually recurse into structures when needed. This simplifies
things a lot.
Pass spa_pod_frames to builder and parser explicitly, we don't
have to keep an internal stack anymore.
The parser is now almost a mirror image of the builder.
Make the parser safer when iterating over objects, add functions
to check and get pod contents in a safe way.
Make the builder return errno style results on errors
Improve performance of object properties when they are stored and
retrieved in the same order.
Add many more tests for the builder and parser
Add some benchmarks
2019-01-22 17:38:23 +01:00
Wim Taymans
3ee463ed3a spa: Update tests and examples
Keep tests in spa/tests
Make spa/examples
Remove some old examples
2019-01-17 09:27:41 +01:00
Wim Taymans
1ed27a8f2b add _GNU_SOURCE as compiler flag 2019-01-08 17:36:58 +01:00
George Kiagiadakis
cef55ea47d spa: tests: add automated unit test for spa_dict 2018-10-31 10:50:36 +00:00
Wim Taymans
cc842cbdc8 Type changes
Only allow properties inside objects, this makes it easier to
iterate the object, which is needed for efficiently processing
control streams.
Add a choice type to mark variable properties.
SPA_TYPE_Enum -> SPA_TYPE_Id to avoid confusion with choice enum
Make it easier to allocate and initialize properties on the stack
Make more efficient methods to make objects.
2018-09-05 16:41:07 +02:00
Wim Taymans
a6ad8f747f remove spalib 2018-08-14 15:29:25 +02:00
Wim Taymans
142ef38df9 stream: more work on converter 2018-04-06 18:39:40 +02:00
Wim Taymans
0b4cef586f audioconvert: improvements 2018-04-03 16:29:36 +02:00
Emmanuele Bassi
f9ed917814 build: Do not redefine dependency objects
Use the top-level ones.
2018-01-26 08:51:38 +01:00
Wim Taymans
7d5f302f93 Add bluez5 plugins 2018-01-16 15:19:55 +01:00
Wim Taymans
7f4363d367 test-mixer: animate volume controls
Fix volume in audiomixer.
2017-11-23 18:04:39 +01:00
Wim Taymans
a092b9312a Add control properties to audiotestsrc
Add control properties to audiotestsrc for frequency and volume
and add a test program.
Add size parameter to set_io for additional checks and to make it
easy to know how much control data we can write.
2017-11-22 14:30:04 +01:00
Wim Taymans
93bd18ccc5 fix build of test 2017-09-29 12:18:38 +02:00
Wim Taymans
d65012ff21 remove json stuff
using JSON for formats or properties is not a good idea because we can't
add more types like pointers, fd, rectangles without weird hacks. Our
PODs are more easy to parse and extend and now there is an easy way
to parse and create them as well.
2017-09-28 17:07:43 +02:00
Wim Taymans
24d80e5c00 Add new pod parser and builder
Add a new pod builder and parser that is less verbose and
a little more powerful.
2017-09-28 17:00:51 +02:00
Wim Taymans
ac382c052a Work on JSON based format descriptions 2017-09-20 08:03:56 +02:00
Wim Taymans
eba2b82c8e graph: fix the API a little
Add test for atomic graph updates
2017-08-18 18:54:45 +02:00
Wim Taymans
8886f5d373 build fixes 2017-07-04 11:30:49 +02:00
Wim Taymans
b4fdcbd322 Debug: remove logger
Make a default logger and mapper in a .h file to be used by examples
Remove logger and mapper from libs
Make method to set the default mapper for the debug methods
2017-06-06 13:30:34 +02:00
Wim Taymans
12effccb06 Add fakesrc ! fakesink test
Add fakesrc and fakesink and some performance test
Small cleanups
2017-05-19 12:48:51 +02:00
Wim Taymans
6691eb7845 graph: add graph datastructure and scheduler
Improve event and command init so that it can be used more easily
as compound literals.
Improve volume
Make it possible to use graph scheduler in test-mixer
2017-05-18 17:16:48 +02:00
Wim Taymans
63d060a63e ringbuffer: add stress test 2017-04-25 19:22:06 +02:00
Wim Taymans
f0aafb5b51 alsa: work on ringbuffer data transport
Add ringbuffer test
2017-04-20 19:25:14 +02:00
Wim Taymans
01c13adab5 improve node io
Unify input and output io areas.
Add support for ranges in the io area.
Automatically recycle buffers in the output areas in process_output
Improve the mixer, add use_buffer support, use a queue of input buffers,
fix mixing, add support for ranges.
Fix mixer and v4l2 tests
2017-04-03 14:56:04 +02:00
Wim Taymans
29fbf2e841 props: improve prop flags
Only keep the READONLY prop flag.
Work on test-mixer
2017-03-31 11:48:24 +02:00
Wim Taymans
7fc73953cd Add POD helper objects
POD (plain old data) objects are similar to LV2 Atoms and allows storage
and construction of datastructures in memory or on the stack. They can
be copied with a simple memcpy.

The idea is to use this to construct the network messages and to replace
the structures used for describing formats and properties.
2017-02-22 13:12:32 +01:00
Wim Taymans
808d6b6fca prop-builder: add helper to make properties and formats
Use this to make a format filter. Use the filter to negotiate
a format automatically.
2017-02-20 17:22:46 +01:00
Wim Taymans
ae93f15965 Work on event loop
Make a new epoll based event loop and use it for the data tranport.
Simplify the spa event api a little and rename to SpaLoop
2016-11-18 17:46:01 +01:00
Wim Taymans
7e46f9e3ad More hacking
Move array and map to pinos
Move more things to spa lib
ControlCmd -> Message
Make pinos log, use for plugins as well
work on ringbuffer in alsa and nodes
work on making registry with all objects
2016-11-03 19:41:53 +01:00
Wim Taymans
67dd3adb87 port to meson 2016-09-26 12:15:52 +02:00
Wim Taymans
6ab8af91e0 More hacking
Add spa based v4l2 pinos module
Add allocation params to port_alloc_buffers
Let the app do allocation for handles.
2016-07-25 10:50:46 +02:00
Wim Taymans
5fa334a89b poll: remove threads from alsa-sink
Remove the thread from alsa sink and use the pollfd event.
Make it possible to pass multiple fds in one pollfd event
Add 3 callbacks to the pollfd event and add support for timeouts
2016-07-25 10:50:05 +02:00
Wim Taymans
81bde64550 v4l2: remove poll and send event instead
Don't start a thread for polling in the node itself but let this be
handled by the app.
2016-07-25 10:50:05 +02:00