Skip to content

Commit

Permalink
Add googletest to known_good.json
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-lunarg committed Aug 23, 2023
1 parent 58df5a5 commit 94a7eda
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ add_definitions(-DVK_ENABLE_BETA_EXTENSIONS)
include(GNUInstallDirs)

set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH};${VULKAN_HEADERS_INSTALL_DIR};${VULKAN_LOADER_INSTALL_DIR};${VULKAN_VALIDATIONLAYERS_INSTALL_DIR};${JSONCPP_INSTALL_DIR})
if (GOOGLETEST_INSTALL_DIR)
list(APPEND CMAKE_PREFIX_PATH ${GOOGLETEST_INSTALL_DIR})
endif()

file(TO_CMAKE_PATH "${VULKAN_VALIDATIONLAYERS_INSTALL_DIR}" VULKAN_VALIDATIONLAYERS_INSTALL_DIR)
set(Vulkan-ValidationLayers_INCLUDE_DIR "${VULKAN_VALIDATIONLAYERS_INSTALL_DIR}/include/vulkan")
Expand Down Expand Up @@ -89,6 +92,8 @@ endif()
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)

find_package(GTest REQUIRED CONFIG)
endif()

if(BUILD_VIA)
Expand All @@ -103,9 +108,6 @@ endif()
if(BUILD_LAYERMGR)
include_directories(external)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(external/googletest)

add_subdirectory(vkconfig_core)
add_subdirectory(vkconfig)
endif()
19 changes: 18 additions & 1 deletion scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,30 @@
"-DJSONCPP_WITH_WARNING_AS_ERROR=OFF",
"-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF"
]
},
{
"name": "googletest",
"url": "https://github.com/google/googletest.git",
"sub_dir": "googletest",
"build_dir": "googletest/build",
"install_dir": "googletest/build/install",
"cmake_options": [
"-DBUILD_GMOCK=OFF",
"-Dgtest_force_shared_crt=ON",
"-DBUILD_SHARED_LIBS=OFF"
],
"commit": "ec4fed93217bc2830959bb8e86798c1d86956949",
"optional": [
"tests"
]
}
],
"install_names": {
"Vulkan-Headers": "VULKAN_HEADERS_INSTALL_DIR",
"Vulkan-Utility-Libraries": "VULKAN_UTILITY_LIBRARIES_INSTALL_DIR",
"Vulkan-Loader": "VULKAN_LOADER_INSTALL_DIR",
"Vulkan-ValidationLayers": "VULKAN_VALIDATIONLAYERS_INSTALL_DIR",
"jsoncpp": "JSONCPP_INSTALL_DIR"
"jsoncpp": "JSONCPP_INSTALL_DIR",
"googletest": "GOOGLETEST_INSTALL_DIR"
}
}
11 changes: 9 additions & 2 deletions vkconfig_core/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ function(vkConfigTest NAME)
source_group("Test Files" FILES ${FILES_JSON} ${FILES_TEXT})

add_executable(${TEST_NAME} ${TEST_FILE} ${FILES_JSON} ${FILES_TEXT} resources.qrc)
target_link_libraries(${TEST_NAME} vkconfig_core gtest gtest_main Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)
target_link_libraries(${TEST_NAME} vkconfig_core
GTest::gtest
GTest::gtest_main
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Network
)
if(WIN32)
target_link_libraries(${TEST_NAME} Cfgmgr32)
endif()
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
endfunction(vkConfigTest)
endfunction()

vkConfigTest(test_date)
vkConfigTest(test_util)
Expand Down

0 comments on commit 94a7eda

Please sign in to comment.