=== modified file 'debian/changelog'
--- debian/changelog	2012-10-15 21:13:33 +0000
+++ debian/changelog	2013-02-12 14:41:11 +0000
@@ -1,3 +1,9 @@
+libxcb (1.8.1-3) sid; urgency=low
+
+  * Add simple autopkgtest to the package. 
+
+ -- Vibhav Pant <vibhavp@ubuntu.com>  Sat, 09 Feb 2013 15:40:43 +0530
+
 libxcb (1.8.1-2) unstable; urgency=low
 
   * Cherry-pick from upstream 1.9:

=== modified file 'debian/control'
--- debian/control	2012-10-15 21:13:33 +0000
+++ debian/control	2013-02-09 10:12:16 +0000
@@ -1,7 +1,8 @@
 Source: libxcb
 Priority: optional
 Section: libdevel
 Maintainer: XCB Developers <xcb@lists.freedesktop.org>
 Uploaders: Josh Triplett <josh@freedesktop.org>, Julien Danjou <acid@debian.org>, Cyril Brulebois <kibi@debian.org>
 Build-Depends:
  libxau-dev (>= 1:1.0.5-2),
@@ -22,6 +23,7 @@
 # libxcb-doc
  doxygen,
  graphviz,
+XS-Testsuite: autopkgtest
 Standards-Version: 3.9.2
 Homepage: http://xcb.freedesktop.org
 Vcs-Git: git://git.debian.org/git/collab-maint/libxcb

=== added directory 'debian/tests'
=== added file 'debian/tests/build'
--- debian/tests/build	1970-01-01 00:00:00 +0000
+++ debian/tests/build	2013-02-12 14:41:11 +0000
@@ -0,0 +1,35 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against libxcb,to verify that the
+# headers and pkg-config file are installed correctly
+# (C) 2013 Canonical Ltd.
+# Author: Vibhav Pant <vibhavp@ubuntu.com>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > libxcb_test.c
+#include <xcb/xcb.h>
+#include <stdio.h>
+#include <assert.h>
+
+int main(void)
+{
+	xcb_connection_t *c;
+	int i;
+
+	c = xcb_connect(NULL, NULL);
+	assert(xcb_connection_has_error(c) == 0);
+	xcb_disconnect(c);
+
+	printf("Test completed successfully\n");
+	return 0;
+}
+EOF
+
+gcc -o libxcb_test libxcb_test.c `pkg-config --cflags --libs xcb` -Wall -Werror
+echo "build: OK"
+[ -x libxcb_test ]
+xvfb-run ./libxcb_test
+echo "run: OK"

=== added file 'debian/tests/control'
--- debian/tests/control	1970-01-01 00:00:00 +0000
+++ debian/tests/control	2013-02-09 10:14:28 +0000
@@ -0,0 +1,2 @@
+Tests: build
+Depends: libxcb1-dev, build-essential, pkg-config
\ No newline at end of file

