Compile and test succeeds on OpenBSD

This commit is contained in:
W.C.A. Wijngaards 2013-11-30 11:25:50 +01:00
parent 48b54c3579
commit f217ab674e
3 changed files with 8 additions and 6 deletions

View File

@ -70,6 +70,8 @@ $(distdir):
cp $(srcdir)/src/getdns/*.h $(distdir)/src/getdns
cp $(srcdir)/src/test/Makefile.in $(distdir)/src/test
cp $(srcdir)/src/test/*.[ch] $(distdir)/src/test
cp $(srcdir)/src/test/*.sh $(distdir)/src/test
cp $(srcdir)/src/test/*.good $(distdir)/src/test
cp $(srcdir)/src/test/*.can $(distdir)/src/test
cp $(srcdir)/src/example/Makefile.in $(distdir)/src/example
cp $(srcdir)/src/example/*.c $(distdir)/src/example

View File

@ -29,7 +29,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
CC=gcc
CFLAGS=@CFLAGS@ -Wall -g -fPIC -I$(srcdir)/ -I/usr/local/include -std=c99
CFLAGS=@CFLAGS@ -Wall -fPIC -I$(srcdir)/ -I/usr/local/include -std=c99
LDFLAGS=@LDFLAGS@ -levent_core -lldns -lunbound -lidn
GETDNS_OBJ=sync.lo context.lo list.lo dict.lo convert.lo general.lo \
hostname.lo service.lo request-internal.lo validate_dnssec.lo \

View File

@ -1,7 +1,7 @@
#!/bin/sh
# run $1 > $2 and exit on failure to execute
function runit () {
function runit {
echo -n "Test $1:"
./$1 > $2
if test $? -ne 0; then
@ -11,7 +11,7 @@ function runit () {
}
# check output files $1 and $2, exit on failure
function diffit () {
function diffit {
if diff $1 $2; then
echo " OK"
else
@ -21,20 +21,20 @@ function diffit () {
}
# check output of program $1, known_good must be in $1.good
function checkoutput () {
function checkoutput {
runit $1 output
diffit output $1.good
}
# filter out TTL and bindata stuff from $1 to $2
function filterout() {
function filterout {
sed -e '/"ttl"/d' -e '/"ipv4_address"/d' -e '/"ipv6_address"/d' -e '/"rdata_raw"/d' -e '/<bindata/d' <$1 >$2
}
# like checkoutput but removes addresses and TTLs and bindata
# this makes the test almost useless, but it tests runtime lookup
# and the structure of the answer format, against the live internet.
function checkpacket () {
function checkpacket {
runit $1 output
cp $1.good output.good
filterout output output2