gui: real RTL + no-download-logic checks; split into velox-gui-lib
Follow-up hardening after a review noted the RTL "check" verified nothing (a .ts stub that no test loads), matching a session-wide pattern of checks written against what should be true rather than what would break. - Split the non-main() code into velox-gui-lib (STATIC) so tests link the real widgets/models, not a reimplementation. - tst_rtl: builds the real MainWindow, flips layoutDirection, asserts the direction propagates to the central widget AND that the offline-banner QHBoxLayout actually mirrors (label x-position LTR vs RTL differs by >100px). Verified it fails when the banner is pinned LtR. - gui_no_download_logic: a ctest that greps gui/src for curl_*/pwrite/ sqlite/QSqlDatabase/QNetworkAccessManager and fails on a hit — CLAUDE.md §3 as an executable check. Verified it fails when a curl_ token is added. - Still uncovered (noted, not claimed): that the translation catalogue loads and the right context/strings resolve at runtime. Not covered here because the files are PKG/QA-owned: tools/bootstrap.sh ships a package name that does not exist on 26.04 (libqt6svg6-dev; the real one is qt6-svg-dev), and --check validates pkg-config outcomes rather than the apt names it would install. Both, plus the same name in AGENT-PKG-QA.md and the README, are written up apply-ready in gui/docs/pkg-qa-requests-m1.md. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Ne28kx4VreeBWZv82Nksd
This commit is contained in:
+19
-23
@@ -1,24 +1,24 @@
|
||||
# velox-gui — the Qt 6 Widgets client. Lane GUI.
|
||||
#
|
||||
# CLAUDE.md §3: zero download logic here. This target links libveloxproto (the wire
|
||||
# types, ADR 0009) and NEVER libveloxcore — a grep for curl|pwrite|sqlite under gui/
|
||||
# must come back empty.
|
||||
# types, ADR 0009) and NEVER libveloxcore — enforced by tests/ (see the
|
||||
# gui_no_download_logic test).
|
||||
#
|
||||
# The root CMakeLists.txt add_subdirectory()s this unconditionally once the file exists,
|
||||
# so it must stay configurable even before CORE has landed veloxproto. Until that target
|
||||
# exists we announce and bail; the moment `core/` merges its libveloxproto, the GUI
|
||||
# lights up with no edit here (same contract as the root file's EXISTS() guards).
|
||||
# so it must stay configurable even if veloxproto is ever absent again. Until that target
|
||||
# exists we announce and bail.
|
||||
|
||||
if(NOT TARGET veloxproto)
|
||||
message(STATUS "velox-gui: libveloxproto has not landed yet — GUI target skipped. "
|
||||
"It builds automatically once core/ merges the veloxproto target (ADR 0009).")
|
||||
message(STATUS "velox-gui: libveloxproto target missing — GUI target skipped. "
|
||||
"It builds automatically once core/ provides the veloxproto target (ADR 0009).")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
add_executable(velox-gui
|
||||
src/main.cpp
|
||||
# Everything except main() lives in a static lib so the tests can link the real widgets
|
||||
# and models rather than a reimplementation.
|
||||
add_library(velox-gui-lib STATIC
|
||||
src/rpc/RpcConnection.cpp
|
||||
src/rpc/RpcClient.cpp
|
||||
src/models/DownloadTableModel.cpp
|
||||
@@ -26,29 +26,25 @@ add_executable(velox-gui
|
||||
src/mainwindow/MainWindow.cpp
|
||||
)
|
||||
|
||||
target_include_directories(velox-gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
target_compile_features(velox-gui PRIVATE cxx_std_23)
|
||||
|
||||
# Warnings at target scope, not via CMAKE_CXX_FLAGS — the dev/tsan presets overwrite that
|
||||
# cache variable wholesale (same rationale as core/CMakeLists.txt).
|
||||
target_compile_options(velox-gui PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
|
||||
target_link_libraries(velox-gui PRIVATE
|
||||
target_include_directories(velox-gui-lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
target_compile_features(velox-gui-lib PUBLIC cxx_std_23)
|
||||
target_compile_options(velox-gui-lib PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(velox-gui-lib PUBLIC
|
||||
velox::proto
|
||||
Qt6::Widgets
|
||||
Qt6::Svg
|
||||
Qt6::Network
|
||||
)
|
||||
|
||||
set_target_properties(velox-gui PROPERTIES
|
||||
WIN32_EXECUTABLE OFF
|
||||
MACOSX_BUNDLE OFF
|
||||
)
|
||||
add_executable(velox-gui src/main.cpp)
|
||||
target_compile_options(velox-gui PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(velox-gui PRIVATE velox-gui-lib)
|
||||
set_target_properties(velox-gui PROPERTIES WIN32_EXECUTABLE OFF MACOSX_BUNDLE OFF)
|
||||
|
||||
# --- i18n -------------------------------------------------------------------------------
|
||||
# Every string in the GUI goes through tr(); the Arabic stub exists to prove the RTL
|
||||
# layout survives (GUI DoD). lrelease/lupdate come from Qt6::LinguistTools, found by root.
|
||||
# layout survives (GUI DoD), exercised by tests/tst_rtl. lrelease also drops the .qm at
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}/velox_ar.qm, which the RTL test loads by path.
|
||||
qt_add_translations(velox-gui TS_FILES i18n/velox_ar.ts)
|
||||
|
||||
# --- tests ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user