add plugin camera desktop

This commit is contained in:
kyo
2026-06-22 09:39:31 +07:00
parent 92daeef0c5
commit 5407afbd6e
144 changed files with 15900 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
find_package(GTest QUIET)
if(NOT GTest_FOUND)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
endif()
set(TEST_BINARY "camera_desktop_plugin_test")
add_executable(${TEST_BINARY}
camera_desktop_plugin_test.cc
)
target_compile_features(${TEST_BINARY} PRIVATE cxx_std_14)
target_include_directories(${TEST_BINARY} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/.."
)
target_link_libraries(${TEST_BINARY} PRIVATE
camera_desktop_plugin
flutter
GTest::gtest_main
GTest::gmock
)
include(GoogleTest)
gtest_discover_tests(${TEST_BINARY})

View File

@@ -0,0 +1,20 @@
#include <flutter_linux/flutter_linux.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "include/camera_desktop/camera_desktop_plugin.h"
namespace camera_desktop {
namespace test {
TEST(CameraDesktopPlugin, PluginRegistration) {
// Verify the plugin registration function exists and is callable.
// Full lifecycle testing requires a running Flutter engine, so this
// just validates the symbol is exported.
EXPECT_NE(
reinterpret_cast<void*>(&camera_desktop_plugin_register_with_registrar),
nullptr);
}
} // namespace test
} // namespace camera_desktop