Fix roctracer-roctx test (#1088)

- original format using generator expressions (`$<IF:$<TARGET_EXISTS:...>,$<TARGET_FILE:...>,>`) appears to cause issues with older CMake versions

[ROCm/rocprofiler-sdk commit: d7874f3496]
This commit is contained in:
Jonathan R. Madsen
2024-09-17 08:59:34 -05:00
committed by GitHub
parent d7aa58e291
commit 7dbe1d0650
2 changed files with 19 additions and 8 deletions
@@ -30,6 +30,12 @@ set(GPU_TARGETS
"${DEFAULT_GPU_TARGETS}"
CACHE STRING "GPU targets to compile for")
set(AMDGPU_TARGETS
"${GPU_TARGETS}"
CACHE STRING
"GPU targets to compile for AMDGPUs (update GPU_TARGETS, not this variable)"
FORCE)
# build flags
add_library(rocprofiler-tests-build-flags INTERFACE)
add_library(rocprofiler-sdk::tests-build-flags ALIAS rocprofiler-tests-build-flags)
@@ -18,17 +18,22 @@ set(tracing-env "${PRELOAD_ENV}")
rocprofiler_configure_pytest_files(CONFIG pytest.ini roctracer-roctx-input.yml
COPY validate.py conftest.py)
add_test(
NAME rocprofv3-test-roctracer-roctx-trace-execute
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i roctracer-roctx-input.yml --
$<IF:$<TARGET_EXISTS:transpose-roctracer-roctx>,$<TARGET_FILE:transpose-roctracer-roctx>,>
)
if(TARGET transpose-roctracer-roctx)
set(TRANSPOSE_ROCTRACER_ROCTX_EXE $<TARGET_FILE:transpose-roctracer-roctx>)
set(TRANSPOSE_ROCTRACER_ROCTX_DISABLED OFF)
else()
set(TRANSPOSE_ROCTRACER_ROCTX_EXE)
set(TRANSPOSE_ROCTRACER_ROCTX_DISABLED ON)
endif()
add_test(NAME rocprofv3-test-roctracer-roctx-trace-execute
COMMAND $<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i roctracer-roctx-input.yml
-- ${TRANSPOSE_ROCTRACER_ROCTX_EXE})
set_tests_properties(
rocprofv3-test-roctracer-roctx-trace-execute
PROPERTIES TIMEOUT 45 LABELS "integration-tests" ENVIRONMENT "${tracing-env}"
DISABLED "$<IF:$<TARGET_EXISTS:transpose-roctracer-roctx>,OFF,ON>")
DISABLED "${TRANSPOSE_ROCTRACER_ROCTX_DISABLED}")
add_test(
NAME rocprofv3-test-roctracer-roctx-trace-validate
@@ -53,7 +58,7 @@ set_tests_properties(
DEPENDS
"rocprofv3-test-roctracer-roctx-trace-execute"
DISABLED
"$<IF:$<TARGET_EXISTS:transpose-roctracer-roctx>,OFF,ON>"
"${TRANSPOSE_ROCTRACER_ROCTX_DISABLED}"
FAIL_REGULAR_EXPRESSION
"AssertionError"
ATTACHED_FILES_ON_FAIL