Merge topic 'instrumentation-postbuild-error'

e5db41147a Tests/instrumentation: Improve error message when postBuild check fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11195
This commit is contained in:
Brad King
2025-09-17 14:07:01 +00:00
committed by Kitware Robot
@@ -3,6 +3,11 @@ set(DELAY 1)
if (NOT EXISTS ${v1}/preBuild.hook)
set(RunCMake_TEST_FAILED "preBuild hook did not run\n")
else()
file(READ ${v1}/preBuild.hook preBuildErrors)
if (NOT preBuildErrors MATCHES "^$")
string(APPEND RunCMake_TEST_FAILED "Errors found in data during preBuild hook:\n${preBuildErrors}\n")
endif()
endif()
macro(hasPostBuildArtifacts)
@@ -29,17 +34,12 @@ endforeach()
if (NOT postBuildRan)
string(APPEND RunCMake_TEST_FAILED "postBuild hook did not run\n")
else()
file(READ ${v1}/postBuild.hook postBuildErrors)
if (NOT postBuildErrors MATCHES "^$")
string(APPEND RunCMake_TEST_FAILED "Errors found in data during postBuild hook:\n${postBuildErrors}\n")
endif()
endif()
if (NOT dataDirClean)
string(APPEND RunCMake_TEST_FAILED "Snippet files not fully removed post build\n")
endif()
file(READ ${v1}/postBuild.hook postBuildErrors)
if (NOT postBuildErrors MATCHES "^$")
string(APPEND RunCMake_TEST_FAILED "Errors found in data during postBuild hook:\n${postBuildErrors}\n")
endif()
file(READ ${v1}/preBuild.hook preBuildErrors)
if (NOT preBuildErrors MATCHES "^$")
string(APPEND RunCMake_TEST_FAILED "Errors found in data during preBuild hook:\n${preBuildErrors}\n")
endif()