From 1c84e560ac07ffa4d5be3ed8b4a0424a29c02516 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 6 Aug 2015 12:21:56 +0200 Subject: [PATCH] minissdpd: add "make check" --- .travis.yml | 2 +- minissdpd/Makefile | 12 ++++++++++-- minissdpd/testminissdpd.sh | 10 ++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 minissdpd/testminissdpd.sh diff --git a/.travis.yml b/.travis.yml index cc7258a..8a0b95f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ compiler: script: - 'cd $TRAVIS_BUILD_DIR && cd $PROJECT' - 'MAKEFILE=Makefile && if [ -a Makefile.linux ]; then MAKEFILE=Makefile.linux; fi' - - 'make -f $MAKEFILE -j3 && if [ "$PROJECT" = "miniupnpc" ]; then make -f $MAKEFILE check; fi' + - 'make -f $MAKEFILE -j3 && if [ "$PROJECT" = "miniupnpc" -o "$PROJECT" = "minissdpd" ]; then make -f $MAKEFILE check; fi' after_success: - 'make -f $MAKEFILE install' diff --git a/minissdpd/Makefile b/minissdpd/Makefile index 25207ec..217657d 100644 --- a/minissdpd/Makefile +++ b/minissdpd/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.23 2014/12/06 10:54:01 nanard Exp $ +# $Id: Makefile,v 1.25 2015/08/06 10:17:52 nanard Exp $ # MiniUPnP project # author: Thomas Bernard # website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ @@ -43,10 +43,12 @@ SBININSTALLDIR = $(INSTALLPREFIX)/sbin MANINSTALLDIR = $(INSTALLPREFIX)/share/man -.PHONY: all clean install depend +.PHONY: all clean install depend check test all: $(EXECUTABLES) +test: check + clean: $(RM) $(ALLOBJS) $(EXECUTABLES) @@ -60,6 +62,12 @@ ifneq ($(OS), Darwin) $(INSTALL) minissdpd.init.d.script $(PREFIX)/etc/init.d/minissdpd endif +check: validateminissdpd + +validateminissdpd: testminissdpd minissdpd + ./testminissdpd.sh + touch $@ + minissdpd: $(MINISSDPDOBJS) testminissdpd: $(TESTMINISSDPDOBJS) diff --git a/minissdpd/testminissdpd.sh b/minissdpd/testminissdpd.sh new file mode 100755 index 0000000..8d1311a --- /dev/null +++ b/minissdpd/testminissdpd.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# $Id: testminissdpd.sh,v 1.1 2015/08/06 10:17:51 nanard Exp $ +# (c) 2015 Thomas Bernard + +IF=lo +SOCKET=`mktemp` +PID="${SOCKET}.pid" +./minissdpd -s $SOCKET -p $PID -i $IF || exit 1 +./testminissdpd -s $SOCKET || exit 2 +kill `cat $PID`