if(DEFINED ENV{EVO_TEST_TMPDIR} AND NOT "$ENV{EVO_TEST_TMPDIR}" STREQUAL "") string(RANDOM LENGTH 16 ALPHABET 0123456789abcdef run_id) set(TEST_DIR "$ENV{EVO_TEST_TMPDIR}/migration-restart-${run_id}") endif() file(MAKE_DIRECTORY "${TEST_DIR}") set(prefix "${TEST_DIR}/pair") execute_process(COMMAND "${MIGRATION_TEST}" --record "${prefix}" RESULT_VARIABLE recorded) if(NOT recorded EQUAL 0) message(FATAL_ERROR "Migration trace preparation failed: ${recorded}") endif() execute_process(COMMAND "${MIGRATION_TEST}" --replay "${prefix}" RESULT_VARIABLE replayed) if(NOT replayed EQUAL 0) message(FATAL_ERROR "Fresh-process migration replay failed: ${replayed}") endif() foreach(variant legacy maturing) if(variant STREQUAL "legacy") set(pair "${prefix}") else() set(pair "${prefix}.maturing") endif() foreach(representation raw pop) foreach(side source destination) execute_process(COMMAND "${CMAKE_COMMAND}" -E compare_files "${pair}.${representation}.${side}.expected" "${pair}.${representation}.${side}.resumed" RESULT_VARIABLE compared) if(NOT compared EQUAL 0) message(FATAL_ERROR "Migration ${variant}/${representation}/${side} diverged across process replay") endif() endforeach() endforeach() execute_process(COMMAND "${CMAKE_COMMAND}" -E compare_files "${pair}.pop.continuation.expected" "${pair}.pop.continuation.resumed" RESULT_VARIABLE continued) if(NOT continued EQUAL 0) message(FATAL_ERROR "Transferred ${variant} population interval diverged across process replay") endif() endforeach()