summaryrefslogtreecommitdiff
path: root/tests/integration/jt9
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-10-14 14:39:20 +0200
committerChristoph Berg <myon@debian.org>2026-10-14 14:39:20 +0200
commitc576a4281ef8c87990ae6399393a827dfaccacd5 (patch)
tree0f28b7d1fc2ba73ccea5d7513281b0f8cae76fb6 /tests/integration/jt9
parentffc62c792c9a5196cb4ce7a353287dfe20db6524 (diff)
New upstream version 3.3.0~beta2+dfsgupstream/3.3.0_beta2+dfsgupstream
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
2 files changed, 45 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 ()