summaryrefslogtreecommitdiff
path: root/tests/integration/jt9
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-10-09 14:12:49 +0200
committerChristoph Berg <myon@debian.org>2026-10-09 14:12:49 +0200
commit76956486fa7ef52a51d4e56df1e13a9f19a6c93c (patch)
treefe0c394439fdc167d1970372e8998874090854dd /tests/integration/jt9
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
parentffc62c792c9a5196cb4ce7a353287dfe20db6524 (diff)
Update upstream source from tag 'upstream/3.3.0_beta1+dfsg'
Update to upstream version '3.3.0~beta1+dfsg' with Debian dir 85037bbb9376721108594b59b54ead82ac6924a3
Diffstat (limited to 'tests/integration/jt9')
-rw-r--r--tests/integration/jt9/verify_loaded_libraries.cmake39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/integration/jt9/verify_loaded_libraries.cmake b/tests/integration/jt9/verify_loaded_libraries.cmake
new file mode 100644
index 00000000..7354fecd
--- /dev/null
+++ b/tests/integration/jt9/verify_loaded_libraries.cmake
@@ -0,0 +1,39 @@
+# Fails if EXECUTABLE loads Boost, Qt or ICU, which the release tarballs'
+# decoder programs use no symbol from: they load them only when linked
+# without --as-needed (Linux) or -dead_strip_dylibs (macOS).
+foreach (required_variable LISTER EXECUTABLE)
+ if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "")
+ message (FATAL_ERROR "${required_variable} is required")
+ endif ()
+endforeach ()
+
+if (LISTER MATCHES "otool$")
+ set (lister_arguments -L)
+else ()
+ set (lister_arguments -dW)
+endif ()
+execute_process (
+ COMMAND "${LISTER}" ${lister_arguments} "${EXECUTABLE}"
+ RESULT_VARIABLE lister_result
+ OUTPUT_VARIABLE lister_stdout
+ ERROR_VARIABLE lister_stderr)
+if (NOT "${lister_result}" STREQUAL "0")
+ message (FATAL_ERROR
+ "${LISTER} exited with ${lister_result}\n"
+ "stdout:\n${lister_stdout}\n"
+ "stderr:\n${lister_stderr}")
+endif ()
+
+if (LISTER MATCHES "otool$")
+ # The first line names the file itself.
+ string (FIND "${lister_stdout}" "\n" first_newline)
+ string (SUBSTRING "${lister_stdout}" ${first_newline} -1 libraries)
+else ()
+ string (REGEX MATCHALL "\\(NEEDED\\)[^\n]*" libraries "${lister_stdout}")
+ string (REPLACE ";" "\n" libraries "${libraries}")
+endif ()
+string (REGEX MATCHALL "[^\n]*(boost|QtCore|Qt5Core|libicu)[^\n]*" unused "${libraries}")
+if (unused)
+ string (REPLACE ";" "\n" unused "${unused}")
+ message (FATAL_ERROR "${EXECUTABLE} loads libraries it uses no symbol from:\n${unused}")
+endif ()