Files
zaloopipe/pipeline-runner/src/processexecutor.h
T
andrey 5ca6927baa 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
2026-07-16 09:51:39 +03:00

21 lines
502 B
C++

#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