* Develop installation rules for time and stress tests (#6649) * Prepare `install` rule for time_tests * Prepare `install` rule for stress tests * Update path to `gflags`
This commit is contained in:
committed by
GitHub
parent
096a92dcb3
commit
bfdd1a199f
@@ -9,31 +9,14 @@ if (CMAKE_BUILD_TYPE STREQUAL "")
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
set (GFLAGS_IS_SUBPROJECT TRUE)
|
||||
set (HAVE_SYS_STAT_H 1)
|
||||
set (HAVE_INTTYPES_H 1)
|
||||
set (INTTYPES_FORMAT C99)
|
||||
set (BUILD_TESTING OFF)
|
||||
# Define directory where artifacts will be placed
|
||||
set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
find_package(InferenceEngineDeveloperPackage REQUIRED)
|
||||
|
||||
set(OpenVINO_MAIN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")
|
||||
|
||||
if(EXISTS "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/samples/thirdparty/gflags")
|
||||
function(add_gflags)
|
||||
if(NOT WIN32)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-all")
|
||||
endif()
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
add_subdirectory(${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/samples/thirdparty/gflags
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gflags_build
|
||||
EXCLUDE_FROM_ALL)
|
||||
set_target_properties(gflags_nothreads_static PROPERTIES FOLDER thirdparty)
|
||||
endfunction()
|
||||
add_gflags()
|
||||
endif()
|
||||
set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")
|
||||
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(unittests)
|
||||
add_subdirectory(memleaks_tests)
|
||||
add_subdirectory(memcheck_tests)
|
||||
|
||||
37
tests/stress_tests/common/CMakeLists.txt
Normal file
37
tests/stress_tests/common/CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(TARGET_NAME StressTestsCommon)
|
||||
|
||||
file (GLOB_RECURSE SRC *.cpp)
|
||||
file (GLOB_RECURSE HDR *.h)
|
||||
|
||||
add_library(${TARGET_NAME} STATIC ${SRC} ${HDR})
|
||||
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(EXISTS "${OpenVINO_SOURCE_DIR}/inference-engine/samples/thirdparty/gflags")
|
||||
function(add_gflags)
|
||||
set(GFLAGS_IS_SUBPROJECT TRUE)
|
||||
set(HAVE_SYS_STAT_H 1)
|
||||
set(HAVE_INTTYPES_H 1)
|
||||
set(INTTYPES_FORMAT C99)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
add_subdirectory(${OpenVINO_SOURCE_DIR}/inference-engine/samples/thirdparty/gflags
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gflags_build
|
||||
EXCLUDE_FROM_ALL)
|
||||
set_target_properties(gflags_nothreads_static PROPERTIES FOLDER thirdparty)
|
||||
endfunction()
|
||||
add_gflags()
|
||||
endif()
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
PUBLIC
|
||||
IE::gtest
|
||||
IE::pugixml
|
||||
${InferenceEngine_LIBRARIES}
|
||||
gflags
|
||||
PRIVATE
|
||||
IE::gtest_main)
|
||||
@@ -4,32 +4,20 @@
|
||||
|
||||
set (TARGET_NAME "MemCheckTests")
|
||||
|
||||
file (GLOB SRC
|
||||
../common/*.cpp
|
||||
../common/ie_pipelines/*.cpp
|
||||
*.cpp
|
||||
tests_pipelines/*.cpp)
|
||||
|
||||
file (GLOB HDR
|
||||
../common/*.h
|
||||
../common/ie_pipelines/*.h
|
||||
*.h
|
||||
tests_pipelines/*.h)
|
||||
file (GLOB_RECURSE SRC *.cpp)
|
||||
file (GLOB_RECURSE HDR *.h)
|
||||
|
||||
# Create library file from sources.
|
||||
add_executable(${TARGET_NAME} ${HDR} ${SRC})
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
IE::gtest
|
||||
IE::gtest_main
|
||||
IE::pugixml
|
||||
gflags
|
||||
${InferenceEngine_LIBRARIES}
|
||||
)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)
|
||||
|
||||
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${IE_MAIN_SOURCE_DIR}/thirdparty/pugixml/src")
|
||||
install(TARGETS ${TARGET_NAME}
|
||||
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
|
||||
# Copy local configs to BIN_FOLDER
|
||||
configure_file(local_configs/test_config.xml ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/memcheck_tests/test_config.xml COPYONLY)
|
||||
configure_file(local_configs/references_config.xml ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/memcheck_tests/references_config.xml COPYONLY)
|
||||
configure_file(local_configs/test_config.xml
|
||||
${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/memcheck_tests/test_config.xml COPYONLY)
|
||||
configure_file(local_configs/references_config.xml
|
||||
${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/memcheck_tests/references_config.xml COPYONLY)
|
||||
|
||||
@@ -4,33 +4,17 @@
|
||||
|
||||
set (TARGET_NAME "StressMemLeaksTests")
|
||||
|
||||
file (GLOB SRC
|
||||
../common/*.cpp
|
||||
../common/ie_pipelines/*.cpp
|
||||
*.cpp
|
||||
tests_pipelines/*.cpp)
|
||||
|
||||
file (GLOB HDR
|
||||
../common/*.h
|
||||
../common/managers/*.h
|
||||
../common/ie_pipelines/*.h
|
||||
*.h
|
||||
tests_pipelines/*.h)
|
||||
file (GLOB_RECURSE SRC *.cpp)
|
||||
file (GLOB_RECURSE HDR *.h)
|
||||
|
||||
# Create library file from sources.
|
||||
add_executable(${TARGET_NAME} ${HDR} ${SRC})
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
IE::gtest
|
||||
IE::gtest_main
|
||||
IE::pugixml
|
||||
gflags
|
||||
Threads::Threads
|
||||
${InferenceEngine_LIBRARIES}
|
||||
)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)
|
||||
|
||||
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${IE_MAIN_SOURCE_DIR}/thirdparty/pugixml/src")
|
||||
install(TARGETS ${TARGET_NAME}
|
||||
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
|
||||
# Copy local configs to BIN_FOLDER
|
||||
configure_file(local_configs/test_config.xml ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/memleaks_tests/test_config.xml COPYONLY)
|
||||
configure_file(local_configs/test_config.xml
|
||||
${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/memleaks_tests/test_config.xml COPYONLY)
|
||||
|
||||
@@ -4,33 +4,17 @@
|
||||
|
||||
set (TARGET_NAME "StressUnitTests")
|
||||
|
||||
file (GLOB SRC
|
||||
../common/*.cpp
|
||||
../common/ie_pipelines/*.cpp
|
||||
*.cpp
|
||||
tests_pipelines/*.cpp)
|
||||
|
||||
file (GLOB HDR
|
||||
../common/*.h
|
||||
../common/managers/*.h
|
||||
../common/ie_pipelines/*.h
|
||||
*.h
|
||||
tests_pipelines/*.h)
|
||||
file (GLOB_RECURSE SRC *.cpp)
|
||||
file (GLOB_RECURSE HDR *.h)
|
||||
|
||||
# Create library file from sources.
|
||||
add_executable(${TARGET_NAME} ${HDR} ${SRC})
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
IE::gtest
|
||||
IE::gtest_main
|
||||
IE::pugixml
|
||||
gflags
|
||||
Threads::Threads
|
||||
${InferenceEngine_LIBRARIES}
|
||||
)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)
|
||||
|
||||
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${IE_MAIN_SOURCE_DIR}/thirdparty/pugixml/src")
|
||||
install(TARGETS ${TARGET_NAME}
|
||||
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
|
||||
# Copy local configs to BIN_FOLDER
|
||||
configure_file(local_configs/test_config.xml ${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/unittests/test_config.xml COPYONLY)
|
||||
configure_file(local_configs/test_config.xml
|
||||
${OUTPUT_ROOT}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/stress_tests_configs/unittests/test_config.xml COPYONLY)
|
||||
|
||||
@@ -8,24 +8,18 @@ set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the build type")
|
||||
|
||||
project(time_tests)
|
||||
|
||||
set(OpenVINO_MAIN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")
|
||||
set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")
|
||||
|
||||
# Search OpenVINO Inference Engine installed
|
||||
find_package(InferenceEngine)
|
||||
if (NOT InferenceEngine_FOUND)
|
||||
# Search OpenVINO Inference Engine via InferenceEngine_DIR
|
||||
find_package(IEDevScripts
|
||||
PATHS "${OpenVINO_MAIN_SOURCE_DIR}/cmake/developer_package"
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
if (NOT InferenceEngine_FOUND)
|
||||
# Search OpenVINO Inference Engine via InferenceEngineDeveloperPackage_DIR
|
||||
# in order to provide backward compatibility with old OpenVINO packages
|
||||
set (HAVE_SYS_STAT_H 1)
|
||||
set (HAVE_INTTYPES_H 1)
|
||||
set (INTTYPES_FORMAT C99)
|
||||
find_package(InferenceEngineDeveloperPackage REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT InferenceEngine_FOUND)
|
||||
# Define directory where artifacts will be placed
|
||||
set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# Search OpenVINO Inference Engine via InferenceEngineDeveloperPackage_DIR
|
||||
# in order to provide backward compatibility with old OpenVINO packages
|
||||
find_package(InferenceEngineDeveloperPackage REQUIRED)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
@@ -16,4 +16,7 @@ foreach(test_source ${tests})
|
||||
target_link_libraries(${test_name} PRIVATE IE::inference_engine timetests_helper)
|
||||
|
||||
add_dependencies(time_tests ${test_name})
|
||||
|
||||
install(TARGETS ${test_name}
|
||||
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user