# 设置测试源文件 set(TEST_SOURCES AirportBoundsTest.cpp BasicCollisionTest.cpp CollisionDetectorTest.cpp TrafficLightDetectorTest.cpp SafetyZoneTest.cpp BasicTypesTest.cpp HTTPDataSourceTest.cpp DataCollectorTest.cpp ) # 创建测试可执行文件 add_executable(unit_tests ${TEST_SOURCES}) # 链接需要的库 target_link_libraries(unit_tests PRIVATE ${PROJECT_NAME}_lib GTest::gtest_main GTest::gmock_main ) # 添加测试 include(GoogleTest) gtest_discover_tests(unit_tests)