minissdpd: add "make check"
This commit is contained in:
parent
b55ecd70ef
commit
1c84e560ac
|
@ -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'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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`
|
Loading…
Reference in New Issue