feat: add ProcessExecutor, FAKE mode, fix thread lifecycle crash

- Add ProcessExecutor class wrapping PIProcess with proper cleanup
- Add CMake FAKE option (-DFAKE=ON) for testing without opencode
- Add 3 FAKE-mode tests for full pipeline execution, status transitions, output
- Fix PIThread lifecycle: use startOnce() instead of start(), track threads,
  wait + delete in destructor to prevent use-after-free of PIDeque<PIChar>
- Update build.sh with --fake flag and automatic cache invalidation
- Upgrade CMake to C++17 standard
- Update AGENTS.md with build commands and FAKE mode
This commit is contained in:
2026-07-16 09:51:39 +03:00
parent 46e12ef5fe
commit 5ca6927baa
8 changed files with 361 additions and 34 deletions
+15 -1
View File
@@ -1,10 +1,18 @@
cmake_minimum_required(VERSION 3.10)
project(PipelineRunner)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(FAKE "Fake mode for testing without opencode" OFF)
if(FAKE)
message(STATUS "FAKE mode ON — using fake process executor")
else()
message(STATUS "FAKE mode OFF — using real process executor")
endif()
# PIP
find_package(PIP REQUIRED)
@@ -28,6 +36,9 @@ set(SRCS ${ALL_SRCS})
add_executable(pipeline-runner src/main.cpp ${SRCS} ${HDRS})
target_include_directories(pipeline-runner PRIVATE src)
target_link_libraries(pipeline-runner PIP PIP::HTTPServer PIP::Crypt PIP::Console)
if(FAKE)
target_compile_definitions(pipeline-runner PRIVATE FAKE)
endif()
set_target_properties(pipeline-runner PROPERTIES
INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib"
@@ -38,6 +49,9 @@ set_target_properties(pipeline-runner PROPERTIES
add_executable(test-pipeline-runner tests/test_pipeline.cpp tests/test_runner.cpp ${SRCS})
target_include_directories(test-pipeline-runner PRIVATE src tests)
target_link_libraries(test-pipeline-runner PIP PIP::HTTPServer PIP::Crypt PIP::Console GTest::gtest_main)
if(FAKE)
target_compile_definitions(test-pipeline-runner PRIVATE FAKE)
endif()
include(GoogleTest)
gtest_discover_tests(test-pipeline-runner)