diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /tests/integration/wsprd | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (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/wsprd')
| -rw-r--r-- | tests/integration/wsprd/compare_wsprd_output.cmake | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/integration/wsprd/compare_wsprd_output.cmake b/tests/integration/wsprd/compare_wsprd_output.cmake new file mode 100644 index 00000000..63e37ed0 --- /dev/null +++ b/tests/integration/wsprd/compare_wsprd_output.cmake @@ -0,0 +1,41 @@ +foreach (required_variable WSPRD SAMPLE EXPECTED 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}") +set (actual_file "${WORK_DIR}/actual.txt") +set (stderr_file "${WORK_DIR}/stderr.txt") + +execute_process ( + COMMAND "${WSPRD}" + -a "${WORK_DIR}" + "${SAMPLE}" + WORKING_DIRECTORY "${WORK_DIR}" + RESULT_VARIABLE decoder_result + OUTPUT_VARIABLE decoder_stdout + ERROR_VARIABLE decoder_stderr) + +file (WRITE "${actual_file}" "${decoder_stdout}") +file (WRITE "${stderr_file}" "${decoder_stderr}") + +if (NOT "${decoder_result}" STREQUAL "0") + message (FATAL_ERROR + "wsprd exited with ${decoder_result}\n" + "stdout:\n${decoder_stdout}\n" + "stderr:\n${decoder_stderr}") +endif () + +if (NOT "${decoder_stderr}" STREQUAL "") + message (FATAL_ERROR "wsprd wrote to stderr:\n${decoder_stderr}") +endif () + +file (READ "${EXPECTED}" expected_output) +if (NOT "${decoder_stdout}" STREQUAL "${expected_output}") + message (FATAL_ERROR + "wsprd output differs from ${EXPECTED}\n" + "expected:\n${expected_output}\n" + "actual:\n${decoder_stdout}\n" + "preserved output: ${actual_file}") +endif () |
