CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
84 lines
2.4 KiB
CMake
84 lines
2.4 KiB
CMake
#
|
|
# Unit Test for @RAUT_TARGET@
|
|
#
|
|
|
|
project(rocprofiler-sdk-tests-unit-tests-@RAUT_TARGET@ LANGUAGES C CXX)
|
|
|
|
include(GoogleTest)
|
|
|
|
set(_NAME @RAUT_TARGET@)
|
|
set(_SOURCES @RAUT_SOURCES@)
|
|
set(_LABELS @RAUT_LABELS@)
|
|
set(_FAIL_REGEX "@RAUT_FAIL_REGULAR_EXPRESSION@")
|
|
set(_PASS_REGEX "@RAUT_PASS_REGULAR_EXPRESSION@")
|
|
set(_SKIP_REGEX "@RAUT_SKIP_REGULAR_EXPRESSION@")
|
|
set(_DISABLED "@RAUT_DISABLED@")
|
|
set(_ENVIRONMENT "@RAUT_ENVIRONMENT@")
|
|
set(_PREFIX "@RAUT_TEST_PREFIX@")
|
|
set(_RESOURCE_LOCK "@RAUT_RESOURCE_LOCK@")
|
|
|
|
function(rocprofiler_sdk_update_unit_test_environment _VAR _NAME)
|
|
set(_UPD) # temporary variable to hold updated list
|
|
foreach(_VAL IN LISTS ${_VAR})
|
|
if(_VAL MATCHES "^${_NAME}=(.*)$")
|
|
list(APPEND _UPD "${_VAL}:${ARGN}")
|
|
else()
|
|
list(APPEND _UPD "${_VAL}")
|
|
endif()
|
|
endforeach()
|
|
# propagate to parent scope
|
|
set(${_VAR} "${_UPD}" PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
rocprofiler_sdk_update_unit_test_environment(_ENVIRONMENT "LD_LIBRARY_PATH" "$ENV{LD_LIBRARY_PATH}")
|
|
rocprofiler_sdk_update_unit_test_environment(_ENVIRONMENT "ROCPROFILER_METRICS_PATH"
|
|
"$ENV{ROCPROFILER_METRICS_PATH}")
|
|
|
|
# test sources are in a subfolder
|
|
set(_TEST_SOURCES)
|
|
foreach(_FILE ${_SOURCES})
|
|
list(APPEND _TEST_SOURCES "${CMAKE_CURRENT_LIST_DIR}/${_NAME}/${_FILE}")
|
|
endforeach()
|
|
|
|
gtest_add_tests(
|
|
TARGET @RAUT_TARGET@
|
|
SOURCES ${_TEST_SOURCES}
|
|
TEST_LIST @RAUT_TARGET@_TESTS
|
|
TEST_PREFIX ${_PREFIX}
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
set_tests_properties(
|
|
${@RAUT_TARGET@_TESTS}
|
|
PROPERTIES TIMEOUT
|
|
@RAUT_TIMEOUT@
|
|
LABELS
|
|
"${_LABELS}"
|
|
FAIL_REGULAR_EXPRESSION
|
|
"${_FAIL_REGEX}"
|
|
PASS_REGULAR_EXPRESSION
|
|
"${_PASS_REGEX}"
|
|
SKIP_REGULAR_EXPRESSION
|
|
"${_SKIP_REGEX}"
|
|
ENVIRONMENT
|
|
"${_ENVIRONMENT}")
|
|
|
|
if(_DISABLED)
|
|
set_tests_properties(
|
|
${@RAUT_TARGET@_TESTS}
|
|
PROPERTIES DISABLED "${_DISABLED}")
|
|
endif()
|
|
|
|
if(_RESOURCE_LOCK)
|
|
set_tests_properties(
|
|
${@RAUT_TARGET@_TESTS}
|
|
PROPERTIES RESOURCE_LOCK "${_RESOURCE_LOCK}")
|
|
endif()
|
|
|
|
# Disable specific tests
|
|
set(_DISABLE_TESTS "@RAUT_DISABLE_TESTS@")
|
|
if(_DISABLE_TESTS)
|
|
set_tests_properties(
|
|
${_DISABLE_TESTS}
|
|
PROPERTIES DISABLED ON)
|
|
endif()
|