Files
gtk3/debian/tests/build
Simon McVittie ddcdefa98c Use the same Xvfb screen configuration as in the upstream GTK+ 4 Gitlab-CI tests
This will hopefully make GLX work (see also #874077)
2018-09-19 10:00:20 +01:00

44 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# autopkgtest check: Build and run a program against GTK, to verify that the
# headers and pkg-config file are installed correctly
# (C) 2012 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > gtktest.c
#include <glib.h>
#include <gtk/gtk.h>
static gboolean
do_quit (gpointer user_data)
{
gtk_main_quit ();
}
int main(int argc, char **argv)
{
GtkWidget *dialog;
gtk_init (&argc, &argv);
dialog = gtk_dialog_new_with_buttons ("Test dialog", NULL,
GTK_DIALOG_MODAL,
"OK", GTK_RESPONSE_ACCEPT,
NULL);
gtk_widget_show_all (dialog);
g_timeout_add_seconds (1, do_quit, NULL);
gtk_main();
return 0;
}
EOF
gcc -o gtktest gtktest.c `pkg-config --cflags --libs gtk+-3.0`
echo "build: OK"
[ -x gtktest ]
xvfb-run -a -s "-screen 0 1024x768x24" \
./gtktest
echo "run: OK"