summaryrefslogtreecommitdiff
path: root/tests/integration
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
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')
-rw-r--r--tests/integration/decoder_engine/run_wav_gui.cmake71
-rw-r--r--tests/integration/jt65/check_stream.py27
-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
-rw-r--r--tests/integration/jtty/run_live_audio.cmake36
-rw-r--r--tests/integration/jtty/run_tx_loopback.cmake46
-rw-r--r--tests/integration/jtty/tx_loopback.expected.txt2
8 files changed, 257 insertions, 22 deletions
diff --git a/tests/integration/decoder_engine/run_wav_gui.cmake b/tests/integration/decoder_engine/run_wav_gui.cmake
new file mode 100644
index 00000000..a4204886
--- /dev/null
+++ b/tests/integration/decoder_engine/run_wav_gui.cmake
@@ -0,0 +1,71 @@
+if (NOT DEFINED MODE)
+ set (MODE JT9)
+endif ()
+if (NOT MODE STREQUAL "JT4" AND NOT MODE STREQUAL "JT9" AND NOT MODE STREQUAL "JT65"
+ AND NOT MODE STREQUAL "Q65"
+ AND NOT MODE STREQUAL "FST4" AND NOT MODE STREQUAL "FST4W")
+ message (FATAL_ERROR "MODE must be JT4, JT9, JT65, Q65, FST4, or FST4W")
+endif ()
+string (TOLOWER "${MODE}" mode_option)
+
+foreach (required_variable WSJTX SAMPLE EXPECTED_MESSAGE WORK_DIR)
+ if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "")
+ message (FATAL_ERROR "${required_variable} is required")
+ endif ()
+endforeach ()
+
+string (RANDOM LENGTH 12 ALPHABET 0123456789abcdef run_id)
+set (rig_name "CTEST-${MODE}-WAV-${run_id}")
+set (ipc_dir "${WORK_DIR}-ipc")
+file (REMOVE_RECURSE "${WORK_DIR}" "${ipc_dir}")
+file (MAKE_DIRECTORY
+ "${WORK_DIR}/config"
+ "${WORK_DIR}/data"
+ "${WORK_DIR}/cache"
+ "${ipc_dir}")
+
+if (MODE STREQUAL "FST4" OR MODE STREQUAL "FST4W")
+ set (timestamped_sample "${WORK_DIR}/261003_001500.wav")
+ configure_file ("${SAMPLE}" "${timestamped_sample}" COPYONLY)
+ set (SAMPLE "${timestamped_sample}")
+endif ()
+
+set (wsjtx_environment
+ "XDG_CONFIG_HOME=${WORK_DIR}/config"
+ "XDG_DATA_HOME=${WORK_DIR}/data"
+ "XDG_CACHE_HOME=${WORK_DIR}/cache"
+ "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_${mode_option}_wav")
+if (NOT APPLE)
+ list (APPEND wsjtx_environment "TMPDIR=${ipc_dir}")
+endif ()
+if (WIN32)
+ list (APPEND wsjtx_environment
+ "APPDATA=${WORK_DIR}/config"
+ "LOCALAPPDATA=${WORK_DIR}/data"
+ "TEMP=${ipc_dir}"
+ "TMP=${ipc_dir}")
+endif ()
+
+execute_process (
+ COMMAND "${CMAKE_COMMAND}" -E env
+ ${wsjtx_environment}
+ "${WSJTX}"
+ --test-mode
+ --${mode_option}-wav-test "${SAMPLE}"
+ --${mode_option}-wav-expected "${EXPECTED_MESSAGE}"
+ --rig-name "${rig_name}"
+ WORKING_DIRECTORY "${WORK_DIR}"
+ TIMEOUT 375
+ RESULT_VARIABLE wsjtx_result
+ OUTPUT_VARIABLE wsjtx_stdout
+ ERROR_VARIABLE wsjtx_stderr)
+file (WRITE "${WORK_DIR}/stdout.log" "${wsjtx_stdout}")
+file (WRITE "${WORK_DIR}/stderr.log" "${wsjtx_stderr}")
+if (NOT wsjtx_result STREQUAL "0")
+ message (FATAL_ERROR
+ "WSJT-X ${MODE} WAV test failed with exit code ${wsjtx_result}\n"
+ "stdout:\n${wsjtx_stdout}\n"
+ "stderr:\n${wsjtx_stderr}")
+endif ()
+
+message (STATUS "WSJT-X ${MODE} WAV decode and repeat passed")
diff --git a/tests/integration/jt65/check_stream.py b/tests/integration/jt65/check_stream.py
new file mode 100644
index 00000000..161c9a67
--- /dev/null
+++ b/tests/integration/jt65/check_stream.py
@@ -0,0 +1,27 @@
+import json
+from pathlib import Path
+import subprocess
+import sys
+
+
+decoder, harness, recording, work_dir = sys.argv[1:]
+work = Path(work_dir)
+work.mkdir(parents=True, exist_ok=True)
+result = subprocess.run(
+ [sys.executable, harness, decoder, recording, "--mode", "JT65",
+ "--depth-level", "1", "--nfa", "1300", "--nfb", "1700", "--quiet"],
+ cwd=work, capture_output=True, text=True, timeout=60,
+)
+(work / "stdout.log").write_text(result.stdout)
+(work / "stderr.log").write_text(result.stderr)
+if result.returncode:
+ raise SystemExit(f"JT65 stream failed: {result.stdout}\n{result.stderr}")
+events = [json.loads(line) for line in result.stdout.splitlines() if line.startswith("{")]
+if any(event.get("t") == "error" for event in events):
+ raise SystemExit(f"JT65 stream reported an error: {events}")
+if not any(event.get("t") == "decode" and event.get("mode") == "JT65"
+ and event.get("message", "").strip() == "K1ABC W9XYZ FN42" for event in events):
+ raise SystemExit(f"JT65 stream did not decode the supplied recording: {events}")
+if sum(event.get("t") == "decode_finished" for event in events) != 1:
+ raise SystemExit(f"JT65 stream must complete the reception exactly once: {events}")
+print("JT65 streaming PCM decode and completion passed")
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 ()
diff --git a/tests/integration/jtty/run_live_audio.cmake b/tests/integration/jtty/run_live_audio.cmake
index 1dcbd7a2..fe27f1b3 100644
--- a/tests/integration/jtty/run_live_audio.cmake
+++ b/tests/integration/jtty/run_live_audio.cmake
@@ -4,8 +4,24 @@ foreach (required_variable SJTTY WSJTX WORK_DIR EXPECTED)
endif ()
endforeach ()
+if (NOT DEFINED AUDIO_SPEED)
+ set (AUDIO_SPEED 4)
+endif ()
+if (NOT AUDIO_SPEED MATCHES "^[1-4]$")
+ message (FATAL_ERROR "AUDIO_SPEED must be an integer from 1 through 4")
+endif ()
+if (NOT DEFINED TEST_ID)
+ set (TEST_ID "test_wsjtx_live_audio_jtty")
+endif ()
+if (NOT TEST_ID MATCHES "^[A-Za-z0-9_-]+$")
+ message (FATAL_ERROR "TEST_ID must contain only letters, digits, underscores, or hyphens")
+endif ()
+
+string (RANDOM LENGTH 12 ALPHABET 0123456789abcdef run_id)
+set (rig_name "CTEST-JTTY-${run_id}-LIVE")
+
set (ipc_dir "${WORK_DIR}-ipc")
-file (REMOVE_RECURSE "${WORK_DIR}")
+file (REMOVE_RECURSE "${WORK_DIR}" "${ipc_dir}")
file (MAKE_DIRECTORY
"${WORK_DIR}/config"
"${WORK_DIR}/data"
@@ -17,9 +33,12 @@ execute_process (
"CQ TEST DE KA1ABC LIVE AUDIO SMOKE TEST"
1500 0.25 AW 0 384 1 99
WORKING_DIRECTORY "${WORK_DIR}"
+ TIMEOUT 20
RESULT_VARIABLE generator_result
OUTPUT_VARIABLE generator_stdout
ERROR_VARIABLE generator_stderr)
+file (WRITE "${WORK_DIR}/generator.stdout.log" "${generator_stdout}")
+file (WRITE "${WORK_DIR}/generator.stderr.log" "${generator_stderr}")
if (NOT generator_result STREQUAL "0")
message (FATAL_ERROR
"sjtty failed with exit code ${generator_result}\n"
@@ -40,10 +59,17 @@ set (wsjtx_environment
"XDG_CONFIG_HOME=${WORK_DIR}/config"
"XDG_DATA_HOME=${WORK_DIR}/data"
"XDG_CACHE_HOME=${WORK_DIR}/cache"
- "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_live_audio_jtty")
+ "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-${TEST_ID}")
if (NOT APPLE)
list (APPEND wsjtx_environment "TMPDIR=${ipc_dir}")
endif ()
+if (WIN32)
+ list (APPEND wsjtx_environment
+ "APPDATA=${WORK_DIR}/config"
+ "LOCALAPPDATA=${WORK_DIR}/data"
+ "TEMP=${ipc_dir}"
+ "TMP=${ipc_dir}")
+endif ()
execute_process (
COMMAND "${CMAKE_COMMAND}" -E env
@@ -51,11 +77,15 @@ execute_process (
"${WSJTX}"
--jtty-live-audio-test "${fixture}"
--jtty-live-audio-expected "${EXPECTED}"
- --rig-name CTEST-LIVE-AUDIO-JTTY
+ --test-audio-speed "${AUDIO_SPEED}"
+ --rig-name "${rig_name}"
WORKING_DIRECTORY "${WORK_DIR}"
+ TIMEOUT 110
RESULT_VARIABLE wsjtx_result
OUTPUT_VARIABLE wsjtx_stdout
ERROR_VARIABLE wsjtx_stderr)
+file (WRITE "${WORK_DIR}/receive.stdout.log" "${wsjtx_stdout}")
+file (WRITE "${WORK_DIR}/receive.stderr.log" "${wsjtx_stderr}")
if (NOT wsjtx_result STREQUAL "0")
message (FATAL_ERROR
"WSJT-X JTTY live-audio smoke test failed with exit code ${wsjtx_result}\n"
diff --git a/tests/integration/jtty/run_tx_loopback.cmake b/tests/integration/jtty/run_tx_loopback.cmake
index cb6c0494..8446d282 100644
--- a/tests/integration/jtty/run_tx_loopback.cmake
+++ b/tests/integration/jtty/run_tx_loopback.cmake
@@ -4,8 +4,24 @@ foreach (required_variable WSJTX WORK_DIR EXPECTED)
endif ()
endforeach ()
+if (NOT DEFINED AUDIO_SPEED)
+ set (AUDIO_SPEED 4)
+endif ()
+if (NOT AUDIO_SPEED MATCHES "^[1-4]$")
+ message (FATAL_ERROR "AUDIO_SPEED must be an integer from 1 through 4")
+endif ()
+if (NOT DEFINED TEST_ID)
+ set (TEST_ID "test_wsjtx_jtty_tx_loopback")
+endif ()
+if (NOT TEST_ID MATCHES "^[A-Za-z0-9_-]+$")
+ message (FATAL_ERROR "TEST_ID must contain only letters, digits, underscores, or hyphens")
+endif ()
+
+string (RANDOM LENGTH 12 ALPHABET 0123456789abcdef run_id)
+set (rig_name "CTEST-JTTY-${run_id}")
+
set (ipc_dir "${WORK_DIR}-ipc")
-file (REMOVE_RECURSE "${WORK_DIR}")
+file (REMOVE_RECURSE "${WORK_DIR}" "${ipc_dir}")
file (MAKE_DIRECTORY
"${WORK_DIR}/capture/config"
"${WORK_DIR}/capture/data"
@@ -21,27 +37,43 @@ set (capture_environment
"XDG_CONFIG_HOME=${WORK_DIR}/capture/config"
"XDG_DATA_HOME=${WORK_DIR}/capture/data"
"XDG_CACHE_HOME=${WORK_DIR}/capture/cache"
- "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_jtty_tx_loopback")
+ "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-${TEST_ID}")
set (replay_environment
"XDG_CONFIG_HOME=${WORK_DIR}/replay/config"
"XDG_DATA_HOME=${WORK_DIR}/replay/data"
"XDG_CACHE_HOME=${WORK_DIR}/replay/cache"
- "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_jtty_tx_loopback")
+ "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-${TEST_ID}")
if (NOT APPLE)
list (APPEND capture_environment "TMPDIR=${ipc_dir}/capture")
list (APPEND replay_environment "TMPDIR=${ipc_dir}/replay")
endif ()
+if (WIN32)
+ list (APPEND capture_environment
+ "APPDATA=${WORK_DIR}/capture/config"
+ "LOCALAPPDATA=${WORK_DIR}/capture/data"
+ "TEMP=${ipc_dir}/capture"
+ "TMP=${ipc_dir}/capture")
+ list (APPEND replay_environment
+ "APPDATA=${WORK_DIR}/replay/config"
+ "LOCALAPPDATA=${WORK_DIR}/replay/data"
+ "TEMP=${ipc_dir}/replay"
+ "TMP=${ipc_dir}/replay")
+endif ()
execute_process (
COMMAND "${CMAKE_COMMAND}" -E env
${capture_environment}
"${WSJTX}"
--jtty-tx-loopback-test "${capture}"
- --rig-name CTEST-JTTY-TX-CAPTURE
+ --test-audio-speed "${AUDIO_SPEED}"
+ --rig-name "${rig_name}-CAPTURE"
WORKING_DIRECTORY "${WORK_DIR}/capture"
+ TIMEOUT 210
RESULT_VARIABLE capture_result
OUTPUT_VARIABLE capture_stdout
ERROR_VARIABLE capture_stderr)
+file (WRITE "${WORK_DIR}/capture.stdout.log" "${capture_stdout}")
+file (WRITE "${WORK_DIR}/capture.stderr.log" "${capture_stderr}")
if (NOT capture_result STREQUAL "0")
message (FATAL_ERROR
"WSJT-X JTTY transmit capture failed with exit code ${capture_result}\n"
@@ -69,11 +101,15 @@ execute_process (
"${WSJTX}"
--jtty-live-audio-test "${capture}"
--jtty-live-audio-expected "${EXPECTED}"
- --rig-name CTEST-JTTY-TX-REPLAY
+ --test-audio-speed "${AUDIO_SPEED}"
+ --rig-name "${rig_name}-REPLAY"
WORKING_DIRECTORY "${WORK_DIR}/replay"
+ TIMEOUT 400
RESULT_VARIABLE replay_result
OUTPUT_VARIABLE replay_stdout
ERROR_VARIABLE replay_stderr)
+file (WRITE "${WORK_DIR}/replay.stdout.log" "${replay_stdout}")
+file (WRITE "${WORK_DIR}/replay.stderr.log" "${replay_stderr}")
if (NOT replay_result STREQUAL "0")
message (FATAL_ERROR
"WSJT-X JTTY transmit replay failed with exit code ${replay_result}\n"
diff --git a/tests/integration/jtty/tx_loopback.expected.txt b/tests/integration/jtty/tx_loopback.expected.txt
index 3761f4f4..9739495c 100644
--- a/tests/integration/jtty/tx_loopback.expected.txt
+++ b/tests/integration/jtty/tx_loopback.expected.txt
@@ -1,2 +1,2 @@
WB9XYZ 599 0123
-WB9XYZ TU CQ KA1ABC CQ
+SECOND MESSAGE QUEUED DURING FIRST STAYS PENDING UNTIL ITS OWN AIRTIME ARRIVES