diff --git a/.travis.yml b/.travis.yml index 98b98d95..33a6c780 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,4 @@ addons: script: - mkdir tests - cd tests - - ../src/test/tpkg/run-all.sh + - ../src/test/tpkg/run-parallel.sh diff --git a/src/Makefile.in b/src/Makefile.in index 2342e250..38c7c4d9 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -221,8 +221,8 @@ const-info.lo const-info.o: $(srcdir)/const-info.c \ getdns/getdns_extra.h \ $(srcdir)/const-info.h context.lo context.o: $(srcdir)/context.c \ - config.h \ - $(srcdir)/debug.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/context.h \ + config.h $(srcdir)/debug.h \ + $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/context.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \ @@ -257,8 +257,7 @@ dict.lo dict.o: $(srcdir)/dict.c \ $(srcdir)/gldns/pkthdr.h $(srcdir)/dict.h $(srcdir)/list.h $(srcdir)/const-info.h $(srcdir)/gldns/wire2str.h \ $(srcdir)/gldns/parseutil.h dnssec.lo dnssec.o: $(srcdir)/dnssec.c \ - config.h \ - $(srcdir)/debug.h \ + config.h $(srcdir)/debug.h \ getdns/getdns.h \ $(srcdir)/context.h \ getdns/getdns_extra.h \ @@ -272,8 +271,7 @@ dnssec.lo dnssec.o: $(srcdir)/dnssec.c \ $(srcdir)/general.h $(srcdir)/dict.h $(srcdir)/list.h $(srcdir)/util/val_secalgo.h \ $(srcdir)/util/orig-headers/val_secalgo.h general.lo general.o: $(srcdir)/general.c \ - config.h \ - $(srcdir)/general.h \ + config.h $(srcdir)/general.h \ getdns/getdns.h \ $(srcdir)/types-internal.h \ getdns/getdns_extra.h \ @@ -288,15 +286,15 @@ list.lo list.o: $(srcdir)/list.c $(srcdir)/types-internal.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/util-internal.h \ - config.h \ - $(srcdir)/context.h $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \ + config.h $(srcdir)/context.h \ + $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \ $(srcdir)/types-internal.h $(srcdir)/ub_loop.h $(srcdir)/debug.h $(srcdir)/server.h $(srcdir)/util/lruhash.h \ $(srcdir)/util/orig-headers/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/orig-headers/locks.h \ $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \ $(srcdir)/gldns/pkthdr.h $(srcdir)/list.h $(srcdir)/dict.h mdns.lo mdns.o: $(srcdir)/mdns.c \ - config.h \ - $(srcdir)/debug.h $(srcdir)/context.h \ + config.h $(srcdir)/debug.h \ + $(srcdir)/context.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \ @@ -308,8 +306,7 @@ mdns.lo mdns.o: $(srcdir)/mdns.c \ $(srcdir)/util/auxiliary/util/fptr_wlist.h $(srcdir)/util/lookup3.h \ $(srcdir)/util/orig-headers/lookup3.h pubkey-pinning.lo pubkey-pinning.o: $(srcdir)/pubkey-pinning.c \ - config.h \ - $(srcdir)/debug.h \ + config.h $(srcdir)/debug.h \ getdns/getdns.h \ $(srcdir)/context.h \ getdns/getdns_extra.h \ @@ -355,8 +352,8 @@ server.lo server.o: $(srcdir)/server.c \ $(srcdir)/util/orig-headers/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/orig-headers/locks.h \ $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h stub.lo stub.o: $(srcdir)/stub.c \ - config.h \ - $(srcdir)/debug.h $(srcdir)/stub.h \ + config.h $(srcdir)/debug.h \ + $(srcdir)/stub.h \ getdns/getdns.h \ $(srcdir)/types-internal.h \ getdns/getdns_extra.h \ @@ -369,8 +366,7 @@ stub.lo stub.o: $(srcdir)/stub.c \ $(srcdir)/util-internal.h $(srcdir)/general.h $(srcdir)/pubkey-pinning.h sync.lo sync.o: $(srcdir)/sync.c \ getdns/getdns.h \ - config.h \ - $(srcdir)/context.h \ + config.h $(srcdir)/context.h \ getdns/getdns_extra.h \ $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h \ $(srcdir)/extension/default_eventloop.h $(srcdir)/extension/poll_eventloop.h \ @@ -483,8 +479,8 @@ libevent.lo libevent.o: $(srcdir)/extension/libevent.c \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/getdns/getdns_ext_libevent.h libuv.lo libuv.o: $(srcdir)/extension/libuv.c \ - config.h \ - $(srcdir)/debug.h $(srcdir)/types-internal.h \ + config.h $(srcdir)/debug.h \ + $(srcdir)/types-internal.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/getdns/getdns_ext_libuv.h diff --git a/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.dsc b/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.dsc index 61defe2c..c06a540e 100644 --- a/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.dsc +++ b/src/test/tpkg/320-event-loops-compile.tpkg/320-event-loops-compile.dsc @@ -6,7 +6,7 @@ Maintainer: Willem Toorop Category: Component: CmdDepends: -Depends: 300-event-loops-configure.tpkg +Depends: 310-dependencies.tpkg Help: Pre: 320-event-loops-compile.pre Post: 320-event-loops-compile.post diff --git a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.dsc b/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.dsc deleted file mode 100644 index 685708a2..00000000 --- a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.dsc +++ /dev/null @@ -1,16 +0,0 @@ -BaseName: 340-event-loops-scan-build -Version: 1.0 -Description: Compile -CreationDate: do 28 apr 2016 16:50:43 CEST -Maintainer: Willem Toorop -Category: -Component: -CmdDepends: scan-build -Depends: 300-event-loops-configure.tpkg -Help: -Pre: 340-event-loops-scan-build.pre -Post: 340-event-loops-scan-build.post -Test: 340-event-loops-scan-build.test -AuxFiles: -Passed: -Failure: diff --git a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.pre b/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.pre deleted file mode 100644 index 14ea1b2a..00000000 --- a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.pre +++ /dev/null @@ -1,24 +0,0 @@ -# #-- 340-event-loops-scan-build.pre--# -# source the master var file when it's there -if [ -f ../.tpkg.var.master ] -then - source ../.tpkg.var.master -else - ( - cd .. - [ -f "${TPKG_SRCDIR}/setup-env.sh" ] \ - && sh "${TPKG_SRCDIR}/setup-env.sh" - ) && source ../.tpkg.var.master -fi -# use .tpkg.var.test for in test variable passing -[ -f .tpkg.var.test ] && source .tpkg.var.test - -echo "" > restore-srcdir-configure-settings -for f in `grep 'CONFIG_[FH][IE][LA][ED][SE]' "${SRCROOT}/configure.ac" | sed -e 's/^.*(\[//g' -e 's/\])//g'` -do - if [ -f "${SRCROOT}/$f" ] - then - mv "${SRCROOT}/${f}" "${SRCROOT}/${f}.build-event-loops" && \ - echo "$f" >> restore-srcdir-configure-settings - fi -done diff --git a/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.dsc b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.dsc new file mode 100644 index 00000000..33cf7bb3 --- /dev/null +++ b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.dsc @@ -0,0 +1,16 @@ +BaseName: 400-static-analysis +Version: 1.0 +Description: Compile +CreationDate: wo 10 mei 2017 14:56:19 CEST +Maintainer: Willem Toorop +Category: +Component: +CmdDepends: scan-build +Depends: +Help: +Pre: 400-static-analysis.pre +Post: 400-static-analysis.post +Test: 400-static-analysis.test +AuxFiles: +Passed: +Failure: diff --git a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.post b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.post similarity index 80% rename from src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.post rename to src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.post index 4ad0e7a8..5551a73d 100644 --- a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.post +++ b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.post @@ -1,4 +1,4 @@ -# #-- 340-event-loops-scan-build.post --# +# #-- 400-static-analysis.post --# # source the master var file when it's there if [ -f ../.tpkg.var.master ] then @@ -15,6 +15,6 @@ fi for f in `cat restore-srcdir-configure-settings` do - mv "${SRCROOT}/${f}.build-event-loops" "${SRCROOT}/${f}" + mv "${SRCROOT}/${f}.build-static-analysis" "${SRCROOT}/${f}" done diff --git a/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.pre b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.pre new file mode 100644 index 00000000..bda600f8 --- /dev/null +++ b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.pre @@ -0,0 +1,35 @@ +# #-- 400-static-analysis.pre--# +# source the master var file when it's there +if [ -f ../.tpkg.var.master ] +then + source ../.tpkg.var.master +else + ( + cd .. + [ -f "${TPKG_SRCDIR}/setup-env.sh" ] \ + && sh "${TPKG_SRCDIR}/setup-env.sh" + ) && source ../.tpkg.var.master +fi +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test + +echo "" > restore-srcdir-configure-settings +for f in `grep 'CONFIG_[FH][IE][LA][ED][SE]' "${SRCROOT}/configure.ac" | sed -e 's/^.*(\[//g' -e 's/\])//g'` +do + if [ -f "${SRCROOT}/$f" ] + then + mv "${SRCROOT}/${f}" "${SRCROOT}/${f}.build-static-analysis" && \ + echo "$f" >> restore-srcdir-configure-settings + fi +done +rm -fr "${BUILDDIR}/build-static-analysis" +mkdir "${BUILDDIR}/build-static-analysis" +cd "${BUILDDIR}/build-static-analysis" +"${SRCROOT}/configure" $* --enable-all-drafts --with-getdns_query --with-libevent --with-libev --with-libuv \ + || "${SRCROOT}/configure" $* --enable-all-drafts --with-getdns_query --with-libevent --with-libev \ + || "${SRCROOT}/configure" $* --enable-all-drafts --with-getdns_query --with-libevent --with-libuv \ + || "${SRCROOT}/configure" $* --enable-all-drafts --with-getdns_query --with-libev --with-libuv \ + || "${SRCROOT}/configure" $* --enable-all-drafts --with-getdns_query --with-libevent \ + || "${SRCROOT}/configure" $* --enable-all-drafts --with-getdns_query --with-libev \ + || "${SRCROOT}/configure" $* --enable-all-drafts --with-getdns_query --with-libuv + diff --git a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.test b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.test similarity index 74% rename from src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.test rename to src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.test index 99aff40a..132a9eff 100644 --- a/src/test/tpkg/340-event-loops-scan-build.tpkg/340-event-loops-scan-build.test +++ b/src/test/tpkg/400-static-analysis.tpkg/400-static-analysis.test @@ -1,9 +1,8 @@ -# #-- 340-event-loops-scan-build.test --# +# #-- 400-static-analysis.test --# # source the master var file when it's there [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master # use .tpkg.var.test for in test variable passing [ -f .tpkg.var.test ] && source .tpkg.var.test -cd "${BUILDDIR}/build-event-loops" -make -j 4 clean +cd "${BUILDDIR}/build-static-analysis" scan-build -o ../scan-build-reports -v --status-bugs make -j 4 everything diff --git a/src/test/tpkg/clean.sh b/src/test/tpkg/clean.sh index e71f3114..60e4ef42 100755 --- a/src/test/tpkg/clean.sh +++ b/src/test/tpkg/clean.sh @@ -3,5 +3,5 @@ export SRCDIR=`dirname $0` ( cd $SRCDIR ./tpkg clean - rm -fr build build-stub-only build-event-loops install scan-build-reports .tpkg.var.master *.info + rm -fr build build-stub-only build-event-loops build-static-analysis install scan-build-reports .tpkg.var.master *.info ) diff --git a/src/test/tpkg/run-parallel.sh b/src/test/tpkg/run-parallel.sh new file mode 100755 index 00000000..7e72998c --- /dev/null +++ b/src/test/tpkg/run-parallel.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +export SRCDIR=`dirname $0` +. `dirname $0`/setup-env.sh + +cat > Makefile << MAKEFILE_HEADER +all: retry results + +retry: + for f in result.* ; do if test ! -e .done-\$\${f#result.} ; then rm -f \$\$f ; fi; done + +MAKEFILE_HEADER + +ALL="results:" +for TEST_PKG in ${SRCDIR}/*.tpkg +do + P=${TEST_PKG#${SRCDIR}/} + P=${P%.tpkg} + DONE="result.$P" + ALL="$ALL $DONE" +done +echo $ALL >> Makefile +printf '\t"%s" r\n\n' "${TPKG}" >> Makefile +printf 'clean:\n\t"%s" clean\n\trm -fr build build-stub-only build-event-loops build-static-analysis install scan-build-reports .tpkg.var.master *.info\n\n' "${TPKG}" >> Makefile +for TEST_PKG in ${SRCDIR}/*.tpkg +do + P=${TEST_PKG#${SRCDIR}/} + P=${P%.tpkg} + DONE="result.$P:" + for D in `grep "^Depends: " "${TEST_PKG}/${P}.dsc" | sed 's/^Depends: //g'` + do + D=${D%.tpkg} + DONE="$DONE result.$D" + done + echo $DONE >> Makefile + printf '\t"%s" %s exe "%s"\n\n' "${TPKG}" "$*" "${TEST_PKG}" >> Makefile + echo "" >> Makefile +done +make -j 2