[PATCH xserver 4/7] test: Return error from simple-xinit if the client crashes.

Eric Anholt eric at anholt.net
Thu Aug 3 18:28:48 UTC 2017


I want to be able to call client tests with simple-xinit, so assertion
failures should be an error.

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 test/simple-xinit.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/simple-xinit.c b/test/simple-xinit.c
index 89189a609c19..78d546c71e49 100644
--- a/test/simple-xinit.c
+++ b/test/simple-xinit.c
@@ -25,6 +25,7 @@
 #include <dix-config.h>
 #endif
 
+#include <assert.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdbool.h>
@@ -133,6 +134,13 @@ start_client(char *const *client_args, int display)
             return 1;
         }
 
+        if (WIFSIGNALED(wstatus))
+            return 1;
+
+        if (WCOREDUMP(wstatus))
+            return 1;
+
+        assert(WIFEXITED(wstatus));
         return WEXITSTATUS(wstatus);
     } else {
         execvp(client_args[0], client_args);
-- 
2.13.3



More information about the xorg-devel mailing list