From 3eaf7b81fa509723de2054b6e1ae3ee855ca0774 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 19 Dec 2018 18:24:16 -0500 Subject: build system: config-time test framework: added unit-specific test variants. --- sofort/cfgtest.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 4 deletions(-) (limited to 'sofort') diff --git a/sofort/cfgtest.sh b/sofort/cfgtest.sh index 57aca7c..b4e5686 100644 --- a/sofort/cfgtest.sh +++ b/sofort/cfgtest.sh @@ -64,6 +64,8 @@ cfgtest_makevar_append() printf '%-24s%s\n' "$mb_cfgtest_makevar" "$mb_internal_str" \ >> $mb_pwd/cfgdefs.mk + + unset cfgtest_internal_unit_test } @@ -112,7 +114,11 @@ cfgtest_header_presence() | sed -e 's/\./_/g' -e 's@/@_@g' \ | tr "[:lower:]" "[:upper:]") - cfgtest_cflags_append "$mb_internal_str" + if [ -z $cfgtest_internal_unit_test ]; then + cfgtest_cflags_append "$mb_internal_str" + else + cfgtest_makevar_append "$mb_internal_str" + fi } @@ -129,7 +135,11 @@ cfgtest_header_absence() | sed -e 's/\./_/g' -e 's@/@_@g' \ | tr "[:lower:]" "[:upper:]") - cfgtest_cflags_append "$mb_internal_str" + if [ -z $cfgtest_internal_unit_test ]; then + cfgtest_cflags_append "$mb_internal_str" + else + cfgtest_makevar_append "$mb_internal_str" + fi } @@ -152,7 +162,11 @@ cfgtest_interface_presence() | sed -e 's/\./_/g' \ | tr "[:lower:]" "[:upper:]") - cfgtest_cflags_append "$mb_internal_str" + if [ -z $cfgtest_internal_unit_test ]; then + cfgtest_cflags_append "$mb_internal_str" + else + cfgtest_makevar_append "$mb_internal_str" + fi return 0 } @@ -184,7 +198,11 @@ cfgtest_decl_presence() | sed -e 's/\./_/g' \ | tr "[:lower:]" "[:upper:]") - cfgtest_cflags_append "$mb_internal_str" + if [ -z $cfgtest_internal_unit_test ]; then + cfgtest_cflags_append "$mb_internal_str" + else + cfgtest_makevar_append "$mb_internal_str" + fi return 0 } @@ -203,3 +221,35 @@ cfgtest_library_presence() return 0 } + + +cfgtest_unit_header_presence() +{ + cfgtest_internal_unit_test='unit_test' + cfgtest_header_presence "$@" || return 1 + return 0 +} + + +cfgtest_unit_header_absence() +{ + cfgtest_internal_unit_test='unit_test' + cfgtest_header_absence "$@" || return 1 + return 0 +} + + +cfgtest_unit_interface_presence() +{ + cfgtest_internal_unit_test='unit_test' + cfgtest_interface_presence "$@" || return 1 + return 0 +} + + +cfgtest_unit_decl_presence() +{ + cfgtest_internal_unit_test='unit_test' + cfgtest_decl_presence "$@" || return 1 + return 0 +} -- cgit v1.2.3