- LogLevel: 日志级别枚举 (Verbose, Debug, Info, Warning, Error, Fatal) - LogCategory: 日志分类 (General, Rendering, Physics, Memory, Threading等) - ILogSink: 日志输出接口 - ConsoleLogSink: 控制台输出, 支持Windows颜色 - FileLogSink: 文件日志输出 - FileWriter: 文件写入器 - Logger: 日志管理器, 支持多sink, 分类控制 - Profiler: 性能分析器 - 单元测试覆盖
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()
|
|
|
|
# ============================================================
|
|
# Engine Library
|
|
# ============================================================
|
|
|
|
add_subdirectory(../engine engine)
|
|
|
|
# ============================================================
|
|
# Test Subdirectories
|
|
# ============================================================
|
|
|
|
add_subdirectory(math)
|
|
add_subdirectory(core)
|
|
add_subdirectory(containers)
|
|
add_subdirectory(memory)
|
|
add_subdirectory(threading)
|
|
add_subdirectory(debug)
|
|
|
|
# ============================================================
|
|
# Test Summary
|
|
# ============================================================
|
|
|
|
add_custom_target(print_tests
|
|
COMMAND ${CMAKE_COMMAND} -E echo "===== XCEngine Test Suite ====="
|
|
COMMAND ${CMAKE_CTEST_COMMAND} -N
|
|
COMMENT "Available tests:"
|
|
)
|