summaryrefslogtreecommitdiff
path: root/tests/integration/jt9
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2026-10-20 22:35:06 +0100
committerDave Hibberd <hibby@debian.org>2026-10-20 22:35:06 +0100
commit82ebb1ed1af30cee4dfbb1c628431d32885a00e0 (patch)
tree1a1f782d3e576b758be0bc61171574a7cd8f2376 /tests/integration/jt9
parent061658210acb6425517733ea012dda803a7f72a1 (diff)
parent61d684922b0f1c8455cc60eb3d123df058c9e1f5 (diff)
Merge tag 'debian/3.3.0_beta2+dfsg-1' into hibbian/trixie-backports
tagging wsjtx 3.3.0~beta2+dfsg-1
Diffstat (limited to 'tests/integration/jt9')
-rw-r--r--tests/integration/jt9/verify_jt4_12000_read_extent.cmake39
-rw-r--r--tests/integration/jt9/verify_jt4_engine.cmake19
-rw-r--r--tests/integration/jt9/verify_loaded_libraries.cmake39
3 files changed, 84 insertions, 13 deletions
diff --git a/tests/integration/jt9/verify_jt4_12000_read_extent.cmake b/tests/integration/jt9/verify_jt4_12000_read_extent.cmake
index 7011cc39..64f6fa33 100644
--- a/tests/integration/jt9/verify_jt4_12000_read_extent.cmake
+++ b/tests/integration/jt9/verify_jt4_12000_read_extent.cmake
@@ -1,22 +1,32 @@
-foreach (required_variable JT9 JT4SIM WORK_DIR)
+foreach (required_variable JT9 WORK_DIR)
if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "")
message (FATAL_ERROR "${required_variable} is required")
endif ()
endforeach ()
file (MAKE_DIRECTORY "${WORK_DIR}")
-execute_process (
- COMMAND "${JT4SIM}" "G3WDG OK1KIR RRR" F 1 0 0 1 99
- WORKING_DIRECTORY "${WORK_DIR}"
- RESULT_VARIABLE simulator_result
- OUTPUT_QUIET
- ERROR_VARIABLE simulator_stderr)
-if (NOT "${simulator_result}" STREQUAL "0")
- message (FATAL_ERROR
- "jt4sim exited with ${simulator_result}\n${simulator_stderr}")
+if (DEFINED JT4_WAV AND NOT "${JT4_WAV}" STREQUAL "")
+ set (full_wav "${JT4_WAV}")
+ set (submode A)
+ set (expected_message "K1ABC W9XYZ FN42")
+else ()
+ if (NOT DEFINED JT4SIM OR "${JT4SIM}" STREQUAL "")
+ message (FATAL_ERROR "JT4_WAV or JT4SIM is required")
+ endif ()
+ execute_process (
+ COMMAND "${JT4SIM}" "G3WDG OK1KIR RRR" F 1 0 0 1 99
+ WORKING_DIRECTORY "${WORK_DIR}"
+ RESULT_VARIABLE simulator_result
+ OUTPUT_QUIET
+ ERROR_VARIABLE simulator_stderr)
+ if (NOT "${simulator_result}" STREQUAL "0")
+ message (FATAL_ERROR
+ "jt4sim exited with ${simulator_result}\n${simulator_stderr}")
+ endif ()
+ set (full_wav "${WORK_DIR}/000000_0001.wav")
+ set (submode F)
+ set (expected_message "G3WDG OK1KIR RRR")
endif ()
-
-set (full_wav "${WORK_DIR}/000000_0001.wav")
set (truncated_wav "${WORK_DIR}/000000_0001_truncated.wav")
# Keep enough samples to distinguish a complete JT4 read from premature termination.
set (truncate_script [=[
@@ -47,7 +57,7 @@ execute_process (
COMMAND "${JT9}"
-a "${WORK_DIR}"
-t "${WORK_DIR}"
- --jt4 -b F -f 1000 -d 3
+ --jt4 -b "${submode}" -f 1000 -d 3
"${truncated_wav}"
WORKING_DIRECTORY "${WORK_DIR}"
RESULT_VARIABLE decoder_result
@@ -59,6 +69,9 @@ if (NOT "${decoder_result}" STREQUAL "0")
"stdout:\n${decoder_stdout}\n"
"stderr:\n${decoder_stderr}")
endif ()
+if (NOT "${decoder_stdout}" MATCHES "${expected_message}")
+ message (FATAL_ERROR "Truncated JT4 recording did not decode:\n${decoder_stdout}")
+endif ()
if (NOT "${decoder_stdout}" MATCHES "EOF on input file")
message (FATAL_ERROR
"jt9 did not read beyond the obsolete 570240-sample cutoff\n"
diff --git a/tests/integration/jt9/verify_jt4_engine.cmake b/tests/integration/jt9/verify_jt4_engine.cmake
new file mode 100644
index 00000000..45f5226c
--- /dev/null
+++ b/tests/integration/jt9/verify_jt4_engine.cmake
@@ -0,0 +1,19 @@
+if (NOT DEFINED JT9_EXECUTABLE OR NOT DEFINED JT4_WAV OR NOT DEFINED TEST_DIRECTORY)
+ message (FATAL_ERROR "JT4 engine test requires JT9_EXECUTABLE, JT4_WAV and TEST_DIRECTORY")
+endif ()
+file (MAKE_DIRECTORY "${TEST_DIRECTORY}")
+execute_process (COMMAND "${JT9_EXECUTABLE}" --jt4 -b A -f 1000 -d 1
+ -a "${TEST_DIRECTORY}" -t "${TEST_DIRECTORY}" "${JT4_WAV}"
+ WORKING_DIRECTORY "${TEST_DIRECTORY}"
+ RESULT_VARIABLE status OUTPUT_VARIABLE output ERROR_VARIABLE error TIMEOUT 60)
+if (NOT status EQUAL 0)
+ message (FATAL_ERROR "JT4 CLI failed (${status}): ${error}\n${output}")
+endif ()
+if (NOT output MATCHES "K1ABC W9XYZ FN42")
+ message (FATAL_ERROR "JT4 CLI did not decode the generated recording:\n${output}\n${error}")
+endif ()
+string (REGEX MATCHALL "K1ABC W9XYZ FN42" messages "${output}")
+list (LENGTH messages count)
+if (NOT count EQUAL 1 OR NOT output MATCHES "<DecodeFinished>[^\n]*[ ]1[ ]+0")
+ message (FATAL_ERROR "JT4 CLI produced unexpected messages/completion:\n${output}")
+endif ()
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 ()