新增 Components 模块: - Component 基类 (生命周期、启用状态管理) - TransformComponent (本地/世界空间变换、矩阵缓存、父子层级) - GameObject (组件管理、父子层级、激活状态、静态查找) 新增 Scene 模块: - Scene (场景管理、对象创建销毁、查找、生命周期) - SceneManager (单例模式、多场景管理、场景切换) 新增测试: - test_component.cpp (12 个测试) - test_transform_component.cpp (35 个测试) - test_game_object.cpp (26 个测试) - test_scene.cpp (20 个测试) - test_scene_manager.cpp (17 个测试) 所有测试均已编译通过。
56 lines
1.5 KiB
CMake
56 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(XCEngineTests)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# ============================================================
|
|
# Test Configuration
|
|
# ============================================================
|
|
|
|
option(ENABLE_COVERAGE "Enable code coverage" OFF)
|
|
option(ENABLE_BENCHMARK "Enable benchmark tests" OFF)
|
|
|
|
# ============================================================
|
|
# Dependencies
|
|
# ============================================================
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
googletest
|
|
GIT_REPOSITORY https://gitee.com/mirrors/googletest.git
|
|
GIT_TAG v1.14.0
|
|
)
|
|
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
enable_testing()
|
|
|
|
# ============================================================
|
|
# Test Subdirectories
|
|
# ============================================================
|
|
|
|
add_subdirectory(math)
|
|
add_subdirectory(core)
|
|
add_subdirectory(containers)
|
|
add_subdirectory(memory)
|
|
add_subdirectory(threading)
|
|
add_subdirectory(debug)
|
|
add_subdirectory(Components)
|
|
add_subdirectory(Scene)
|
|
add_subdirectory(RHI)
|
|
add_subdirectory(RHI/D3D12)
|
|
add_subdirectory(RHI/OpenGL)
|
|
add_subdirectory(Resources)
|
|
|
|
# ============================================================
|
|
# Test Summary
|
|
# ============================================================
|
|
|
|
add_custom_target(print_tests
|
|
COMMAND ${CMAKE_COMMAND} -E echo "===== XCEngine Test Suite ====="
|
|
COMMAND ${CMAKE_CTEST_COMMAND} -N
|
|
COMMENT "Available tests:"
|
|
)
|