Package: src:gtkgl2
Followup-For: Bug #814351

The previous test did no initialization and got a segmentation fault.
This patch replaces it with one of the examples.
>From a385b3a1216636d70be9e3da36f7745474401b84 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <[email protected]>
Date: Thu, 11 Feb 2016 10:33:57 +0100
Subject: [PATCH] test: run simple.c with a virtual X display.

---
 debian/tests/control            |  2 +-
 debian/tests/link-basic-example | 13 ++++---------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/debian/tests/control b/debian/tests/control
index c16ed91..6e28a5c 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
 Tests: link-basic-example
-Depends: @, pkg-config
+Depends: @, pkg-config, xvfb
diff --git a/debian/tests/link-basic-example b/debian/tests/link-basic-example
index 2e0cd95..35d98f6 100644
--- a/debian/tests/link-basic-example
+++ b/debian/tests/link-basic-example
@@ -1,12 +1,7 @@
 #!/bin/sh
 set -C -e -f -u
-cd "$ADTTMP"
 
-cat > m.c <<EOF
-#include <gtkgl/gdkgl.h>
-int main (int argc, char **argv) {
-  return gdk_gl_query () == TRUE;
-}
-EOF
-cc -o m m.c `pkg-config --cflags --libs gtkgl-2.0`
-./m
+# Do not start main loop waiting for X input.
+sed 's/gtk_main();//' examples/simple.c > "$ADTTMP/m.c"
+cc -o "$ADTTMP/m" "$ADTTMP/m.c" `pkg-config --cflags --libs gtkgl-2.0`
+xvfb-run "$ADTTMP/m"
-- 
2.7.0

Reply via email to