tanu_core/
lib.rs

1//! # Tanu Core
2//!
3//! Core functionality for the tanu WebAPI testing framework.
4//!
5//! This crate provides the fundamental building blocks for tanu, including:
6//! - Test runners and execution logic
7//! - HTTP client functionality
8//! - Assertion macros and utilities
9//! - Configuration management
10//! - Test reporting infrastructure
11//!
12//! ## Architecture (block diagram)
13//!
14//! ```text
15//! +---------------------+      +---------------------+      +---------------------+
16//! | test definitions    | ---> | runner (execution) | --->  | reporter (output)   |
17//! | #[tanu::test]       |      | + event channel    |       | List/Null/etc.      |
18//! +---------------------+      +---------------------+      +---------------------+
19//!            |                         ^    ^                         ^
20//!            v                         |    |                         |
21//! +---------------------+              |    |              +---------------------+
22//! | assertion macros    | ---publish---+    +---publish--- | HTTP client + logs  |
23//! | check!, check_eq!   |                              |   | req/res capture     |
24//! +---------------------+                              |   +---------------------+
25//!            ^                                         |
26//!            |                                         v
27//! +---------------------+                       +---------------------+
28//! | config + filters    | <-------------------- | test selection      |
29//! | projects/modules    |                       | (project/module)    |
30//! +---------------------+                       +---------------------+
31//! ```
32//!
33//! Most users should use the main `tanu` crate rather than importing `tanu-core` directly.
34
35#[doc(hidden)]
36pub mod assertion;
37pub mod config;
38pub mod error;
39pub mod http;
40pub mod reporter;
41#[doc(hidden)]
42pub mod runner;
43
44// Re-export procedural macros
45pub use tanu_derive::{main, test};
46
47// Re-export error handling crates
48pub use anyhow;
49pub use eyre;
50
51/// Type alias for project names in tanu configuration.
52///
53/// Project names are used to organize tests into different environments
54/// or configurations (e.g., "staging", "production", "development").
55/// Each project can have its own configuration settings including
56/// base URLs, timeouts, and retry policies.
57pub type ProjectName = String;
58
59/// Type alias for module names in test organization.
60///
61/// Module names correspond to Rust module paths and are used to
62/// group related tests together. For example, "api", "auth", "users".
63/// They're used for filtering and organizing test output.
64pub type ModuleName = String;
65
66/// Type alias for individual test names.
67///
68/// Test names identify specific test functions within a module.
69/// Combined with module and project names, they provide unique
70/// identification for each test case in the system.
71pub type TestName = String;
72
73// Re-export key functionality
74pub use config::{get_config, get_tanu_config, Config, ProjectConfig};
75pub use error::{Error, Result};
76pub use reporter::{ListReporter, NullReporter, Reporter};
77pub use runner::{
78    Filter, ModuleFilter, ProjectFilter, Runner, TestIgnoreFilter, TestInfo, TestNameFilter,
79};