Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWDEV-332251 - hip-tests: add catch commithash to the txt file #80

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions catch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ list(GET VERSION_LIST 2 HIP_VERSION_PATCH_GITHASH)
string(REPLACE "-" ";" VERSION_LIST ${HIP_VERSION_PATCH_GITHASH})
list(GET VERSION_LIST 0 HIP_VERSION_PATCH)

# get catch commit short hash
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE git_result
OUTPUT_VARIABLE git_output
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(git_result EQUAL 0)
set(CATCH_GITHASH ${git_output})
endif()

if(NOT DEFINED CATCH2_PATH)
if(DEFINED ENV{CATCH2_PATH})
set(CATCH2_PATH $ENV{CATCH2_PATH} CACHE STRING "Catch2 Path")
Expand Down Expand Up @@ -203,6 +213,7 @@ message(STATUS "Using offload arch string: ${OFFLOAD_ARCH_STR}")
string(TIMESTAMP _timestamp UTC)
set(_catchInfo "# Auto-generated by cmake on ${_timestamp} UTC\n")
set(_catchInfo ${_catchInfo} "HIP_VERSION=${HIP_VERSION}\n")
set(_catchInfo ${_catchInfo} "CATCH_GITHASH=${CATCH_GITHASH}\n")
set(_catchInfo ${_catchInfo} "HIP_PLATFORM=${HIP_PLATFORM}\n")
set(_catchInfo ${_catchInfo} "ARCHS=${HIP_GPU_ARCH_LIST}\n")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${CATCH_BUILD_DIR}/catchInfo.txt ${_catchInfo})
Expand Down
17 changes: 16 additions & 1 deletion catch/packaging/hip-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,27 @@ set(CPACK_PACKAGE_DESCRIPTION "HIP:
Heterogenous-computing Interface for Portability [CATCH TESTS]")
set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.")
set(CPACK_PACKAGE_CONTACT "HIP Support <[email protected]>")
set(CPACK_PACKAGE_VERSION @HIP_VERSION_MAJOR@.@HIP_VERSION_MINOR@.@HIP_VERSION_PATCH_GITHASH@)
if (DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
set(CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
else()
set(CPACK_DEBIAN_PACKAGE_RELEASE "local")
endif()
if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE})
set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE})
else()
set(CPACK_RPM_PACKAGE_RELEASE "local")
endif()
set(ROCM_VERSION_FOR_PACKAGE "99999")
if(DEFINED ENV{ROCM_LIBPATCH_VERSION})
set(ROCM_VERSION_FOR_PACKAGE $ENV{ROCM_LIBPATCH_VERSION})
endif()

# to remove hip-catch-* package during uninstallation of rocm
set (CPACK_DEBIAN_PACKAGE_DEPENDS "rocm-core")
set (CPACK_RPM_PACKAGE_REQUIRES "rocm-core")

set(CPACK_PACKAGE_VERSION @HIP_VERSION_MAJOR@.@HIP_VERSION_MINOR@.@HIP_VERSION_PATCH@.${ROCM_VERSION_FOR_PACKAGE})

if(NOT WIN32)
set(CPACK_GENERATOR "TGZ;DEB;RPM" CACHE STRING "Linux package types for catch tests")
set(CPACK_BINARY_DEB "ON")
Expand Down