tpkg to warn if consts and symbols are out of sync

This commit is contained in:
Willem Toorop 2015-12-16 15:48:09 +01:00
parent 46ad6a82ed
commit 71d8a50519
11 changed files with 95 additions and 2 deletions

View File

@ -22,6 +22,7 @@ static struct const_info consts_info[] = {
{ 309, "GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED", GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED_TEXT },
{ 310, "GETDNS_RETURN_MEMORY_ERROR", GETDNS_RETURN_MEMORY_ERROR_TEXT },
{ 311, "GETDNS_RETURN_INVALID_PARAMETER", GETDNS_RETURN_INVALID_PARAMETER_TEXT },
{ 312, "GETDNS_RETURN_NOT_IMPLEMENTED", GETDNS_RETURN_NOT_IMPLEMENTED_TEXT },
{ 400, "GETDNS_DNSSEC_SECURE", GETDNS_DNSSEC_SECURE_TEXT },
{ 401, "GETDNS_DNSSEC_BOGUS", GETDNS_DNSSEC_BOGUS_TEXT },
{ 402, "GETDNS_DNSSEC_INDETERMINATE", GETDNS_DNSSEC_INDETERMINATE_TEXT },
@ -66,6 +67,8 @@ static struct const_info consts_info[] = {
{ 616, "GETDNS_CONTEXT_CODE_TIMEOUT", GETDNS_CONTEXT_CODE_TIMEOUT_TEXT },
{ 617, "GETDNS_CONTEXT_CODE_IDLE_TIMEOUT", GETDNS_CONTEXT_CODE_IDLE_TIMEOUT_TEXT },
{ 618, "GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION", GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION_TEXT },
{ 619, "GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE", GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE_TEXT },
{ 620, "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE_TEXT },
{ 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT },
{ 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT },
{ 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT },

View File

@ -13,7 +13,6 @@ getdns_context_get_dnssec_allowed_skew
getdns_context_get_dnssec_trust_anchors
getdns_context_get_dns_transport
getdns_context_get_dns_transport_list
getdns_context_get_tls_authentication
getdns_context_get_edns_client_subnet_private
getdns_context_get_edns_do_bit
getdns_context_get_edns_extended_rcode
@ -27,6 +26,7 @@ getdns_context_get_num_pending_requests
getdns_context_get_resolution_type
getdns_context_get_suffix
getdns_context_get_timeout
getdns_context_get_tls_authentication
getdns_context_get_tls_query_padding_blocksize
getdns_context_get_update_callback
getdns_context_get_upstream_recursive_servers

View File

@ -7,7 +7,7 @@ write_symbols() {
| sed -e 's/(.*$//g' -e 's/^.*getdns_/getdns_/g' | sort | uniq > $OUTPUT
}
write_symbols libgetdns.symbols getdns/getdns.h.in getdns/getdns_extra.h
write_symbols libgetdns.symbols getdns/getdns.h.in getdns/getdns_extra.h.in
echo plain_mem_funcs_user_arg >> libgetdns.symbols
echo priv_getdns_context_mf >> libgetdns.symbols
write_symbols extension/libevent.symbols getdns/getdns_ext_libevent.h

View File

@ -0,0 +1,16 @@
BaseName: 050-constants
Version: 1.0
Description: Check if all constants are in const-info.c
CreationDate: wo dec 16 14:26:01 CET 2015
Maintainer: Willem Toorop
Category:
Component:
CmdDepends:
Depends:
Help: 050-constants.help
Pre: 050-constants.pre
Post:
Test: 050-constants.test
AuxFiles:
Passed:
Failure:

View File

@ -0,0 +1 @@
Are all constants in const-info.c

View File

@ -0,0 +1,14 @@
# #-- 050-constants.pre--#
# source the master var file when it's there
if [ -f ../.tpkg.var.master ]
then
source ../.tpkg.var.master
else
(
cd ..
[ -f "${TPKG_SRCDIR}/setup-env.sh" ] \
&& sh "${TPKG_SRCDIR}/setup-env.sh"
) && source ../.tpkg.var.master
fi
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test

View File

@ -0,0 +1,14 @@
# #-- 050-constants.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
cp -p ${SRCROOT}/src/const-info.c const-info.c.orig
(
cd ${SRCROOT}/src
sh mk-const-info.c.sh
)
cp -p ${SRCROOT}/src/const-info.c const-info.c.new
cp -p const-info.c.orig ${SRCROOT}/src/const-info.c
diff const-info.c.orig const-info.c.new

View File

@ -0,0 +1,16 @@
BaseName: 060-symbols
Version: 1.0
Description: Check if all constants are in const-info.c
CreationDate: wo dec 16 15:41:23 CET 2015
Maintainer: Willem Toorop
Category:
Component:
CmdDepends:
Depends:
Help: 060-symbols.help
Pre: 060-symbols.pre
Post:
Test: 060-symbols.test
AuxFiles:
Passed:
Failure:

View File

@ -0,0 +1 @@
Are all constants in const-info.c

View File

@ -0,0 +1,14 @@
# #-- 060-symbols.pre--#
# source the master var file when it's there
if [ -f ../.tpkg.var.master ]
then
source ../.tpkg.var.master
else
(
cd ..
[ -f "${TPKG_SRCDIR}/setup-env.sh" ] \
&& sh "${TPKG_SRCDIR}/setup-env.sh"
) && source ../.tpkg.var.master
fi
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test

View File

@ -0,0 +1,14 @@
# #-- 060-symbols.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
cp -p ${SRCROOT}/src/libgetdns.symbols libgetdns.symbols.orig
(
cd ${SRCROOT}/src
sh mk-symfiles.sh
)
cp -p ${SRCROOT}/src/libgetdns.symbols libgetdns.symbols.new
cp -p libgetdns.symbols.orig ${SRCROOT}/src/libgetdns.symbols
diff libgetdns.symbols.orig libgetdns.symbols.new