[Spice-commits] tests/usb-acl-helper.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 5 15:00:45 UTC 2018


 tests/usb-acl-helper.c |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 17a318ee969f4bf0f40ad4bced583228f652c0f7
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon Sep 3 17:27:56 2018 +0100

    build: Make usb-acl-helper test work under Meson
    
    Meson waits for pipes (stdout and stderr) to be not readable but
    our mocking helper does not close these handles causing Meson
    to exit with a stack trace.
    Note that the fact that the helper is not closing the handles
    is a wanted behaviour.
    
    Already reported at https://github.com/mesonbuild/meson/issues/3967.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>

diff --git a/tests/usb-acl-helper.c b/tests/usb-acl-helper.c
index 06f8036..2b28ade 100644
--- a/tests/usb-acl-helper.c
+++ b/tests/usb-acl-helper.c
@@ -15,6 +15,7 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <stdio.h>
 #include <glib.h>
 #include "usb-acl-helper.h"
 
@@ -198,6 +199,13 @@ static void test_acl_helper_no_response(Fixture *fixture, gconstpointer user_dat
 
 int main(int argc, char* argv[])
 {
+    /* Meson waits for stderr to be not readable so make sure the
+     * helper does not keep the pipe open (this happens with current
+     * mock helper) */
+    if (freopen("usb-acl-helper-error.log", "w", stderr) == NULL) {
+        return 1;
+    }
+
     g_test_init(&argc, &argv, NULL);
 
     g_test_add("/usb-acl-helper/success", Fixture, NULL,


More information about the Spice-commits mailing list