Skip to content

Commit

Permalink
Develop installation rules for time and stress tests (#6649)
Browse files Browse the repository at this point in the history
* Prepare `install` rule for time_tests

* Prepare `install` rule for stress tests
  • Loading branch information
vurusovs authored Jul 16, 2021
1 parent f1ab0b3 commit a92a737
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 25 deletions.
19 changes: 3 additions & 16 deletions tests/stress_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,13 @@ if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release")
endif()

# Define directory where artifacts will be placed
set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

find_package(InferenceEngineDeveloperPackage REQUIRED)

set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")

if(EXISTS "${OpenVINO_SOURCE_DIR}/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}/thirdparty/gflags
${CMAKE_CURRENT_BINARY_DIR}/gflags_build
EXCLUDE_FROM_ALL)
set_target_properties(gflags_nothreads_static PROPERTIES FOLDER thirdparty)
endfunction()
add_gflags()
endif()

add_subdirectory(common)
add_subdirectory(unittests)
add_subdirectory(memleaks_tests)
Expand Down
17 changes: 17 additions & 0 deletions tests/stress_tests/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,27 @@ add_library(${TARGET_NAME} STATIC ${SRC} ${HDR})

target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

if(EXISTS "${OpenVINO_SOURCE_DIR}/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}/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)
5 changes: 4 additions & 1 deletion tests/stress_tests/memcheck_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ file (GLOB_RECURSE HDR *.h)
add_executable(${TARGET_NAME} ${HDR} ${SRC})

target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon gflags)
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)

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
Expand Down
5 changes: 4 additions & 1 deletion tests/stress_tests/memleaks_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ file (GLOB_RECURSE HDR *.h)
# Create library file from sources.
add_executable(${TARGET_NAME} ${HDR} ${SRC})

target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon gflags)
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)

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
Expand Down
5 changes: 4 additions & 1 deletion tests/stress_tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ file (GLOB_RECURSE HDR *.h)
# Create library file from sources.
add_executable(${TARGET_NAME} ${HDR} ${SRC})

target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon gflags)
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)

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
Expand Down
9 changes: 3 additions & 6 deletions tests/time_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ project(time_tests)

set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")

# Search OpenVINO Inference Engine via InferenceEngine_DIR
find_package(IEDevScripts REQUIRED
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)

# Search OpenVINO Inference Engine installed
find_package(InferenceEngine)

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)
Expand Down
3 changes: 3 additions & 0 deletions tests/time_tests/src/timetests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit a92a737

Please sign in to comment.