From a26d15647a35ed23cb403dc6b6cd15f57e63535f Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Tue, 27 Aug 2024 19:41:57 +0200 Subject: [PATCH] Fix symbol checking test The test that checks for prefixed binary symbols was broken when compiled with DebWithRelInfo since it was checking debugging symbols that broke the heuristics used. The commit fixes it doing a couple of actions: - Include the length of the namespace sdf: 3sdf - Check only dynamic symbols being exported Signed-off-by: Jose Luis Rivero --- test/integration/all_symbols_have_version.bash.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/integration/all_symbols_have_version.bash.in b/test/integration/all_symbols_have_version.bash.in index d69a58442..9e248e477 100644 --- a/test/integration/all_symbols_have_version.bash.in +++ b/test/integration/all_symbols_have_version.bash.in @@ -4,7 +4,13 @@ LIBPATH=$1 VERSIONED_NS=v@PROJECT_VERSION_MAJOR@ # Sanity check - there should be at least one symbol -NUM_SYMBOLS=$(nm $LIBPATH | grep -e "sdf" | wc -l) + +# nm options: +# -D to get only dynamic symbols exported +# 3 before the sdf is used by +# mangled symbols in C++ to check for the +# sdf namespace +NUM_SYMBOLS=$(nm -D $LIBPATH | grep -e "3sdf" | wc -l) if [ $NUM_SYMBOLS -eq 0 ] then @@ -13,7 +19,7 @@ then fi # There must be no unversioned symbols -UNVERSIONED_SYMBOLS=$(nm $LIBPATH | grep -e "sdf" | grep -e "$VERSIONED_NS" -v) +UNVERSIONED_SYMBOLS=$(nm -D $LIBPATH | grep -e "3sdf" | grep -e "$VERSIONED_NS" -v) UNVERSIONED_SYMBOL_CHARS=$(printf "$UNVERSIONED_SYMBOLS" | wc -m) if [ $UNVERSIONED_SYMBOL_CHARS -ne 0 ]