From 561cc5f2cd78872ba488125790dc51621bf86b2b Mon Sep 17 00:00:00 2001 From: Vladislav Dronov Date: Mon, 18 May 2026 16:56:56 +0200 Subject: [PATCH 1/2] Make test binaries and test data installable Build gtest library as static, build tests with it and make test executables installable artifacts. Make test dataset used by the test binaries installable as well. Signed-off-by: Vladislav Dronov --- tools/CMakeLists.txt | 17 +++++++++++++++++ tools/tests/cross_tests/CMakeLists.txt | 5 +++++ tools/tests/functional/CMakeLists.txt | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f01739600..f162f330a 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -17,11 +17,28 @@ endif() if (QPL_BUILD_TESTS) add_subdirectory(ref) add_subdirectory(utils) + + # Build third-party google-test library required for tests + # Build it without clang-tidy checks set(TEMP_CMAKE_CXX_CLANG_TIDY ${CMAKE_CXX_CLANG_TIDY}) set(CMAKE_CXX_CLANG_TIDY "") + # Save the main project's current shared/static preference + set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + # Force google-test library to build as STATIC + set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE) + # Disable google-test's internal tests to speed up the build + set(gtest_build_tests OFF CACHE BOOL "Build gtest tests" FORCE) + # Add the subdirectory creating the 'gtest' and 'gtest_main' targets add_subdirectory(third-party/google-test EXCLUDE_FROM_ALL) + # Restore the original shared/static preference for the rest of the project + set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libraries" FORCE) + # Restore the original clang-tidy preference set(CMAKE_CXX_CLANG_TIDY ${TEMP_CMAKE_CXX_CLANG_TIDY}) + add_subdirectory(tests) + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/testdata + DESTINATION share/${CMAKE_PROJECT_NAME} + COMPONENT RUNTIME) if (UNIX) # Disable building google-benchmarks tests SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE) diff --git a/tools/tests/cross_tests/CMakeLists.txt b/tools/tests/cross_tests/CMakeLists.txt index 8b3b130b0..6d63c391c 100644 --- a/tools/tests/cross_tests/CMakeLists.txt +++ b/tools/tests/cross_tests/CMakeLists.txt @@ -14,6 +14,8 @@ file(GLOB SOURCES *.cpp) add_executable(cross_tests ${SOURCES}) qpl_set_common_target_settings(cross_tests) +set_target_properties(cross_tests PROPERTIES + OUTPUT_NAME qpl-cross-tests) get_target_property(QPL_SOURCE_DIR qpl SOURCE_DIR) @@ -31,3 +33,6 @@ target_link_libraries(cross_tests target_compile_definitions(cross_tests PRIVATE $) target_compile_options(cross_tests PRIVATE $) + +install(TARGETS cross_tests + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/tools/tests/functional/CMakeLists.txt b/tools/tests/functional/CMakeLists.txt index 806a94422..b82509081 100644 --- a/tools/tests/functional/CMakeLists.txt +++ b/tools/tests/functional/CMakeLists.txt @@ -22,6 +22,8 @@ add_executable(tests main.cpp $) qpl_set_common_target_settings(tests) +set_target_properties(tests PROPERTIES + OUTPUT_NAME qpl-func-tests) get_property(LIB_DEPS GLOBAL PROPERTY QPL_LIB_DEPS) @@ -41,6 +43,9 @@ target_compile_definitions(tests target_compile_options(tests PRIVATE $) +install(TARGETS tests + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + # Test groups that run under target: make test # Smoke tests are a group of small number of tests that can run in a few seconds on any HW. From 1d95dbcc82e81df9baef481c49049e07f7e9e689 Mon Sep 17 00:00:00 2001 From: Vladislav Dronov Date: Tue, 19 May 2026 17:31:43 +0200 Subject: [PATCH 2/2] Fix a small shebang issue Signed-off-by: Vladislav Dronov --- tools/scripts/accel_conf.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/scripts/accel_conf.sh b/tools/scripts/accel_conf.sh index d5fe2fb52..4d4f899f9 100755 --- a/tools/scripts/accel_conf.sh +++ b/tools/scripts/accel_conf.sh @@ -1,3 +1,4 @@ +#!/bin/bash # ========================================================================== # Copyright (C) 2022 Intel Corporation #