1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Test utilities and fake implementations for perfgate testing.
//!
//! This crate provides deterministic, configurable test doubles for the
//! perfgate adapter traits. Use these in unit tests and integration tests
//! to avoid I/O and ensure reproducible test results.
//!
//! # Available Fakes
//!
//! - [`FakeProcessRunner`] - Configurable process runner for testing
//! - [`FakeHostProbe`] - Configurable host probe for testing
//! - [`FakeClock`] - Configurable clock for time-based testing
//! - [`MockProcessBuilder`] - Builder pattern for creating mock process results
//!
//! # Example
//!
//! ```
//! use perfgate_fake::{FakeProcessRunner, MockProcessBuilder};
//! use perfgate_adapters::{ProcessRunner, CommandSpec, RunResult};
//!
//! let runner = FakeProcessRunner::new();
//!
//! // Configure a result using the builder
//! let result = MockProcessBuilder::new()
//! .exit_code(0)
//! .wall_ms(100)
//! .stdout(b"hello world".to_vec())
//! .build();
//!
//! runner.set_result(&["echo", "hello"], result);
//!
//! // Now when we run the command, we get our configured result
//! let spec = CommandSpec {
//! name: "echo test".to_string(),
//! argv: vec!["echo".to_string(), "hello".to_string()],
//! cwd: None,
//! env: vec![],
//! timeout: None,
//! output_cap_bytes: 1024,
//! };
//!
//! let output = runner.run(&spec).unwrap();
//! assert_eq!(output.exit_code, 0);
//! assert_eq!(output.wall_ms, 100);
//! ```
pub use MockProcessBuilder;
pub use FakeClock;
pub use FakeHostProbe;
pub use FakeProcessRunner;
pub use ;