feature-test@EXEEXT@: feature-test.@O@
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS}
-# Running the scripts below is bypassed when a separate
-# build directory is used.
+
+# Running the scripts below is bypassed when a separate build directory is
+# used.
+
+# Define the tests that can be run in parallel. This should be identical to
+# the definition of PARALLELDIRS in conf.sh.
+
+PARALLEL = allow_query rpzrecurse
+
+# Produce intermediate makefile that assigns unique port numbers to each
+# parallel test. The start port number of 5,000 is arbitrary - it must just
+# be greater than the highest privileged port, 1024.
+#
+# Test names need to be sanitized because Solaris make does not like
+# underscores in target names and requires explicit differentiation
+# between a target name and a directory name (.PHONY is not supported).
+
+parallel.mk:
+ @PARALLEL_SANITIZED=`echo $(PARALLEL) | sed "s|\([^ ][^ ]*\)|test-\1|g;" | tr _ -` ; \
+ echo ".PHONY: $$PARALLEL_SANITIZED" > $@ ; \
+ echo "" >> $@ ; \
+ echo "check: $$PARALLEL_SANITIZED" >> $@ ; \
+ port=$${STARTPORT:-5000} ; \
+ for directory in $(PARALLEL) ; do \
+ echo "" >> $@ ; \
+ echo "test-`echo $$directory | tr _ -`:" >> $@ ; \
+ echo " @$(SHELL) ./run.sh $$NOCLEAN -r -p $$port $$directory 2>&1 | tee $$directory/test.output" >> $@ ; \
+ port=`expr $$port + 100` ; \
+ done
+
+# Targets to run the tests.
+
+test: parallel.mk subdirs
+ @$(MAKE) -f parallel.mk check
+ @$(SHELL) ./runsequential.sh $$NOCLEAN -r
+ @$(SHELL) ./testsummary.sh
- check: test
+ # Define the tests that can be run in parallel. This should be identical to
+ # the definition of PARALLELDIRS in conf.sh. Note: long-running tests
+ # such as allow_query and serve-stale are scheduled first to get more
+ # benefit from parallelism.
+
+ PARALLEL = allow_query acl additional addzone autosign \
+ builtin cacheclean chain checkconf checknames \
+ checkzone @CHECKDS@ @COVERAGE@ database \
+ digdelv dlv dlz dlzexternal dns64 dnssec \
+ emptyzones fetchlimit filter-aaaa \
+ formerr forward glue inline integrity ixfr \
+ legacy limits logfileconfig masterfile masterformat \
+ metadata notify nslookup nsupdate pending reclimit \
+ redirect resolver rndc rpz rrl \
+ rrsetorder rsabigexponent runtime smartsign sortlist \
+ spf staticstub stub \
+ tsig tsiggss unknown upforwd verify views wildcard \
+ xfer xferquota zero zonechecks
- # Other targets:
+ # Produce intermediate makefile that assigns unique port numbers to each
+ # parallel test. The start port number of 5,000 is arbitrary - it must just
+ # be greater than the highest privileged port, 1024.
#
- # testclean - delete files generated by running tests.
- # clean - testclean + also delete files built for the tests by "make".
- # distclean - clean + also delete test-related files generated by "configure".
+ # Test names need to be sanitized because Solaris make does not like
+ # underscores in target names and requires explicit differentiation
+ # between a target name and a directory name (.PHONY is not supported).
+
+ .PHONY: parallel.mk
+
+ parallel.mk:
+ @PARALLEL_SANITIZED=`echo $(PARALLEL) | sed "s|\([^ ][^ ]*\)|test-\1|g;" | tr _ -` ; \
+ echo ".PHONY: $$PARALLEL_SANITIZED" > $@ ; \
+ echo "" >> $@ ; \
+ echo "test check: $$PARALLEL_SANITIZED" >> $@ ; \
+ port=$${STARTPORT:-5000} ; \
+ for directory in $(PARALLEL) ; do \
+ echo "" >> $@ ; \
+ echo "test-`echo $$directory | tr _ -`:" >> $@ ; \
+ echo " @$(SHELL) ./run.sh $$NOCLEAN -r -p $$port $$directory 2>&1 | tee $$directory/test.output" >> $@ ; \
+ port=`expr $$port + 100` ; \
+ done
+
+ # Targets to run the tests.
+
+ test: parallel.mk subdirs
+ @$(MAKE) -f parallel.mk check
+ @$(SHELL) ./runsequential.sh $$NOCLEAN -r
+ @$(SHELL) ./testsummary.sh
+
+ check: test
testclean clean distclean::
- if test -f ./cleanall.sh; then sh ./cleanall.sh; fi
+ if test -f ./cleanall.sh; then $(SHELL) ./cleanall.sh; fi
rm -f systests.output
rm -f random.data
+ rm -f parallel.mk
+
+clean distclean::
rm -f ${TARGETS}
rm -f ${OBJS}