@if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$Q$(COMPILE) -c $< -o $@
-.PHONY: clean realclean doc lint all install uninstall
+.PHONY: clean realclean doc lint all install uninstall tests test
-all: $(COMMON_OBJ) unbound unittest testbound lock-verify pktview signit memstats
+all: $(COMMON_OBJ) unbound
+
+tests: unittest testbound lock-verify pktview signit memstats
+
+test: tests
+ bash testcode/do-tests.sh
unbound: $(DAEMON_OBJ)
$(INFO) Link $@
linked list cleanup list. unit test on this. do not call region
to avoid name-collision with nsd regions, 'regional'.
* read root hints from file.
+* failover to next server in 1 second, instead of 100 seconds on one server.
* failure to return answer, w. reason (donotq, noanswer servers, cannot
find servers, validationfail w.classification, error),
with threadno, starttime and endtime and qname/type/class, prime/qflags,
NEED_SPLINT='00-lint.tpkg'
NEED_DOXYGEN='01-doc.tpkg'
+NEED_LDNS_TESTNS='fwd_no_edns.tpkg fwd_tcp_tc.tpkg fwd_tcp.tpkg fwd_three_service.tpkg fwd_three.tpkg fwd_ttlexpire.tpkg fwd_udp.tpkg'
cd testdata;
+sh ../testcode/mini_tpkg.sh clean
for test in `ls *.tpkg`; do
SKIP=0
if echo $NEED_SPLINT | grep $test >/dev/null; then
SKIP=1;
fi
fi
+ if echo $NEED_LDNS_TESTNS | grep $test >/dev/null; then
+ if test ! -x "`which ldns-testns`"; then
+ SKIP=1;
+ fi
+ fi
if test $SKIP -eq 0; then
echo $test
- tpkg -a ../.. exe $test
+ sh ../testcode/mini_tpkg.sh -a ../.. exe $test
else
echo "skip $test"
fi
done
+sh ../testcode/mini_tpkg.sh report
--- /dev/null
+# tpkg that only exes the files.
+args="../.."
+if test "$1" = "-a"; then
+ args=$2
+ shift
+ shift
+fi
+
+if test "$1" = "clean"; then
+ echo "rm -f result.* .done* .tpkg.var.master .tpkg.var.test"
+ rm -f result.* .done* .tpkg.var.master .tpkg.var.test
+ exit 0
+fi
+if test "$1" = "fake"; then
+ echo "minitpkg fake $2"
+ echo "fake" > .done-`basename $2 .tpkg`
+ exit 0
+fi
+if test "$1" = "report" || test "$2" = "report"; then
+ echo "Minitpkg Report"
+ for result in result.*; do
+ name=`echo $result | sed -e 's/result\.//'`
+ if test -f ".done-$name"; then
+ if test "$1" != "-q"; then
+ echo "** PASSED ** : $name"
+ fi
+ else
+ echo "!! FAILED !! : $name"
+ fi
+ done
+ exit 0
+fi
+
+if test "$1" != 'exe'; then
+ # usage
+ echo "mini tpkg. Reduced functionality for old shells."
+ echo " tpkg exe <file>"
+ echo " tpkg fake <file>"
+ echo " tpkg clean"
+ echo " tpkg [-q] report"
+ exit 1
+fi
+shift
+
+# do not execute if the disk is too full
+DISKLIMIT=100000
+avail=`df . | tail -1 | awk '{print $4}'`
+if test "$avail" -lt "$DISKLIMIT"; then
+ echo "minitpkg: The disk is too full! Only $avail."
+ exit 1
+fi
+
+name=`basename $1 .tpkg`
+dir=$name.$$
+result=result.$name
+done=.done-$name
+success="no"
+shell="bash"
+
+# check already done
+if test -f .done-$name; then
+ echo "minitpkg .done-$name exists. skip test."
+ exit 0
+fi
+
+# Extract
+echo "minitpkg extract $1 to $dir"
+mkdir $dir
+gzip -cd $name.tpkg | (cd $dir; tar xf -)
+cd $dir
+mv $name.dir/* .
+
+# EXE
+echo "minitpkg exe $name"
+echo "minitpkg exe $name" > $result
+if test -f $name.pre; then
+ echo "minitpkg exe $name.pre"
+ echo "minitpkg exe $name.pre" >> $result
+ $shell $name.pre $args >> $result
+ if test $? -ne 0; then
+ echo "Warning: $name.pre did not exit successfully"
+ fi
+fi
+if test -f $name.test; then
+ echo "minitpkg exe $name.test"
+ echo "minitpkg exe $name.test" >> $result
+ $shell $name.test $args >>$result 2>&1
+ if test $? -ne 0; then
+ echo "$name: FAILED" >> $result
+ echo "$name: FAILED"
+ success="no"
+ else
+ echo "$name: PASSED" >> $result
+ echo "$name: PASSED" > ../.done-$name
+ echo "$name: PASSED"
+ success="yes"
+ fi
+fi
+if test -f $name.post; then
+ echo "minitpkg exe $name.post"
+ echo "minitpkg exe $name.post" >> $result
+ $shell $name.post $args >> $result
+ if test $? -ne 0; then
+ echo "Warning: $name.post did not exit successfully"
+ fi
+fi
+
+mv $result ..
+cd ..
+rm -rf $dir