check: Disable some tests if pipe() is unavailable for UWP build
authorSeungha Yang <seungha@centricular.com>
Sun, 6 Feb 2022 17:49:15 +0000 (02:49 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 16 Feb 2022 17:03:29 +0000 (17:03 +0000)
pipe() and _pipe() are not allowed on UWP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1006>

subprojects/gstreamer/meson.build
subprojects/gstreamer/tests/check/elements/fdsrc.c
subprojects/gstreamer/tests/check/gst/gstpoll.c

index a0076f8..eab321d 100644 (file)
@@ -381,6 +381,11 @@ if not cc.has_members('struct itimerspec', 'it_interval', 'it_value',
                      prefix : '#include <time.h>')
   cdata.set('STRUCT_ITIMERSPEC_DEFINITION_MISSING', 1)
 endif
+if host_system != 'windows'
+  cdata.set('HAVE_PIPE', 1)
+elif cc.has_function('_pipe', prefix : '#include <io.h>')
+  cdata.set('HAVE_PIPE', 1)
+endif
 
 # Platform deps; only ws2_32 and execinfo for now
 platform_deps = []
index 8e1c421..5d0cc63 100644 (file)
@@ -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;
index dbf1631..a66de98 100644 (file)
@@ -34,6 +34,7 @@
 #include <sys/socket.h>
 #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);