From 6e0d8de885a98323c0f8cfc60a40b95c57b877c0 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 28 Apr 2016 14:28:22 +0200 Subject: [PATCH] tpkg for the header extension --- .../270-header-extension.Makefile | 15 +++++++++ .../270-header-extension.c} | 0 .../270-header-extension.dsc | 16 ++++++++++ .../270-header-extension.good | 32 +++++++++++++++++++ .../270-header-extension.pre | 14 ++++++++ .../270-header-extension.test | 7 ++++ 6 files changed, 84 insertions(+) create mode 100644 src/test/tpkg/270-header-extension.tpkg/270-header-extension.Makefile rename src/test/{scratchpad.c => tpkg/270-header-extension.tpkg/270-header-extension.c} (100%) create mode 100644 src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc create mode 100644 src/test/tpkg/270-header-extension.tpkg/270-header-extension.good create mode 100644 src/test/tpkg/270-header-extension.tpkg/270-header-extension.pre create mode 100644 src/test/tpkg/270-header-extension.tpkg/270-header-extension.test diff --git a/src/test/tpkg/270-header-extension.tpkg/270-header-extension.Makefile b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.Makefile new file mode 100644 index 00000000..708341a1 --- /dev/null +++ b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.Makefile @@ -0,0 +1,15 @@ +builddir = @BUILDDIR@ +testname = @TPKG_NAME@ +LIBTOOL = $(builddir)/libtool + +CFLAGS=-I$(builddir)/src +LDLIBS=$(builddir)/src/libgetdns.la + +.SUFFIXES: .c .o .a .lo .h + +.c.lo: + $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@ + +$(testname): $(testname).lo + $(LIBTOOL) --tag=CC --mode=link $(CC) $(LDLIBS) $(LDFLAGS) -o $@ $< + diff --git a/src/test/scratchpad.c b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.c similarity index 100% rename from src/test/scratchpad.c rename to src/test/tpkg/270-header-extension.tpkg/270-header-extension.c diff --git a/src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc new file mode 100644 index 00000000..2ac9ae37 --- /dev/null +++ b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.dsc @@ -0,0 +1,16 @@ +BaseName: 270-header-extension +Version: 1.0 +Description: Test json pointers +CreationDate: do 28 apr 2016 13:48:05 CEST +Maintainer: Willem Toorop +Category: +Component: +CmdDepends: +Depends: 200-stub-only-compile.tpkg +Help: +Pre: 270-header-extension.pre +Post: +Test: 270-header-extension.test +AuxFiles: +Passed: +Failure: diff --git a/src/test/tpkg/270-header-extension.tpkg/270-header-extension.good b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.good new file mode 100644 index 00000000..2419d76b --- /dev/null +++ b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.good @@ -0,0 +1,32 @@ +{ + "answer_type": GETDNS_NAMETYPE_DNS, + "canonical_name": , + "replies_tree": + [ + { + "additional": [], + "answer": [], + "answer_type": GETDNS_NAMETYPE_DNS, + "authority": [], + "canonical_name": , + "header": + { + "aa": 0, + "ad": 0, + "ancount": 0, + "arcount": 0, + "cd": 0, + "nscount": 0, + "opcode": GETDNS_OPCODE_STATUS, + "qdcount": 0, + "qr": 1, + "ra": 0, + "rcode": GETDNS_RCODE_NOTIMP, + "rd": 0, + "tc": 0, + "z": 0 + } + } + ], + "status": GETDNS_RESPSTATUS_NO_NAME +} diff --git a/src/test/tpkg/270-header-extension.tpkg/270-header-extension.pre b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.pre new file mode 100644 index 00000000..f6db2030 --- /dev/null +++ b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.pre @@ -0,0 +1,14 @@ +# #-- 270-header-extension.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 + +( + grep '^CC=' "${BUILDDIR}/build-stub-only/src/Makefile" + grep '^LDFLAGS=' "${BUILDDIR}/build-stub-only/src/Makefile" + + BUILDDIR4SED=`echo "${BUILDDIR}/build-stub-only" | sed 's/\//\\\\\//g'` + sed -e "s/@BUILDDIR@/${BUILDDIR4SED}/g" \ + -e "s/@TPKG_NAME@/${TPKG_NAME}/g" "${TPKG_NAME}.Makefile" +) > Makefile diff --git a/src/test/tpkg/270-header-extension.tpkg/270-header-extension.test b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.test new file mode 100644 index 00000000..b9f372ac --- /dev/null +++ b/src/test/tpkg/270-header-extension.tpkg/270-header-extension.test @@ -0,0 +1,7 @@ +# #-- 270-header-extension.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 + +make && "./${TPKG_NAME}" | tee out && diff out "${TPKG_NAME}.good"