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:
@@ -0,0 +1,20 @@
|
||||
#ifndef PROCESSEXECUTOR_H
|
||||
#define PROCESSEXECUTOR_H
|
||||
|
||||
#include <pistring.h>
|
||||
#include <pistringlist.h>
|
||||
|
||||
struct ProcessResult {
|
||||
int exitCode;
|
||||
PIString output;
|
||||
PIString error;
|
||||
};
|
||||
|
||||
class ProcessExecutor {
|
||||
public:
|
||||
// Execute a command with args, wait up to timeoutSeconds, return result.
|
||||
// Only one process runs at a time — synchronous, stack-based PIProcess.
|
||||
static ProcessResult run(const PIString & command, const PIStringList & args, int timeoutSeconds, const PIString & workingDir);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user