diff --git a/src/test/Makefile.in b/src/test/Makefile.in index f05cee3a..c6d76aa2 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -73,11 +73,11 @@ CHECK_OBJS=check_getdns_common.lo check_getdns_context_set_timeout.lo \ ALL_OBJS=$(CHECK_OBJS) check_getdns_libevent.lo check_getdns_libev.lo \ check_getdns_selectloop.lo getdns_query.lo scratchpad.lo \ testmessages.lo tests_dict.lo tests_list.lo tests_namespaces.lo \ - tests_stub_async.lo tests_stub_sync.lo tests_json-pointers.lo + tests_stub_async.lo tests_stub_sync.lo NON_C99_OBJS=check_getdns_libuv.lo -PROGRAMS=tests_dict tests_list tests_namespaces tests_stub_async tests_stub_sync tests_json-pointers getdns_query $(CHECK_GETDNS) $(CHECK_EV_PROG) $(CHECK_EVENT_PROG) $(CHECK_UV_PROG) +PROGRAMS=tests_dict tests_list tests_namespaces tests_stub_async tests_stub_sync getdns_query $(CHECK_GETDNS) $(CHECK_EV_PROG) $(CHECK_EVENT_PROG) $(CHECK_UV_PROG) .SUFFIXES: .c .o .a .lo .h @@ -113,9 +113,6 @@ tests_stub_async: tests_stub_async.lo testmessages.lo tests_stub_sync: tests_stub_sync.lo $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ tests_stub_sync.lo -tests_json-pointers: tests_json-pointers.lo - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ tests_json-pointers.lo - check_getdns_common: check_getdns_common.lo $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ check_getdns_common.lo @@ -281,8 +278,6 @@ scratchpad.template.lo scratchpad.template.o: scratchpad.template.c ../getdns/ge ../getdns/getdns_extra.h testmessages.lo testmessages.o: $(srcdir)/testmessages.c $(srcdir)/testmessages.h tests_dict.lo tests_dict.o: $(srcdir)/tests_dict.c $(srcdir)/testmessages.h ../getdns/getdns.h -tests_json-pointers.lo tests_json-pointers.o: $(srcdir)/tests_json-pointers.c ../getdns/getdns.h \ - ../getdns/getdns_extra.h tests_list.lo tests_list.o: $(srcdir)/tests_list.c $(srcdir)/testmessages.h ../getdns/getdns.h tests_namespaces.lo tests_namespaces.o: $(srcdir)/tests_namespaces.c $(srcdir)/testmessages.h ../getdns/getdns.h tests_stub_async.lo tests_stub_async.o: $(srcdir)/tests_stub_async.c ../config.h $(srcdir)/testmessages.h \ diff --git a/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.Makefile b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.Makefile new file mode 100644 index 00000000..fe7d1f28 --- /dev/null +++ b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.Makefile @@ -0,0 +1,15 @@ +builddir = @BUILDDIR@ +testname = @TPKG_NAME@ +LIBTOOL = $(builddir)/libtool + +CFLAGS=-I$(builddir)/src/getdns +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/tests_json-pointers.c b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.c similarity index 100% rename from src/test/tests_json-pointers.c rename to src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.c diff --git a/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.dsc b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.dsc new file mode 100644 index 00000000..0b3ab66a --- /dev/null +++ b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.dsc @@ -0,0 +1,16 @@ +BaseName: 250-json-pointers +Version: 1.0 +Description: Test json pointers +CreationDate: vr dec 11 11:09:57 CET 2015 +Maintainer: Willem Toorop +Category: +Component: +CmdDepends: +Depends: 200-stub-only-compile.tpkg +Help: 250-json-pointers.help +Pre: 250-json-pointers.pre +Post: +Test: 250-json-pointers.test +AuxFiles: +Passed: +Failure: diff --git a/src/test/tests_json-pointers.good b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.good similarity index 100% rename from src/test/tests_json-pointers.good rename to src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.good diff --git a/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.help b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.help new file mode 100644 index 00000000..d9deefa2 --- /dev/null +++ b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.help @@ -0,0 +1,2 @@ +Compile a program that setups a dict with json pointers and pretty prints the dict. +Then compare the output to the known to be good output. diff --git a/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.pre b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.pre new file mode 100644 index 00000000..55d1c0d0 --- /dev/null +++ b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.pre @@ -0,0 +1,14 @@ +# #-- 250-json-pointers.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/250-json-pointers.tpkg/250-json-pointers.test b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.test new file mode 100644 index 00000000..dca4965d --- /dev/null +++ b/src/test/tpkg/250-json-pointers.tpkg/250-json-pointers.test @@ -0,0 +1,7 @@ +# #-- 250-json-pointers.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" diff --git a/src/test/tpkg/tpkg b/src/test/tpkg/tpkg index 7bab54a1..1117a012 100755 --- a/src/test/tpkg/tpkg +++ b/src/test/tpkg/tpkg @@ -495,6 +495,7 @@ fi testname=`basename "${archive}" .tpkg` export TPKG_SRCDIR=`dirname "${archive}"` +export TPKG_NAME=${testname} test_pkg="${TPKG_SRCDIR}/${testname}.tpkg" dsc_file=$testname.dsc if [ -z $testname ]; then