Skip to content

Commit 4e94803

Browse files
committed
test(integration): add Qt missing-node detection tests
1 parent 13eb754 commit 4e94803

6 files changed

Lines changed: 799 additions & 0 deletions

tests/controllers/test_notebook_node_controller_reorder_stubs.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,9 @@ void NotebookNodeController::handleImportFolder(const NodeIdentifier &, const QS
3838
// Read-only gating helpers (read-only feature) — writable in tests.
3939
bool NotebookNodeController::isNotebookReadOnly(const QString &) const { return false; }
4040

41+
// T11 (missing-files-on-disk): setModel() now calls bindModelMissingSignal to
42+
// wire NotebookNodeModel::missingNodesDetected. The real definition lives in
43+
// notebooknodecontroller.cpp (not compiled here); a no-op satisfies the linker.
44+
void NotebookNodeController::bindModelMissingSignal(INodeListModel *) {}
45+
4146
} // namespace vnotex

tests/gui/test_notebook_node_view_reorder_stubs.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,9 @@ bool NotebookNodeController::isSelectionReadOnly(const QList<NodeIdentifier> &)
6363
return false;
6464
}
6565

66+
// T11 (missing-files-on-disk): setModel() now calls bindModelMissingSignal to
67+
// wire NotebookNodeModel::missingNodesDetected. The real definition lives in
68+
// notebooknodecontroller.cpp (not compiled here); a no-op satisfies the linker.
69+
void NotebookNodeController::bindModelMissingSignal(INodeListModel *) {}
70+
6671
} // namespace vnotex

tests/integration/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,42 @@ add_custom_command(TARGET test_reorder_edge_cases POST_BUILD
128128
$<TARGET_FILE_DIR:test_reorder_edge_cases>
129129
)
130130

131+
# T7 (missing-files-on-disk): SHARED Qt integration test for the missing-nodes
132+
# feature. Extended by T8/T9/T11. Surfaces VXCORE_ERR_NODE_NOT_EXISTS through
133+
# the BufferCoreService / BufferService open-buffer out-param. Uses the real
134+
# NotebookCoreService + BufferService against real vxcore + on-disk notebooks
135+
# (no mocks). GUILESS — no widgets, just QCoreApplication for the services.
136+
add_qt_test(test_missing_nodes_qt
137+
SOURCES
138+
test_missing_nodes_qt.cpp
139+
test_missing_nodes_qt_controller_stubs.cpp
140+
${CMAKE_SOURCE_DIR}/src/models/notebooknodemodel.cpp
141+
${CMAKE_SOURCE_DIR}/src/controllers/notebooknodecontroller.cpp
142+
${CMAKE_SOURCE_DIR}/src/controllers/notebooknodecontroller_reorder.cpp
143+
${CMAKE_SOURCE_DIR}/src/controllers/notebooknodecontroller.h
144+
LINKS
145+
Qt6::Core
146+
Qt6::Widgets
147+
core_configs
148+
core_services
149+
vxcore
150+
VTextEdit
151+
GUILESS
152+
)
153+
target_include_directories(test_missing_nodes_qt PRIVATE
154+
${CMAKE_SOURCE_DIR}/src
155+
${CMAKE_SOURCE_DIR}/src/controllers
156+
)
157+
# Same QTEST_MAIN crash-handler caveat as test_sync_e2e — ctest's pipe driver
158+
# deadlocks the default handler on Windows; -nocrashhandler bypasses it.
159+
set_property(TEST test_missing_nodes_qt PROPERTY
160+
COMMAND $<TARGET_FILE:test_missing_nodes_qt> -nocrashhandler)
161+
set_tests_properties(test_missing_nodes_qt PROPERTIES
162+
TIMEOUT 120
163+
)
164+
# Copy VTextEdit DLL next to the test executable so CTest resolves it at runtime.
165+
add_custom_command(TARGET test_missing_nodes_qt POST_BUILD
166+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
167+
$<TARGET_FILE:VTextEdit>
168+
$<TARGET_FILE_DIR:test_missing_nodes_qt>
169+
)

0 commit comments

Comments
 (0)