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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//! Test harness for integration tests with admixture contexts.
//!
//! Provides the `#[admixture_test]` macro for writing integration tests
//! with automatic context lifecycle management and lifecycle hooks.
//!
//! # Example
//!
//! ```ignore
//! use admixture::context;
//! use admixture_harness::prelude::*;
//!
//! context! {
//! MyTestContext {
//! postgres: SqlxPostgresServiceSetup,
//! }
//! }
//!
//! #[admixture_test(context = MyTestContext)]
//! async fn test_database_operations(ctx: &MyTestContextRunning) -> Result<(), TestError> {
//! let client = ctx.postgres().client().await?;
//! // Test logic here
//! Ok(())
//! }
//! ```
use Future;
use Pin;
// Re-export the macro
pub use admixture_test;
// Re-export runner components for external use
pub use ;
/// Generic context lifecycle manager trait.
///
/// Implemented by the macro for each context type to manage setup/teardown.
/// Uses concrete types instead of type erasure for better type safety.
/// Type alias for hook functions with Higher-Rank Trait Bounds.
///
/// Hooks receive a reference to the running context of concrete type C
/// and return a pinned future.
pub use HookFn;
/// Container for lifecycle hooks with concrete context type.
///
/// All hooks are optional. Hooks are executed at specific points in the test lifecycle:
/// - `before_all`: After context starts, before any tests run
/// - `after_all`: After all tests complete, before context stops (best-effort)
/// - `before_each`: Before each individual test
/// - `after_each`: After each individual test (always runs, even if test fails)
pub use Hooks;
/// Type alias for test functions with Higher-Rank Trait Bounds.
///
/// Test functions receive a reference to the running context of concrete type C
/// and return a pinned future with the test result.
pub type TestFn<C> = for<'a> fn ;
/// Type alias for group runner functions.
///
/// This is the type-erased boundary between test collection (inventory) and
/// typed test execution. Each context type gets its own runner implementation.
pub type GroupRunnerFn = fn ;
/// Descriptor for a registered integration test.
///
/// This struct is submitted to the `inventory` collection by the `#[admixture_test]` macro.
// Collect all registered integration tests.
collect!;
/// Prelude module for convenient imports.