blob: f614241a631e0f40a33b9fc5a317b3d7f012436d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
execute_process(
COMMAND "${ENCODE77}" "CQ K1ABC FN42"
RESULT_VARIABLE valid_result
OUTPUT_VARIABLE valid_output
ERROR_VARIABLE valid_error
)
if (NOT valid_result EQUAL 0)
message(FATAL_ERROR "Valid message failed (${valid_result}):\n${valid_output}${valid_error}")
endif ()
if (NOT valid_output MATCHES "1[ ]+OK[ ]+CQ K1ABC FN42[ ]+CQ K1ABC FN42")
message(FATAL_ERROR "Valid message output was unexpected:\n${valid_output}")
endif ()
execute_process(
COMMAND "${ENCODE77}" "THIS FREE TEXT IS TOO LONG"
RESULT_VARIABLE rejected_result
OUTPUT_VARIABLE rejected_output
ERROR_VARIABLE rejected_error
)
if (rejected_result EQUAL 0)
message(FATAL_ERROR "Rejected message returned success:\n${rejected_output}")
endif ()
if (NOT rejected_output MATCHES "REJECTED[ ]+THIS FREE TEXT IS TOO LONG[ ]+free text too long")
message(FATAL_ERROR "Rejected message output was unexpected:\n${rejected_output}${rejected_error}")
endif ()
execute_process(
COMMAND "${ENCODE77}" -f "${INPUT_FILE}"
WORKING_DIRECTORY "${INPUT_DIR}"
RESULT_VARIABLE batch_result
OUTPUT_VARIABLE batch_output
ERROR_VARIABLE batch_error
)
if (batch_result EQUAL 0)
message(FATAL_ERROR "Batch with a rejection returned success:\n${batch_output}")
endif ()
if (NOT batch_output MATCHES "Summary: 2 encoded, 1 rejected, 0 unpack failures, 0 differences")
message(FATAL_ERROR "Batch summary was unexpected:\n${batch_output}${batch_error}")
endif ()
|