Skip to content

Commit

Permalink
Fix symbol checking test
Browse files Browse the repository at this point in the history
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 <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero committed Aug 27, 2024
1 parent 51bfd3b commit a26d156
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/integration/all_symbols_have_version.bash.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 <lenght, id> 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
Expand All @@ -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 ]
Expand Down

0 comments on commit a26d156

Please sign in to comment.