On Mon, Dec 06, 2021 at 10:15:08AM +0100, Takashi Iwai wrote:
Thanks for the patch! That's one of my long-standing TODO, and you solved it :)
Well, not quite scratched my own itch yet - testing that events are generated would do most of that for me, the events just aren't used for a lot of users so easy to miss.
Through a quick glance, the code looks fine. But a general question is how to deal with the external library setup for kselftest. Ideally speaking, the include and the library paths should be managed via pkgconfig, but it'll make things a bit more complicated, of course. And what if the system has no libasound? Will we make it mandatory?
This is already an issue for other kselftests - the expectation is that the users will figure out how to install whatever the dependencies are, or if they don't want to build a given kselftest for whatever reason will skip it (there's options for that in the kselftest build setup stuff, it skips BPF since it requires really bleeding edge stuff so it's not like you can install a distro package). From that point of view it's probably better to error out so people see that there's a test they could be running. Unlike with Kconfig symbols there's no way to programatically specify what's needed (I didn't add any Kconfig dependency since alsa-lib works fine on systems without ALSA and really it's a system specific driver that's needed for this to be useful).
I can add pkg-config usage in there easily enough, though I'm not sure I've ever seen alsa-lib installed anywhere other than the default system path.