Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_net/tests/main.rs

1.5 KiB, 18 runs

created by r1870400018:617, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1// `dns` and `smtp` (command parsing only) are tokio-free; the rest exercise the
2// async half of the crate and compile only when it is built.
3mod dns;
4#[cfg(feature = "async")]
5mod email;
6#[cfg(feature = "async")]
7mod http;
8mod smtp;
9#[cfg(feature = "async")]
10mod smtp_submit;
11
12use oxedyne_fe2o3_core::prelude::*;
13
14
15#[test]
16fn main() -> Outcome<()> {
17
18 // Separate the tests out to a run_tests function so that we can funnel any outcome, be it an
19 // error or ok, back into this function before closing out with a single call to log_finish_wait! to
20 // allow logger thread completion. Otherwise, we may not see all the logger output before the
21 // main thread finishes.
22
23 log_set_level!("debug");
24
25 let outcome = run_tests();
26
27 log_finish_wait!();
28
29 outcome
30}
31
32fn run_tests() -> Outcome<()> {
33
34 // Every case here is tagged "all", so this runs them. It was "dns" until
35 // 2026-08-17, which ran the one DNS case and silently skipped the rest --
36 // `test_it` matches a tag by prefix, and no other tag begins with "dns".
37 // The suite still printed "running 1 test ... ok" in 0.00s, so a filter that
38 // switched off four SMTP submission cases read exactly like a passing one.
39 let filter = "all";
40
41 res!(dns::test_dns(filter));
42 #[cfg(feature = "async")]
43 res!(email::test_email(filter));
44 #[cfg(feature = "async")]
45 res!(http::test_http(filter));
46 res!(smtp::test_smtp(filter));
47 #[cfg(feature = "async")]
48 res!(smtp_submit::test_smtp_submit(filter));
49
50 Ok(())
51}