Skip to content

Commit 194cd05

Browse files
committed
Debug messages for tests
1. Set an automake conditional if debugging is enabled. 2. If BUILD_DEBUG is set then add -DDEBUG_WOLFSSH to CPPFLAGS for all test targets.
1 parent 0b451e5 commit 194cd05

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ AM_CONDITIONAL([BUILD_SSHCLIENT],[test "x$ENABLED_SSHCLIENT" = "xyes"])
300300
AM_CONDITIONAL([BUILD_CERTS],[test "x$ENABLED_CERTS" = "xyes"])
301301
AM_CONDITIONAL([BUILD_TPM],[test "x$ENABLED_TPM" = "xyes"])
302302
AM_CONDITIONAL([BUILD_KEYBOARD_INTERACTIVE],[test "x$ENABLED_KEYBOARD_INTERACTIVE" = "xyes"])
303+
AM_CONDITIONAL([BUILD_DEBUG],[test "x$ax_enable_debug" = "xyes"])
303304

304305
AX_HARDEN_CC_COMPILER_FLAGS
305306

tests/include.am

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ endif
3434
if BUILD_KEYBOARD_INTERACTIVE
3535
tests_unit_test_CPPFLAGS += -DWOLFSSH_KEYBOARD_INTERACTIVE
3636
endif
37+
if BUILD_DEBUG
38+
tests_unit_test_CPPFLAGS += -DDEBUG_WOLFSSH
39+
endif
3740
tests_unit_test_LDADD = src/libwolfssh.la
3841
tests_unit_test_DEPENDENCIES = src/libwolfssh.la
3942

@@ -67,6 +70,9 @@ endif
6770
if BUILD_KEYBOARD_INTERACTIVE
6871
tests_api_test_CPPFLAGS += -DWOLFSSH_KEYBOARD_INTERACTIVE
6972
endif
73+
if BUILD_DEBUG
74+
tests_api_test_CPPFLAGS += -DDEBUG_WOLFSSH
75+
endif
7076
tests_api_test_LDADD = src/libwolfssh.la
7177
tests_api_test_DEPENDENCIES = src/libwolfssh.la
7278

@@ -105,6 +111,9 @@ endif
105111
if BUILD_KEYBOARD_INTERACTIVE
106112
tests_testsuite_test_CPPFLAGS += -DWOLFSSH_KEYBOARD_INTERACTIVE
107113
endif
114+
if BUILD_DEBUG
115+
tests_testsuite_test_CPPFLAGS += -DDEBUG_WOLFSSH
116+
endif
108117
tests_testsuite_test_LDADD = src/libwolfssh.la
109118
tests_testsuite_test_DEPENDENCIES = src/libwolfssh.la
110119

@@ -136,6 +145,9 @@ endif
136145
if BUILD_CERTS
137146
tests_auth_test_CPPFLAGS += -DWOLFSSH_CERTS
138147
endif
148+
if BUILD_DEBUG
149+
tests_auth_test_CPPFLAGS += -DDEBUG_WOLFSSH
150+
endif
139151
tests_auth_test_LDADD = src/libwolfssh.la
140152
tests_auth_test_DEPENDENCIES = src/libwolfssh.la
141153
endif
@@ -173,5 +185,8 @@ endif
173185
if BUILD_KEYBOARD_INTERACTIVE
174186
tests_kex_test_CPPFLAGS += -DWOLFSSH_KEYBOARD_INTERACTIVE
175187
endif
188+
if BUILD_CERTS
189+
tests_kex_test_CPPFLAGS += -DDEBUG_WOLFSSH
190+
endif
176191
tests_kex_test_LDADD = src/libwolfssh.la
177192
tests_kex_test_DEPENDENCIES = src/libwolfssh.la

0 commit comments

Comments
 (0)