mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
tests: modify rtpoll-test to use 'check' framework
This commit is contained in:
parent
c02214dac5
commit
d9841a9431
2 changed files with 28 additions and 5 deletions
|
|
@ -380,9 +380,9 @@ queue_test_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulse.la libpu
|
||||||
queue_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
|
queue_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
|
||||||
|
|
||||||
rtpoll_test_SOURCES = tests/rtpoll-test.c
|
rtpoll_test_SOURCES = tests/rtpoll-test.c
|
||||||
rtpoll_test_CFLAGS = $(AM_CFLAGS)
|
rtpoll_test_CFLAGS = $(AM_CFLAGS) $(LIBCHECK_CFLAGS)
|
||||||
rtpoll_test_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulse.la libpulsecommon-@PA_MAJORMINOR@.la
|
rtpoll_test_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulse.la libpulsecommon-@PA_MAJORMINOR@.la
|
||||||
rtpoll_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
|
rtpoll_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
|
||||||
|
|
||||||
mcalign_test_SOURCES = tests/mcalign-test.c
|
mcalign_test_SOURCES = tests/mcalign-test.c
|
||||||
mcalign_test_CFLAGS = $(AM_CFLAGS)
|
mcalign_test_CFLAGS = $(AM_CFLAGS)
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <check.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <pulsecore/poll.h>
|
#include <pulsecore/poll.h>
|
||||||
|
|
@ -41,7 +42,7 @@ static int worker(pa_rtpoll_item *w) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
START_TEST (rtpoll_test) {
|
||||||
pa_rtpoll *p;
|
pa_rtpoll *p;
|
||||||
pa_rtpoll_item *i, *w;
|
pa_rtpoll_item *i, *w;
|
||||||
struct pollfd *pollfd;
|
struct pollfd *pollfd;
|
||||||
|
|
@ -80,6 +81,28 @@ int main(int argc, char *argv[]) {
|
||||||
pa_rtpoll_item_free(w);
|
pa_rtpoll_item_free(w);
|
||||||
|
|
||||||
pa_rtpoll_free(p);
|
pa_rtpoll_free(p);
|
||||||
|
}
|
||||||
return 0;
|
END_TEST
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
int failed = 0;
|
||||||
|
Suite *s;
|
||||||
|
TCase *tc;
|
||||||
|
SRunner *sr;
|
||||||
|
|
||||||
|
s = suite_create("RT Poll");
|
||||||
|
tc = tcase_create("rtpoll");
|
||||||
|
tcase_add_test(tc, rtpoll_test);
|
||||||
|
/* the default timeout is too small,
|
||||||
|
* set it to a reasonable large one.
|
||||||
|
*/
|
||||||
|
tcase_set_timeout(tc, 60 * 60);
|
||||||
|
suite_add_tcase(s, tc);
|
||||||
|
|
||||||
|
sr = srunner_create(s);
|
||||||
|
srunner_run_all(sr, CK_NORMAL);
|
||||||
|
failed = srunner_ntests_failed(sr);
|
||||||
|
srunner_free(sr);
|
||||||
|
|
||||||
|
return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue