2026-03-13 18:43:14 +08:00
|
|
|
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)
|
feat: 实现Containers、Memory、Threading核心模块及单元测试
- Containers: String, Array, HashMap 容器实现及测试
- Memory: Allocator, LinearAllocator, PoolAllocator, ProxyAllocator, MemoryManager 实现及测试
- Threading: Mutex, SpinLock, ReadWriteLock, Thread, Task, TaskSystem 实现及测试
- 修复Windows平台兼容性: _aligned_malloc, std::hash特化
- 修复构建错误和测试用例问题
2026-03-13 20:37:08 +08:00
|
|
|
add_subdirectory(core)
|
|
|
|
|
add_subdirectory(containers)
|
|
|
|
|
add_subdirectory(memory)
|
|
|
|
|
add_subdirectory(threading)
|
feat: 实现日志与调试系统(Debug模块)
- LogLevel: 日志级别枚举 (Verbose, Debug, Info, Warning, Error, Fatal)
- LogCategory: 日志分类 (General, Rendering, Physics, Memory, Threading等)
- ILogSink: 日志输出接口
- ConsoleLogSink: 控制台输出, 支持Windows颜色
- FileLogSink: 文件日志输出
- FileWriter: 文件写入器
- Logger: 日志管理器, 支持多sink, 分类控制
- Profiler: 性能分析器
- 单元测试覆盖
2026-03-13 20:53:57 +08:00
|
|
|
add_subdirectory(debug)
|
refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency
- Fix OpenGL unit test GLAD initialization by using gladLoadGL()
instead of gladLoadGLLoader(wglGetProcAddress) for fallback support
- Migrate remaining tests to use gtest_discover_tests for granular
test discovery (math, core, containers, memory, threading, debug,
components, scene, resources, input, opengl)
- Remove obsolete TEST_RESOURCES_DIR and copy_directory commands
from OpenGL unit test CMakeLists (minimal/Res doesn't exist)
- Update TEST_SPEC.md with performance metrics and per-module
build/test commands for faster development workflow
- Update CMake path references to use lowercase paths
2026-03-23 00:43:02 +08:00
|
|
|
add_subdirectory(components)
|
|
|
|
|
add_subdirectory(scene)
|
2026-03-26 20:14:58 +08:00
|
|
|
add_subdirectory(scripting)
|
|
|
|
|
add_subdirectory(Rendering)
|
refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency
- Fix OpenGL unit test GLAD initialization by using gladLoadGL()
instead of gladLoadGLLoader(wglGetProcAddress) for fallback support
- Migrate remaining tests to use gtest_discover_tests for granular
test discovery (math, core, containers, memory, threading, debug,
components, scene, resources, input, opengl)
- Remove obsolete TEST_RESOURCES_DIR and copy_directory commands
from OpenGL unit test CMakeLists (minimal/Res doesn't exist)
- Update TEST_SPEC.md with performance metrics and per-module
build/test commands for faster development workflow
- Update CMake path references to use lowercase paths
2026-03-23 00:43:02 +08:00
|
|
|
add_subdirectory(rhi)
|
|
|
|
|
add_subdirectory(resources)
|
|
|
|
|
add_subdirectory(input)
|
2026-03-17 02:51:34 +08:00
|
|
|
|
2026-03-13 18:43:14 +08:00
|
|
|
# ============================================================
|
|
|
|
|
# Test Summary
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
|
|
|
|
add_custom_target(print_tests
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "===== XCEngine Test Suite ====="
|
|
|
|
|
COMMAND ${CMAKE_CTEST_COMMAND} -N
|
|
|
|
|
COMMENT "Available tests:"
|
|
|
|
|
)
|