Skip to content

Commit 9b70460

Browse files
committed
Use USES_TERMINAL for cpptest to show output immediately
Ninja buffers subprocess output until completion. When a test hangs, the output is never shown, making it impossible to diagnose which test is hanging. USES_TERMINAL gives the command direct terminal access, bypassing ninja's buffering. This explains why Windows CI showed test progress but Linux/macOS did not - Windows uses MSBuild which doesn't buffer the same way.
1 parent d6f2a7f commit 9b70460

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_with_catch/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ add_custom_target(
4747
cpptest
4848
COMMAND "$<TARGET_FILE:test_with_catch>"
4949
DEPENDS test_with_catch
50-
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
50+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
51+
USES_TERMINAL)
5152

5253
pybind11_add_module(external_module THIN_LTO external_module.cpp)
5354
set_target_properties(external_module PROPERTIES LIBRARY_OUTPUT_DIRECTORY

0 commit comments

Comments
 (0)