Start work on remaining tests

This commit is contained in:
Sara Dickinson 2019-11-14 14:40:24 +00:00
parent 1cca550799
commit d59380fca0
11 changed files with 31 additions and 38 deletions

View File

@ -21,7 +21,7 @@ localhost.
-X
EOT
(
if ! "${BUILDDIR}/build/libtool" exec valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "${GETDNS_QUERY}" -F queries -f "${TPKG_NAME}.ds" +dnssec_return_validation_chain
if ! valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "${GETDNS_QUERY}" -F queries -f "${TPKG_NAME}.ds" +dnssec_return_validation_chain
then
exit 1
fi

View File

@ -5,5 +5,5 @@ add_executable(@TPKG_NAME@ @TPKG_NAME@.c)
target_include_directories(@TPKG_NAME@ PRIVATE @BUILDDIR@)
add_library(libgetdns SHARED IMPORTED )
set_target_properties(libgetdns PROPERTIES IMPORTED_LOCATION @BUILDDIR@/libgetdns.dylib )
set_target_properties(libgetdns PROPERTIES IMPORTED_LOCATION @BUILDDIR@/libgetdns.so )
target_link_libraries(@TPKG_NAME@ libgetdns)

View File

@ -9,3 +9,7 @@
sed -e "s/@BUILDDIR@/${BUILDDIR4SED}/g" \
-e "s/@TPKG_NAME@/${TPKG_NAME}/g" "${TPKG_NAME}.cmake"
) > CMakeLists.txt
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' -e "s/libgetdns.so/libgetdns.dylib/g" CMakeLists.txt
fi

View File

@ -9,7 +9,7 @@ LOCALHOST=`${GETDNS_STUB_QUERY} '{namespaces:[GETDNS_NAMESPACE_LOCALNAMES]}' -A
| sed -e 's/^[^"]*"//g' -e 's/"[^"]*$//g'`
echo "localhost: $LOCALHOST"
cmake . && make && "${BUILDDIR}/build-stub-only/libtool" exec valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST} | (
cmake . && make && valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST} | (
read PORT
read PORT2

View File

@ -1,15 +0,0 @@
builddir = @BUILDDIR@
testname = @TPKG_NAME@
LIBTOOL = $(builddir)/libtool
CFLAGS=-Wall -Wextra -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 $(testname) $(testname).lo

View File

@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.5)
project (@TPKG_NAME@)
add_executable(@TPKG_NAME@ @TPKG_NAME@.c)
target_include_directories(@TPKG_NAME@ PRIVATE @BUILDDIR@)
add_library(libgetdns SHARED IMPORTED )
set_target_properties(libgetdns PROPERTIES IMPORTED_LOCATION @BUILDDIR@/libgetdns.so )
target_link_libraries(@TPKG_NAME@ libgetdns)

View File

@ -5,10 +5,11 @@
[ -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
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' -e "s/libgetdns.so/libgetdns.dylib/g" CMakeLists.txt
fi

View File

@ -19,7 +19,7 @@ echo "# queries: $NQUERIES"
# which is smaller than 5 seconds default query timeout value,
# so the test should succeed.
make && "${BUILDDIR}/build-stub-only/libtool" exec valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST} | (
cmake . && make && valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST} | (
read PORT
${GETDNS_STUB_QUERY} -s @${LOCALHOST}:$PORT TXT \
-a -F "./${TPKG_NAME}.queries" \

View File

@ -1,15 +0,0 @@
builddir = @BUILDDIR@
testname = @TPKG_NAME@
LIBTOOL = $(builddir)/libtool
CFLAGS=-Wall -Wextra -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 $(testname) $(testname).lo

View File

@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.5)
project (@TPKG_NAME@)
add_executable(@TPKG_NAME@ @TPKG_NAME@.c)
target_include_directories(@TPKG_NAME@ PRIVATE @BUILDDIR@)
add_library(libgetdns SHARED IMPORTED )
set_target_properties(libgetdns PROPERTIES IMPORTED_LOCATION @BUILDDIR@/libgetdns.so )
target_link_libraries(@TPKG_NAME@ libgetdns)

View File

@ -27,7 +27,7 @@ echo "# queries: $NQUERIES"
# which is smaller than 5 seconds default query timeout value,
# so the test should succeed.
make && "${BUILDDIR}/build-stub-only/libtool" exec valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST}| (
cmake . && make && valgrind -v --log-file=valgrind.log --leak-check=full --error-exitcode=1 --track-origins=yes "./${TPKG_NAME}" ${LOCALHOST}| (
read PORT
ulimit -n $QLIMIT
${GETDNS_STUB_QUERY} -s @${LOCALHOST}:$PORT TXT \