Bug#797157: libmicrohttpd: Add autopkgtest

2015-09-05 Thread Bertrand Marc
Hello,

Thank you for this patch, it will be included in the next release of
libmicrohttpd.

Regards,
Bertrand



signature.asc
Description: OpenPGP digital signature


Bug#797157: libmicrohttpd: Add autopkgtest

2015-08-28 Thread Martin Pitt
Package: libmicrohttpd
Version: 0.9.37+dfsg-1
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch wily

Hello,

this debdiff adds a simple autopkgtest for the -dev package. This will
ensure that you can compile/link/run a trivial program against
libmicrohttpd-dev, and thus cover correct installation of *.h and
pkg-config files, validity of pkg-config, and correct dependencies of
the -dev package.

Thanks for considering,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
Add compile/link/run autopkgtest for libmicrohttpd-dev.
diff -Nru libmicrohttpd-0.9.37+dfsg/debian/tests/build 
libmicrohttpd-0.9.37+dfsg/debian/tests/build
--- libmicrohttpd-0.9.37+dfsg/debian/tests/build1970-01-01 
01:00:00.0 +0100
+++ libmicrohttpd-0.9.37+dfsg/debian/tests/build2015-08-28 
09:04:46.0 +0200
@@ -0,0 +1,25 @@
+#!/bin/sh
+# autopkgtest check: Builds a small application against libmicrohttpd, checking
+# if it compiles, links and runs successfully.
+# Author: Martin Pitt mp...@debian.org
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap rm -rf $WORKDIR 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat EOF  build_test.c
+#include microhttpd.h
+int main(int argc, char** argv) {
+struct MHD_Daemon *d;
+d = MHD_start_daemon (MHD_USE_DEBUG, 1234, NULL, NULL, NULL, html /, 
MHD_OPTION_END);
+if (d != NULL)
+MHD_stop_daemon (d);
+return 0;
+}
+EOF
+gcc `pkg-config --cflags libmicrohttpd` -o build_test build_test.c `pkg-config 
--libs libmicrohttpd`
+echo build: OK
+[ -x build_test ]
+./build_test
+echo run: OK
diff -Nru libmicrohttpd-0.9.37+dfsg/debian/tests/control 
libmicrohttpd-0.9.37+dfsg/debian/tests/control
--- libmicrohttpd-0.9.37+dfsg/debian/tests/control  1970-01-01 
01:00:00.0 +0100
+++ libmicrohttpd-0.9.37+dfsg/debian/tests/control  2015-08-28 
09:04:06.0 +0200
@@ -0,0 +1,2 @@
+Tests: build
+Depends: build-essential, pkg-config, libmicrohttpd-dev


signature.asc
Description: Digital signature