summaryrefslogtreecommitdiff
path: root/tests/integration/jtty
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
committerhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
commitc25cbdf6fb6d946175f4335fab77bfea601b56db (patch)
tree6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /tests/integration/jtty
parent71f5689252c9f13e70e1c24856904475b2307809 (diff)
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'tests/integration/jtty')
-rw-r--r--tests/integration/jtty/live_audio.expected.txt1
-rw-r--r--tests/integration/jtty/run_live_audio.cmake66
-rw-r--r--tests/integration/jtty/run_tx_loopback.cmake84
-rw-r--r--tests/integration/jtty/tx_loopback.expected.txt2
4 files changed, 153 insertions, 0 deletions
diff --git a/tests/integration/jtty/live_audio.expected.txt b/tests/integration/jtty/live_audio.expected.txt
new file mode 100644
index 00000000..7dbc5165
--- /dev/null
+++ b/tests/integration/jtty/live_audio.expected.txt
@@ -0,0 +1 @@
+CQ TEST DE KA1ABC LIVE AUDIO SMOKE TEST
diff --git a/tests/integration/jtty/run_live_audio.cmake b/tests/integration/jtty/run_live_audio.cmake
new file mode 100644
index 00000000..1dcbd7a2
--- /dev/null
+++ b/tests/integration/jtty/run_live_audio.cmake
@@ -0,0 +1,66 @@
+foreach (required_variable SJTTY WSJTX WORK_DIR EXPECTED)
+ if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "")
+ message (FATAL_ERROR "${required_variable} is required")
+ endif ()
+endforeach ()
+
+set (ipc_dir "${WORK_DIR}-ipc")
+file (REMOVE_RECURSE "${WORK_DIR}")
+file (MAKE_DIRECTORY
+ "${WORK_DIR}/config"
+ "${WORK_DIR}/data"
+ "${WORK_DIR}/cache"
+ "${ipc_dir}")
+
+execute_process (
+ COMMAND "${SJTTY}"
+ "CQ TEST DE KA1ABC LIVE AUDIO SMOKE TEST"
+ 1500 0.25 AW 0 384 1 99
+ WORKING_DIRECTORY "${WORK_DIR}"
+ RESULT_VARIABLE generator_result
+ OUTPUT_VARIABLE generator_stdout
+ ERROR_VARIABLE generator_stderr)
+if (NOT generator_result STREQUAL "0")
+ message (FATAL_ERROR
+ "sjtty failed with exit code ${generator_result}\n"
+ "stdout:\n${generator_stdout}\n"
+ "stderr:\n${generator_stderr}")
+endif ()
+
+set (fixture "${WORK_DIR}/000000_000001.wav")
+if (NOT EXISTS "${fixture}")
+ message (FATAL_ERROR "sjtty did not create ${fixture}")
+endif ()
+file (SIZE "${fixture}" fixture_size)
+if (fixture_size LESS 45)
+ message (FATAL_ERROR "sjtty created a malformed ${fixture_size}-byte WAV")
+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_live_audio_jtty")
+if (NOT APPLE)
+ list (APPEND wsjtx_environment "TMPDIR=${ipc_dir}")
+endif ()
+
+execute_process (
+ COMMAND "${CMAKE_COMMAND}" -E env
+ ${wsjtx_environment}
+ "${WSJTX}"
+ --jtty-live-audio-test "${fixture}"
+ --jtty-live-audio-expected "${EXPECTED}"
+ --rig-name CTEST-LIVE-AUDIO-JTTY
+ WORKING_DIRECTORY "${WORK_DIR}"
+ RESULT_VARIABLE wsjtx_result
+ OUTPUT_VARIABLE wsjtx_stdout
+ ERROR_VARIABLE 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"
+ "stdout:\n${wsjtx_stdout}\n"
+ "stderr:\n${wsjtx_stderr}")
+endif ()
+
+message (STATUS "WSJT-X JTTY live-audio smoke test passed")
diff --git a/tests/integration/jtty/run_tx_loopback.cmake b/tests/integration/jtty/run_tx_loopback.cmake
new file mode 100644
index 00000000..cb6c0494
--- /dev/null
+++ b/tests/integration/jtty/run_tx_loopback.cmake
@@ -0,0 +1,84 @@
+foreach (required_variable WSJTX WORK_DIR EXPECTED)
+ if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "")
+ message (FATAL_ERROR "${required_variable} is required")
+ endif ()
+endforeach ()
+
+set (ipc_dir "${WORK_DIR}-ipc")
+file (REMOVE_RECURSE "${WORK_DIR}")
+file (MAKE_DIRECTORY
+ "${WORK_DIR}/capture/config"
+ "${WORK_DIR}/capture/data"
+ "${WORK_DIR}/capture/cache"
+ "${WORK_DIR}/replay/config"
+ "${WORK_DIR}/replay/data"
+ "${WORK_DIR}/replay/cache"
+ "${ipc_dir}/capture"
+ "${ipc_dir}/replay")
+
+set (capture "${WORK_DIR}/jtty-tx-loopback.wav")
+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")
+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")
+if (NOT APPLE)
+ list (APPEND capture_environment "TMPDIR=${ipc_dir}/capture")
+ list (APPEND replay_environment "TMPDIR=${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
+ WORKING_DIRECTORY "${WORK_DIR}/capture"
+ RESULT_VARIABLE capture_result
+ OUTPUT_VARIABLE capture_stdout
+ ERROR_VARIABLE capture_stderr)
+if (NOT capture_result STREQUAL "0")
+ message (FATAL_ERROR
+ "WSJT-X JTTY transmit capture failed with exit code ${capture_result}\n"
+ "stdout:\n${capture_stdout}\n"
+ "stderr:\n${capture_stderr}")
+endif ()
+
+if (NOT EXISTS "${capture}")
+ message (FATAL_ERROR "WSJT-X did not create ${capture}")
+endif ()
+file (SIZE "${capture}" capture_size)
+if (capture_size LESS 45)
+ message (FATAL_ERROR "WSJT-X created a malformed ${capture_size}-byte WAV")
+endif ()
+file (READ "${capture}" capture_header OFFSET 0 LIMIT 28 HEX)
+if (NOT capture_header MATCHES
+ "^52494646........57415645666d7420100000000100010080bb0000$")
+ message (FATAL_ERROR
+ "WSJT-X capture is not a 48 kHz mono PCM RIFF/WAVE file: ${capture_header}")
+endif ()
+
+execute_process (
+ COMMAND "${CMAKE_COMMAND}" -E env
+ ${replay_environment}
+ "${WSJTX}"
+ --jtty-live-audio-test "${capture}"
+ --jtty-live-audio-expected "${EXPECTED}"
+ --rig-name CTEST-JTTY-TX-REPLAY
+ WORKING_DIRECTORY "${WORK_DIR}/replay"
+ RESULT_VARIABLE replay_result
+ OUTPUT_VARIABLE replay_stdout
+ ERROR_VARIABLE replay_stderr)
+if (NOT replay_result STREQUAL "0")
+ message (FATAL_ERROR
+ "WSJT-X JTTY transmit replay failed with exit code ${replay_result}\n"
+ "stdout:\n${replay_stdout}\n"
+ "stderr:\n${replay_stderr}")
+endif ()
+
+message (STATUS "WSJT-X JTTY transmit loopback smoke test passed")
diff --git a/tests/integration/jtty/tx_loopback.expected.txt b/tests/integration/jtty/tx_loopback.expected.txt
new file mode 100644
index 00000000..3761f4f4
--- /dev/null
+++ b/tests/integration/jtty/tx_loopback.expected.txt
@@ -0,0 +1,2 @@
+WB9XYZ 599 0123
+WB9XYZ TU CQ KA1ABC CQ