execute_process(COMMAND ${BENCH_TRAVERSAL} -bvh ${TESTING_DIR}/sponza.bvh -ray ${TESTING_DIR}/sponza-primary.rays --bench 1 --warmup 0 --tmin 0.01 --tmax 5000 -o ${TRAVERSAL_OUTPUT}.fbuf ${BENCH_TRAVERSAL_ARGS} RESULT_VARIABLE CMD_RESULT)
if (CMD_RESULT)
    message(FATAL_ERROR "Error running the traversal benchmark tool")
endif()
execute_process(COMMAND ${FBUF2PNG} -n ${TRAVERSAL_OUTPUT}.fbuf ${TRAVERSAL_OUTPUT}.png RESULT_VARIABLE CMD_RESULT)
if (CMD_RESULT)
    message(FATAL_ERROR "Error running fbuf2png")
endif()
execute_process(COMMAND ${IM_COMPARE} -metric MSE ${TESTING_DIR}/ref-primary.png ${TRAVERSAL_OUTPUT}.png ${TRAVERSAL_OUTPUT}-diff.png RESULT_VARIABLE CMD_RESULT)
if (CMD_RESULT)
    message(FATAL_ERROR "The output of the traversal '${TRAVERSAL_OUTPUT}.png' does not match the reference '${TESTING_DIR}/ref-primary.png'")
endif()
