From ec8b2939992e75ca7af05c9efd75a41a9cd1a66f Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Mon, 7 Feb 2022 02:49:15 +0900 Subject: [PATCH] check: Disable some tests if pipe() is unavailable for UWP build pipe() and _pipe() are not allowed on UWP Part-of: --- subprojects/gstreamer/meson.build | 5 +++++ subprojects/gstreamer/tests/check/elements/fdsrc.c | 4 ++++ subprojects/gstreamer/tests/check/gst/gstpoll.c | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build index a0076f8237..eab321db2b 100644 --- a/subprojects/gstreamer/meson.build +++ b/subprojects/gstreamer/meson.build @@ -381,6 +381,11 @@ if not cc.has_members('struct itimerspec', 'it_interval', 'it_value', prefix : '#include ') cdata.set('STRUCT_ITIMERSPEC_DEFINITION_MISSING', 1) endif +if host_system != 'windows' + cdata.set('HAVE_PIPE', 1) +elif cc.has_function('_pipe', prefix : '#include ') + cdata.set('HAVE_PIPE', 1) +endif # Platform deps; only ws2_32 and execinfo for now platform_deps = [] diff --git a/subprojects/gstreamer/tests/check/elements/fdsrc.c b/subprojects/gstreamer/tests/check/elements/fdsrc.c index 8e1c4217a0..5d0cc63c0a 100644 --- a/subprojects/gstreamer/tests/check/elements/fdsrc.c +++ b/subprojects/gstreamer/tests/check/elements/fdsrc.c @@ -74,6 +74,7 @@ cleanup_fdsrc (GstElement * fdsrc) gst_check_teardown_element (fdsrc); } +#ifdef HAVE_PIPE GST_START_TEST (test_num_buffers) { GstElement *src; @@ -165,6 +166,7 @@ GST_START_TEST (test_nonseeking) } GST_END_TEST; +#endif /* HAVE_PIPE */ GST_START_TEST (test_seeking) { @@ -209,8 +211,10 @@ fdsrc_suite (void) TCase *tc_chain = tcase_create ("general"); suite_add_tcase (s, tc_chain); +#ifdef HAVE_PIPE tcase_add_test (tc_chain, test_num_buffers); tcase_add_test (tc_chain, test_nonseeking); +#endif tcase_add_test (tc_chain, test_seeking); return s; diff --git a/subprojects/gstreamer/tests/check/gst/gstpoll.c b/subprojects/gstreamer/tests/check/gst/gstpoll.c index dbf1631108..a66de98f6c 100644 --- a/subprojects/gstreamer/tests/check/gst/gstpoll.c +++ b/subprojects/gstreamer/tests/check/gst/gstpoll.c @@ -34,6 +34,7 @@ #include #endif +#ifdef HAVE_PIPE GST_START_TEST (test_poll_wait) { GstPoll *set; @@ -102,6 +103,8 @@ GST_START_TEST (test_poll_wait) GST_END_TEST; +#endif /* HAVE_PIPE */ + GST_START_TEST (test_poll_basic) { GstPoll *set; @@ -342,7 +345,10 @@ gst_poll_suite (void) tcase_add_test (tc_chain, test_poll_controllable); #else tcase_skip_broken_test (tc_chain, test_poll_basic); +#ifdef HAVE_PIPE + /* pipe() or _pipe() is not available on UWP */ tcase_skip_broken_test (tc_chain, test_poll_wait); +#endif tcase_skip_broken_test (tc_chain, test_poll_wait_stop); tcase_skip_broken_test (tc_chain, test_poll_wait_restart); tcase_skip_broken_test (tc_chain, test_poll_wait_flush);