From 3b12acdf3239592cf7dae3b95696bbe8c6402bf8 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 18 Oct 2020 14:21:26 -0700 Subject: [PATCH] scripts/run_tests.sh: test for correct symbol prefixes --- scripts/run_tests.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index c95206c..482565d 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -182,6 +182,20 @@ do_run_tests() { gzip_tests "$@" } +check_symbol_prefixes() { + log "Checking that all global symbols are prefixed with \"libdeflate_\"" + $MAKE libdeflate.a + if nm libdeflate.a | grep ' T ' | grep -E -v " _?libdeflate_"; then + fail "Some global symbols aren't prefixed with \"libdeflate_\"" + fi + log "Checking that all exported symbols are prefixed with \"libdeflate\"" + $MAKE libdeflate.so + if nm libdeflate.so | grep ' T ' \ + | grep -E -v " (libdeflate_|_init\>|_fini\>)"; then + fail "Some exported symbols aren't prefixed with \"libdeflate_\"" + fi +} + install_uninstall_tests() { local shell @@ -237,6 +251,7 @@ run_tests() { fi install_uninstall_tests + check_symbol_prefixes } ###############################################################################