selftests: alsa - move shared library configuration code to conf.c
Subsystems (3)
Jaroslav Kysela
maintainerPATCH 1/1 selftests: alsa - move shared library configuration code to conf.c
The minimal alsa-lib configuration code is similar in both mixer and pcm tests. Move this code to the shared conf.c source file.
Also, fix the build rules inspired by rseq tests. Build libatest.so which is linked to the both test utilities dynamically.
Also, set the TEST_FILES variable for lib.mk.
--- tools/testing/selftests/alsa/Makefile | 13 ++++- tools/testing/selftests/alsa/alsa-local.h | 2 + tools/testing/selftests/alsa/conf.c | 69 ++++++++++++++++++++++ tools/testing/selftests/alsa/mixer-test.c | 53 +---------------- tools/testing/selftests/alsa/pcm-test.c | 70 ----------------------- 5 files changed, 85 insertions(+), 122 deletions(-)
tools/testing/selftests/alsa/Makefile +12 -1
@@ -6,9 +6,20 @@ LDLIBS += $(shell pkg-config --libs alsa) ifeq ($(LDLIBS),) LDLIBS += -lasound endif +CFLAGS += -L$(OUTPUT) -Wl,-rpath=./ + +OVERRIDE_TARGETS = 1 TEST_GEN_PROGS := mixer-test pcm-test -pcm-test: pcm-test.c conf.c +TEST_GEN_PROGS_EXTENDED := libatest.so + +TEST_FILES := conf.d include ../lib.mk + +$(OUTPUT)/libatest.so: conf.c alsa-local.h + $(CC) $(CFLAGS) -shared -fPIC $< $(LDLIBS) -o $@ + +$(OUTPUT)/%: %.c $(TEST_GEN_PROGS_EXTENDED) alsa-local.h + $(CC) $(CFLAGS) $< $(LDLIBS) -latest -o $@
tools/testing/selftests/alsa/alsa-local.h +2 -0
@@ -10,6 +10,8 @@#include <alsa/asoundlib.h> +snd_config_t *get_alsalib_config (void ); +void conf_load (void );void conf_free (void );snd_config_t *conf_by_card (int card);
tools/testing/selftests/alsa/conf.c +69 -0
75 lines not on this page · raw message
tools/testing/selftests/alsa/mixer-test.c +2 -51
76 lines not on this page · raw message
tools/testing/selftests/alsa/pcm-test.c +0 -70
82 lines not on this page · raw message
Signature · 1 line
2.35.3
Quoted 2 lines · Jaroslav Kysela
The minimal alsa-lib configuration code is similar in both mixer and pcm tests. Move this code to the shared
conf.csource file.
Takashi Iwai
AppliedQuoted 7 lines · Jaroslav Kysela
The minimal alsa-lib configuration code is similar in both mixer and pcm tests. Move this code to the shared
conf.csource file.Also, fix the build rules inspired by rseq tests. Build libatest.so which is linked to the both test utilities dynamically.
Quoted 6 lines
Also, set the
TEST_FILESvariable for lib.mk.Cc Shuah Khan <[email protected]>Reported-by Mark Brown <[email protected]>Signed-off-by Jaroslav Kysela <[email protected]>
Thanks, applied now.
Takashi