diff -Nru libestr-0.1.1/debian/changelog libestr-0.1.1/debian/changelog --- libestr-0.1.1/debian/changelog 2012-02-22 03:17:01.000000000 +0530 +++ libestr-0.1.1/debian/changelog 2013-02-07 14:08:25.000000000 +0530 @@ -1,3 +1,10 @@ +libestr (0.1.1-2ubuntu1) raring; urgency=low + + * Add autopkgtest tests to verify that the headers are correctly installed. + - (LP: #1117222) + + -- Vibhav Pant Wed, 06 Feb 2013 16:42:55 +0530 + libestr (0.1.1-2) unstable; urgency=low * Switch to DH 9 diff -Nru libestr-0.1.1/debian/control libestr-0.1.1/debian/control --- libestr-0.1.1/debian/control 2012-02-22 03:13:15.000000000 +0530 +++ libestr-0.1.1/debian/control 2013-02-07 14:08:31.000000000 +0530 @@ -1,8 +1,10 @@ Source: libestr Priority: extra -Maintainer: Pierre Chifflier +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Pierre Chifflier Build-Depends: debhelper (>= 9), autotools-dev +XS-Testsuite: autopkgtest Standards-Version: 3.9.2 Section: libs Homepage: http://libestr.sourceforge.net/ diff -Nru libestr-0.1.1/debian/tests/build libestr-0.1.1/debian/tests/build --- libestr-0.1.1/debian/tests/build 1970-01-01 05:30:00.000000000 +0530 +++ libestr-0.1.1/debian/tests/build 2013-02-07 14:10:24.000000000 +0530 @@ -0,0 +1,64 @@ +#!/bin/sh +# autopkgtest check: Build and run a program against libestr, to verify that the +# headers are correctly installed +# (C) 2012 Canonical Ltd. +# Author: Vibhav Pant + +set -e + +WORKDIR=$(mktemp -d) +trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM +cd $WORKDIR +cat < estr_test.c +#include +#include +#include + +int main(void) +{ + + es_str_t *estr; + /* es_newStrFromCStr: Create a new string object based on a + * "traditional" C string. */ + estr = es_newStrFromCStr("autopkgtest", 15); + + if (estr == NULL) { + fprintf(stderr, "es_newStrFromCStr failed"); + return 1; + } + /* es_strbufcmp: Compare a string against a buffer */ + if (es_strbufcmp(estr, "autopkgtest", 15) != 0) { + fprintf(stderr, "es_strbufcmp failed"); + return 1; + } + /* es_str2cstr: Obtain a traditional C-String from a string object */ + if(es_str2cstr(estr, NULL) == NULL) { + fprintf(stderr, "es_str2cstr failed"); + return 1; + } + /* es_extendBuf: Extend string buffer */ + if(es_extendBuf(&estr, 8 ) != 0) { + fprintf(stderr, "es_extendBuf failed"); + return 1; + } + /* es_addChar: Append a character to the current string object */ + if(es_addChar(&estr, 's') != 0) { + fprintf(stderr, "es_addChar failed"); + return 1; + } + /* es_addBuf: Append a memory buffer to a string */ + if(es_addBuf(&estr," Ubuntu", 7) != 0) { + fprintf(stderr, "es_addBuf failed"); + return 1; + } + /* es_deleteStr: delete a string object. */ + es_deleteStr(estr); + return 0; +} +EOF + +gcc -o estr_test estr_test.c `pkg-config --cflags --libs libestr` +echo "build: OK" +[ -x estr_test ] +./estr_test +echo "run: OK" diff -Nru libestr-0.1.1/debian/tests/control libestr-0.1.1/debian/tests/control --- libestr-0.1.1/debian/tests/control 1970-01-01 05:30:00.000000000 +0530 +++ libestr-0.1.1/debian/tests/control 2013-02-07 14:08:31.000000000 +0530 @@ -0,0 +1,2 @@ +Tests: build +Depends: libestr-dev, build-essential, pkg-config \ No newline at end of file