Skip to content
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
17 changes: 17 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tools/scripts/accel_conf.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# ==========================================================================
# Copyright (C) 2022 Intel Corporation
#
Expand Down
5 changes: 5 additions & 0 deletions tools/tests/cross_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -31,3 +33,6 @@ target_link_libraries(cross_tests

target_compile_definitions(cross_tests PRIVATE $<TARGET_PROPERTY:tests_common,COMPILE_DEFINITIONS>)
target_compile_options(cross_tests PRIVATE $<TARGET_PROPERTY:tests_common,COMPILE_OPTIONS>)

install(TARGETS cross_tests
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
5 changes: 5 additions & 0 deletions tools/tests/functional/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ add_executable(tests main.cpp
$<TARGET_OBJECTS:unit_tests>)

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)

Expand All @@ -41,6 +43,9 @@ target_compile_definitions(tests
target_compile_options(tests
PRIVATE $<TARGET_PROPERTY:tests_common,COMPILE_OPTIONS>)

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.
Expand Down