Skip to content

Commit

Permalink
Make stress tests dependent on IE gflags 3rdparty from samples/
Browse files Browse the repository at this point in the history
  • Loading branch information
vurusovs committed Jun 1, 2021
1 parent 11afa6a commit 8c5acb2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 36 deletions.
20 changes: 20 additions & 0 deletions tests/stress_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,31 @@ 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)

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()

add_subdirectory(unittests)
add_subdirectory(memleaks_tests)
add_subdirectory(memcheck_tests)
12 changes: 0 additions & 12 deletions tests/stress_tests/memcheck_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ file (GLOB HDR
# Create library file from sources.
add_executable(${TARGET_NAME} ${HDR} ${SRC})

include(FetchContent)
FetchContent_Declare(
gflags
GIT_REPOSITORY "https://github.com/gflags/gflags.git"
GIT_TAG "v2.2.2"
)
FetchContent_GetProperties(gflags)
if(NOT gflags_POPULATED)
FetchContent_Populate(gflags)
add_subdirectory(${gflags_SOURCE_DIR} ${gflags_BINARY_DIR})
endif()

target_link_libraries(${TARGET_NAME}
IE::gtest
IE::gtest_main
Expand Down
12 changes: 0 additions & 12 deletions tests/stress_tests/memleaks_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ file (GLOB HDR
# Create library file from sources.
add_executable(${TARGET_NAME} ${HDR} ${SRC})

include(FetchContent)
FetchContent_Declare(
gflags
GIT_REPOSITORY "https://github.com/gflags/gflags.git"
GIT_TAG "v2.2.2"
)
FetchContent_GetProperties(gflags)
if(NOT gflags_POPULATED)
FetchContent_Populate(gflags)
add_subdirectory(${gflags_SOURCE_DIR} ${gflags_BINARY_DIR})
endif()

target_link_libraries(${TARGET_NAME}
IE::gtest
IE::gtest_main
Expand Down
12 changes: 0 additions & 12 deletions tests/stress_tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ file (GLOB HDR
# Create library file from sources.
add_executable(${TARGET_NAME} ${HDR} ${SRC})

include(FetchContent)
FetchContent_Declare(
gflags
GIT_REPOSITORY "https://github.com/gflags/gflags.git"
GIT_TAG "v2.2.2"
)
FetchContent_GetProperties(gflags)
if(NOT gflags_POPULATED)
FetchContent_Populate(gflags)
add_subdirectory(${gflags_SOURCE_DIR} ${gflags_BINARY_DIR})
endif()

target_link_libraries(${TARGET_NAME}
IE::gtest
IE::gtest_main
Expand Down

0 comments on commit 8c5acb2

Please sign in to comment.