From b2f3b86f5ba18ca4526c95c579eadc82ba18a025 Mon Sep 17 00:00:00 2001 From: Branislav Brzak Date: Fri, 8 Mar 2024 12:41:34 +0100 Subject: [PATCH] SWDEV-447357 - Implement test coverage report integration Change-Id: I9daa851dc2b86c3400dea700f01f5ad65bd119a1 [ROCm/hip-tests commit: 5fd4f31995ab551fbd3dda78092b9d6105c4949f] --- projects/hip-tests/.gitignore | 6 ++++++ projects/hip-tests/catch/CMakeLists.txt | 6 ++++++ projects/hip-tests/utils/coverage/Makefile | 6 ++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/projects/hip-tests/.gitignore b/projects/hip-tests/.gitignore index 4a76ca2cf4..029ed76f3a 100644 --- a/projects/hip-tests/.gitignore +++ b/projects/hip-tests/.gitignore @@ -14,3 +14,9 @@ samples/0_Intro/module_api/vcpy_kernel.co samples/0_Intro/module_api/vcpy_kernel.code samples/1_Utils/hipInfo/hipInfo samples/1_Utils/hipDispatchLatency/hipDispatchLatency + +utils/coverage/generateHipAPICoverage +utils/coverage/CoverageReport.xml +utils/coverage/coverageReportHTML/CoverageReport.html +utils/coverage/coverageReportHTML/testAPIs +utils/coverage/coverageReportHTML/testModules diff --git a/projects/hip-tests/catch/CMakeLists.txt b/projects/hip-tests/catch/CMakeLists.txt index 7766df816c..0f852cc91b 100644 --- a/projects/hip-tests/catch/CMakeLists.txt +++ b/projects/hip-tests/catch/CMakeLists.txt @@ -303,6 +303,12 @@ add_subdirectory(perftests ${CATCH_BUILD_DIR}/perftests) add_subdirectory(multiproc ${CATCH_BUILD_DIR}/multiproc) add_subdirectory(performance ${CATCH_BUILD_DIR}/performance) +add_custom_target(gen_coverage + COMMAND ${CMAKE_MAKE_PROGRAM} default_target + COMMAND ./generateHipAPICoverage ${HIP_PATH}/include + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../utils/coverage + COMMENT "Generating Test Coverage Report") + cmake_policy(POP) # packaging the tests diff --git a/projects/hip-tests/utils/coverage/Makefile b/projects/hip-tests/utils/coverage/Makefile index f81c71037d..8c04063b67 100644 --- a/projects/hip-tests/utils/coverage/Makefile +++ b/projects/hip-tests/utils/coverage/Makefile @@ -26,8 +26,10 @@ OBJ=generateHipAPICoverage default_target: all .PHONY : default_target -all: ${SRC} - ${CC} ${CPPFLAGS} $^ -o ${OBJ} +all: ${OBJ} + +${OBJ}: ${SRC} + @${CC} ${CPPFLAGS} $^ -o ${OBJ} clean: rm -f ${OBJ}