74facf87a6
* Change all rocprofiler-X target names to rocprofiler-sdk-X * Update rocprofiler-sdk-config.cmake - fix install tree target names - simplify logic for using find w/ components and find w/o components * Update rocprofiler-sdk-roctx-config.cmake - simplify logic for using find w/ components and find w/o components * Update samples/intercept_table/CMakeLists.txt - demonstrate/test use of `find_package(rocprofiler-sdk ... COMPONENTS ...)`
63 líneas
1.8 KiB
CMake
63 líneas
1.8 KiB
CMake
#
|
|
#
|
|
#
|
|
cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)
|
|
|
|
project(
|
|
rocprofiler-tests-c-tool
|
|
LANGUAGES CXX
|
|
VERSION 0.0.0)
|
|
|
|
find_package(rocprofiler-sdk REQUIRED)
|
|
|
|
if(ROCPROFILER_MEMCHECK_PRELOAD_ENV)
|
|
set(PRELOAD_ENV
|
|
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}:$<TARGET_FILE:rocprofiler-sdk-c-tool>")
|
|
else()
|
|
set(PRELOAD_ENV "LD_PRELOAD=$<TARGET_FILE:rocprofiler-sdk-c-tool>")
|
|
endif()
|
|
|
|
add_test(NAME test-c-tool-execute COMMAND $<TARGET_FILE:transpose> 1)
|
|
|
|
set(c-tool-env
|
|
"${PRELOAD_ENV}"
|
|
"LD_LIBRARY_PATH=$<TARGET_FILE_DIR:rocprofiler-sdk::rocprofiler-sdk-shared-library>:$ENV{LD_LIBRARY_PATH}"
|
|
)
|
|
|
|
set_tests_properties(
|
|
test-c-tool-execute
|
|
PROPERTIES
|
|
TIMEOUT
|
|
45
|
|
LABELS
|
|
"integration-tests"
|
|
ENVIRONMENT
|
|
"${c-tool-env}"
|
|
PASS_REGULAR_EXPRESSION
|
|
"Test C tool \\(priority=0\\) is using rocprofiler-sdk v([0-9]+\\.[0-9]+\\.[0-9]+)"
|
|
FAIL_REGULAR_EXPRESSION
|
|
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
|
|
|
# this test uses ROCP_TOOL_LIBRARIES instead of LD_PRELOAD
|
|
add_test(NAME test-c-tool-rocp-tool-lib-execute COMMAND $<TARGET_FILE:transpose> 1)
|
|
|
|
set(c-tool-rocp-tool-lib-env
|
|
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}"
|
|
"ROCP_TOOL_LIBRARIES=$<TARGET_FILE:rocprofiler-sdk-c-tool>"
|
|
"LD_LIBRARY_PATH=$<TARGET_FILE_DIR:rocprofiler-sdk::rocprofiler-sdk-shared-library>:$ENV{LD_LIBRARY_PATH}"
|
|
)
|
|
|
|
set_tests_properties(
|
|
test-c-tool-rocp-tool-lib-execute
|
|
PROPERTIES
|
|
TIMEOUT
|
|
45
|
|
LABELS
|
|
"integration-tests"
|
|
ENVIRONMENT
|
|
"${c-tool-rocp-tool-lib-env}"
|
|
PASS_REGULAR_EXPRESSION
|
|
"Test C tool \\(priority=0\\) is using rocprofiler-sdk v([0-9]+\\.[0-9]+\\.[0-9]+)"
|
|
FAIL_REGULAR_EXPRESSION
|
|
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|