Merge pull request #304 from getdnsapi/devel/parallel-builds

Devel/parallel builds
This commit is contained in:
wtoorop 2017-05-19 12:54:05 +02:00 committed by GitHub
commit 3f8cdf19c2
28 changed files with 212 additions and 97 deletions

View File

@ -17,4 +17,4 @@ addons:
script:
- mkdir tests
- cd tests
- ../src/test/tpkg/run-all.sh
- ../src/test/tpkg/run-parallel.sh

View File

@ -98,16 +98,16 @@ example:
cd spec/example && $(MAKE) $@
test: default
cd src && $(MAKE) $@
cd src/test && $(MAKE) $@
getdns_query: default
cd src && $(MAKE) $@
cd src/tools && $(MAKE) $@
stubby: getdns_query
cd src && $(MAKE) $@
cd src/tools && $(MAKE) $@
scratchpad: default
cd src && $(MAKE) $@
cd src/test && $(MAKE) $@
pad: scratchpad
src/test/scratchpad || ./libtool exec gdb src/test/scratchpad

View File

@ -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

View File

@ -148,13 +148,28 @@ nolibcheck:
@echo "***"
@false
test: $(NOLIBCHECK) all
(cd $(srcdir)/../.. && find . -type f -executable -and \( -name "*.[ch]" -or -name "*.html" -or -name "*.in" -or -name "*.good" -or -name "*.ac" \) | awk 'BEGIN{e=0}{print("ERROR! Executable bit found on", $$0);e=1}END{exit(e)}')
test_noeventloop: $(NOLIBCHECK) all
rm -f $(CHECK_GETDNS).failed
GETDNS_TEST_PORT=43210 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_GETDNS).log" ./$(CHECK_GETDNS) || echo "$(CHECK_GETDNS) failed" >> $(CHECK_GETDNS).failed
test_libevent: $(NOLIBCHECK) all
rm -f $(CHECK_EVENT_PROG).failed
if test $(have_libevent) = 1 ; then GETDNS_TEST_PORT=44321 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_EVENT_PROG).log" ./$(CHECK_EVENT_PROG) || echo "$(CHECK_EVENT_PROG) failed" >> $(CHECK_EVENT_PROG).failed; fi
test_libev: $(NOLIBCHECK) all
rm -f $(CHECK_EV_PROG).failed
if test $(have_libev) = 1 ; then GETDNS_TEST_PORT=45432 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_EV_PROG).log" ./$(CHECK_EV_PROG) || echo "$(CHECK_EV_PROG) failed" >> $(CHECK_EV_PROG).failed; fi
test_libuv: $(NOLIBCHECK) all
rm -f $(CHECK_UV_PROG).failed
if test $(have_libev) = 1 ; then GETDNS_TEST_PORT=46543 CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_UV_PROG).log" ./$(CHECK_UV_PROG) || echo "$(CHECK_UV_PROG) failed" >> $(CHECK_UV_PROG).failed; fi
test: test_noeventloop test_libevent test_libev test_libuv
rm -f fails
CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_GETDNS).log" ./$(CHECK_GETDNS) || echo "$(CHECK_GETDNS) failed" >> fails
if test $(have_libevent) = 1 ; then CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_EVENT_PROG).log" ./$(CHECK_EVENT_PROG) || echo "$(CHECK_EVENT_PROG) failed" >> fails; fi
if test $(have_libev) = 1 ; then CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_EV_PROG).log" ./$(CHECK_EV_PROG) || echo "$(CHECK_EV_PROG) failed" >> fails; fi
if test $(have_libuv) = 1 ; then CK_TIMEOUT_MULTIPLIER=2 CK_LOG_FILE_NAME="$(CHECK_UV_PROG).log" ./$(CHECK_UV_PROG) || echo "$(CHECK_UV_PROG) failed" >> fails; fi
if test -f $(CHECK_GETDNS).failed ; then cat $(CHECK_GETDNS).failed >> fails ; fi
if test -f $(CHECK_EVENT_PROG).failed ; then cat $(CHECK_EVENT_PROG).failed >> fails ; fi
if test -f $(CHECK_EV_PROG).failed ; then cat $(CHECK_EV_PROG).failed >> fails ; fi
if test -f $(CHECK_UV_PROG).failed ; then cat $(CHECK_UV_PROG).failed >> fails ; fi
test ! -e fails
@echo "All tests OK"

View File

@ -114,6 +114,23 @@ END_TEST
#define GETDNS_STR_ADDRESS_TYPE "address_type"
#define GETDNS_STR_ADDRESS_DATA "address_data"
#define GETDNS_STR_PORT "port"
#define TEST_PORT 43210
static uint16_t get_test_port(void)
{
char *test_port_str;
uint16_t test_port;
struct timeval tv;
if (!(test_port_str = getenv("GETDNS_TEST_PORT")) ||
!(test_port = (uint16_t)atoi(test_port_str)))
test_port = TEST_PORT;
(void)gettimeofday(&tv, NULL);
srandom((int)getpid() + (int)tv.tv_usec);
test_port += random() % 1000;
return test_port;
}
/* utilities to start a junk udp listener */
typedef struct timeout_thread_data {
@ -281,7 +298,7 @@ START_TEST (getdns_context_set_timeout_3)
t_data.running = 0;
t_data.num_callbacks = 0;
t_data.num_timeouts = 0;
t_data.port = 43210;
t_data.port = get_test_port();
pthread_create(&thread, NULL, run_server, (void *)&t_data);
@ -301,7 +318,7 @@ START_TEST (getdns_context_set_timeout_3)
bindata.data = (uint8_t*) &local_addr;
ASSERT_RC(getdns_dict_set_bindata(server_dict, GETDNS_STR_ADDRESS_DATA, &bindata),
GETDNS_RETURN_GOOD, "set addr bindata");
ASSERT_RC(getdns_dict_set_int(server_dict, GETDNS_STR_PORT, 43210),
ASSERT_RC(getdns_dict_set_int(server_dict, GETDNS_STR_PORT, t_data.port),
GETDNS_RETURN_GOOD, "set addr port");
upstream_list = getdns_list_create_with_context(context);

View File

@ -35,6 +35,8 @@
#include <netinet/in.h>
#include <stdio.h>
#include <sys/param.h>
#include <stdlib.h>
#include <sys/time.h>
#define GETDNS_STR_IPV4 "IPv4"
@ -42,7 +44,23 @@
#define GETDNS_STR_ADDRESS_TYPE "address_type"
#define GETDNS_STR_ADDRESS_DATA "address_data"
#define GETDNS_STR_PORT "port"
#define TEST_PORT 43210
#define TEST_PORT 42100
static uint16_t get_test_port(void)
{
char *test_port_str;
uint16_t test_port;
struct timeval tv;
if (!(test_port_str = getenv("GETDNS_TEST_PORT")) ||
!(test_port = (uint16_t)atoi(test_port_str)))
test_port = TEST_PORT;
(void)gettimeofday(&tv, NULL);
srandom((int)getpid() + (int)tv.tv_usec);
test_port += random() % 1000;
return test_port;
}
/* utilities to start a junk listener */
typedef struct transport_thread_data {
@ -219,7 +237,7 @@ START_TEST(getdns_transport_udp_sync) {
t_data.running = 0;
t_data.udp_count = 0;
t_data.tcp_count = 0;
t_data.port = TEST_PORT;
t_data.port = get_test_port();
pthread_create(&thread, NULL, run_transport_server, (void *) &t_data);
@ -293,7 +311,7 @@ START_TEST(getdns_transport_tcp_sync) {
t_data.running = 0;
t_data.udp_count = 0;
t_data.tcp_count = 0;
t_data.port = TEST_PORT;
t_data.port = get_test_port();
pthread_create(&thread, NULL, run_transport_server, (void *) &t_data);
@ -367,7 +385,7 @@ START_TEST(getdns_transport_udp_async) {
t_data.running = 0;
t_data.udp_count = 0;
t_data.tcp_count = 0;
t_data.port = TEST_PORT;
t_data.port = get_test_port();
pthread_create(&thread, NULL, run_transport_server, (void *) &t_data);
@ -445,7 +463,7 @@ START_TEST(getdns_transport_tcp_async) {
t_data.running = 0;
t_data.udp_count = 0;
t_data.tcp_count = 0;
t_data.port = TEST_PORT;
t_data.port = get_test_port();
pthread_create(&thread, NULL, run_transport_server, (void *) &t_data);

View File

@ -5,6 +5,10 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
rm -f report.txt
(
cd ${SRCROOT}
find . -type f -executable -and \( -name "*.[ch]" -or -name "*.html" -or -name "*.in" -or -name "*.good" -or -name "*.ac" \) | sed 's/^/*** ERROR! Executable bit found on /g'
) >> report.txt
(
cd ${SRCROOT}/src
if [ `grep '[^!=]=[ ][ ]*NET_REQ_' *.[ch] */*.[ch] | wc -l` -gt 1 ]

View File

@ -5,4 +5,4 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build"
make XTRA_CFLAGS='-Werror'
make XTRA_CFLAGS='-Werror' -j 4

View File

@ -5,4 +5,4 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build"
make install
make -j 4 install

View File

@ -5,6 +5,6 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build"
make getdns_query \
make -j 4 getdns_query \
&& echo "export GETDNS_QUERY=\"${BUILDDIR}/build/src/tools/getdns_query\"" \
>> ../.tpkg.var.master

View File

@ -5,4 +5,4 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build"
make install-getdns_query
make -j 4 install-getdns_query

View File

@ -5,4 +5,4 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build-stub-only"
make XTRA_CFLAGS='-Werror'
make XTRA_CFLAGS='-Werror' -j 4

View File

@ -5,6 +5,6 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build-stub-only"
make getdns_query \
make -j 4 getdns_query \
&& echo "export GETDNS_STUB_QUERY=\"${BUILDDIR}/build-stub-only/src/tools/getdns_query\"" \
>> ../.tpkg.var.master

View File

@ -5,4 +5,4 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build-stub-only"
make test
make -j 4 test

View File

@ -3,7 +3,7 @@ Version: 1.0
Description: Test if outstanding queries setting is obeyed
CreationDate: Tue Mar 14 10:43:45 CET 2017
Maintainer: Willem Toorop
Category:
Category: Resource depletion
Component:
CmdDepends:
Depends: 210-stub-only-link.tpkg

View File

@ -3,7 +3,7 @@ Version: 1.0
Description: Test if outstanding queries setting is obeyed
CreationDate: ma 20 mrt 2017 15:17:45 CET
Maintainer: Willem Toorop
Category:
Category: Resource depletion
Component:
CmdDepends:
Depends: 210-stub-only-link.tpkg

View File

@ -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

View File

@ -5,4 +5,4 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build-event-loops"
make XTRA_CFLAGS=-Werror
make XTRA_CFLAGS=-Werror -j 4

View File

@ -5,9 +5,9 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
cd "${BUILDDIR}/build-event-loops"
if make test
if make -j 4 test
then
if grep ERROR "${BUILDDIR}/build-event-loops/src/test/*.log"
if test -e "${BUILDDIR}/build-event-loops/src/test/fails"
then
exit 1
fi

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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 clean
scan-build -o ../scan-build-reports -v --status-bugs make everything
cd "${BUILDDIR}/build-static-analysis"
scan-build -o ../scan-build-reports -v --status-bugs make -j 4 everything

View File

@ -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
)

View File

@ -15,7 +15,7 @@ LCOV_MERGE=""
for TEST_PKG in ${SRCDIR}/*.tpkg
do
# when we run our test, we need to compile with profiling
LDFLAGS="-lgcov --coverage" CFLAGS="-fprofile-arcs -ftest-coverage -O0" "${TPKG}" $* exe "${TEST_PKG}"
LDFLAGS="-lgcov --coverage" CFLAGS="-g -fprofile-arcs -ftest-coverage -O0" "${TPKG}" $* exe "${TEST_PKG}"
# after the test is complete, we need to collect the coverage data
INFO_FILE=`echo $TEST_PKG | sed 's/.tpkg$//'`.info
geninfo $SRCDIR/.. -o $INFO_FILE

55
src/test/tpkg/run-parallel.sh Executable file
View File

@ -0,0 +1,55 @@
#!/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
# Resource depletion tests should be performed one-by-one after all
# other tests have been done.
#
RD_TESTS=""
OTHERS=""
ALL="results:"
for TEST_PKG in `echo ${SRCDIR}/*.tpkg | xargs -n1 echo | sort`
do
P="${TEST_PKG#${SRCDIR}/}"
P="${P%.tpkg}"
R="result.${P}"
ALL="${ALL} ${R}"
if grep -q 'Category:.*Resource depletion' "${TEST_PKG}/${P}.dsc"
then
RD_TESTS="${R} ${RD_TESTS}"
else
OTHERS="${OTHERS} ${R}"
fi
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 P in ${OTHERS}
do
P="${P#result.}"
TEST_PKG="${SRCDIR}/${P}.tpkg"
DEPS="result.${P}:"
for D in `grep "^Depends: " "${TEST_PKG}/${P}.dsc" | sed 's/^Depends: //g'`
do
D="${D%.tpkg}"
DEPS="${DEPS} result.${D}"
done
echo "${DEPS}" >> Makefile
printf '\t"%s" %s exe "%s"\n\n' "${TPKG}" "$*" "${TEST_PKG}" >> Makefile
done
for RD in ${RD_TESTS}
do
RD_TESTS="${RD_TESTS#$RD }"
TEST_PKG="${RD#result.}"
printf '%s: %s %s\n\t"%s" %s exe "%s/%s.tpkg"\n\n' "${RD}" "${OTHERS}" "${RD_TESTS}" "${TPKG}" "$*" "${SRCDIR}" "${TEST_PKG}" >> Makefile
done
make -j 2