chores: Fetch googletest via CMake (#4252)

This commit is contained in:
Raphael Coeffic
2023-10-27 19:26:22 +10:00
committed by GitHub
parent c85b444a14
commit 44981ad1f5
6 changed files with 33 additions and 35 deletions
+9 -4
View File
@@ -1,9 +1,14 @@
if(GTEST_INCDIR AND GTEST_SRCDIR AND Qt5Widgets_FOUND)
add_library(gtests-companion-lib STATIC EXCLUDE_FROM_ALL ${GTEST_SRCDIR}/src/gtest-all.cc )
target_include_directories(gtests-companion-lib PUBLIC ${GTEST_INCDIR} ${GTEST_INCDIR}/gtest ${GTEST_SRCDIR})
if(Qt5Widgets_FOUND)
add_library(gtests-companion-lib STATIC EXCLUDE_FROM_ALL
${googletest_SOURCE_DIR}/googletest/src/gtest-all.cc
)
target_include_directories(gtests-companion-lib PRIVATE
${googletest_SOURCE_DIR}/googletest
)
add_definitions(-DGTESTS)
set(TESTS_PATH ${COMPANION_SRC_DIRECTORY}/tests)
set(RADIO_TESTS_PATH ${RADIO_SRC_DIR}/tests)
configure_file(${TESTS_PATH}/location.h.in ${CMAKE_CURRENT_BINARY_DIR}/location.h @ONLY)
@@ -25,5 +30,5 @@ if(GTEST_INCDIR AND GTEST_SRCDIR AND Qt5Widgets_FOUND)
target_link_libraries(gtests-companion gtests-companion-lib simulation firmwares storage common)
message(STATUS "Added optional gtests-companion target")
else()
message(WARNING "WARNING: gtests target will not be available (check that GTEST_INCDIR, GTEST_SRCDIR, and Qt5Widgets are configured).")
message(WARNING "WARNING: gtests target will not be available (check that Qt5Widgets are configured).")
endif()
-2
View File
@@ -251,7 +251,6 @@ TEST(Conversions, ConversionX10From22)
EXPECT_EQ(Board::SWITCH_3POS, settings.switchConfig[0]);
EXPECT_STREQ("BT_X10", settings.bluetoothName);
EXPECT_STREQ("EdgeTX", settings.themeData.themeName);
#if !defined(USE_ETX)
byteBuffer.clear();
@@ -328,7 +327,6 @@ TEST(Conversions, ConversionX12SFrom22)
EXPECT_EQ(Board::SWITCH_3POS, settings.switchConfig[0]);
EXPECT_STREQ("BT", settings.bluetoothName);
EXPECT_STREQ("EdgeTX", settings.themeData.themeName);
#if !defined(USE_ETX)
byteBuffer.clear();