mirror of
https://github.com/m1ngsama/TUT.git
synced 2026-02-08 00:54:05 +00:00
Major architectural refactoring from ncurses to FTXUI framework with professional engineering structure. Project Structure: - src/core/: Browser engine, URL parser, HTTP client - src/ui/: FTXUI components (main window, address bar, content view, panels) - src/renderer/: HTML renderer, text formatter, style parser - src/utils/: Logger, config manager, theme manager - tests/unit/: Unit tests for core components - tests/integration/: Integration tests - assets/: Default configs, themes, keybindings New Features: - btop-style four-panel layout with rounded borders - TOML-based configuration system - Multiple color themes (default, nord, gruvbox, solarized) - Comprehensive logging system - Modular architecture with clear separation of concerns Build System: - Updated CMakeLists.txt for modular build - Prefer system packages (Homebrew) over FetchContent - Google Test integration for testing - Version info generation via cmake/version.hpp.in Configuration: - Default config.toml with browser settings - Four built-in themes - Default keybindings configuration - Config stored in ~/.config/tut/ Removed: - Legacy v1 source files (ncurses-based) - Old render/ directory - Duplicate and obsolete test files - Old documentation files Binary: ~827KB (well under 5MB goal) Dependencies: FTXUI, cpp-httplib, toml11, gumbo-parser, OpenSSL
58 lines
1.6 KiB
CMake
58 lines
1.6 KiB
CMake
# tests/CMakeLists.txt
|
|
# TUT 测试配置
|
|
|
|
# ============================================================================
|
|
# 单元测试
|
|
# ============================================================================
|
|
|
|
# URL 解析器测试
|
|
add_executable(test_url_parser
|
|
unit/test_url_parser.cpp
|
|
)
|
|
target_link_libraries(test_url_parser PRIVATE
|
|
tut_lib
|
|
GTest::gtest_main
|
|
)
|
|
add_test(NAME UrlParserTest COMMAND test_url_parser)
|
|
|
|
# HTTP 客户端测试
|
|
add_executable(test_http_client
|
|
unit/test_http_client.cpp
|
|
)
|
|
target_link_libraries(test_http_client PRIVATE
|
|
tut_lib
|
|
GTest::gtest_main
|
|
)
|
|
add_test(NAME HttpClientTest COMMAND test_http_client)
|
|
|
|
# HTML 渲染器测试
|
|
add_executable(test_html_renderer
|
|
unit/test_html_renderer.cpp
|
|
)
|
|
target_link_libraries(test_html_renderer PRIVATE
|
|
tut_lib
|
|
GTest::gtest_main
|
|
)
|
|
add_test(NAME HtmlRendererTest COMMAND test_html_renderer)
|
|
|
|
# ============================================================================
|
|
# 集成测试
|
|
# ============================================================================
|
|
|
|
add_executable(test_browser_engine
|
|
integration/test_browser_engine.cpp
|
|
)
|
|
target_link_libraries(test_browser_engine PRIVATE
|
|
tut_lib
|
|
GTest::gtest_main
|
|
)
|
|
add_test(NAME BrowserEngineTest COMMAND test_browser_engine)
|
|
|
|
# ============================================================================
|
|
# 测试发现
|
|
# ============================================================================
|
|
include(GoogleTest)
|
|
gtest_discover_tests(test_url_parser)
|
|
gtest_discover_tests(test_http_client)
|
|
gtest_discover_tests(test_html_renderer)
|
|
gtest_discover_tests(test_browser_engine)
|