Expand description
§kael_util_macros
Small procedural macros shared by Kael’s tests and performance tooling:
path!,uri!, andline_endings!produce target-correct literals without runtime platform branches.perfmarks performance-sensitive tests. Enabling theperf-enabledfeature adds the metadata consumed bykael_perf; without it, the macro remains a normal test attribute.
Most application code does not need to depend on this crate directly. It is a support crate for the Kael workspace and its test infrastructure.
path! and uri! are fixture helpers, not general path or URL normalizers.
They map Unix-style test literals to a C: drive on Windows while preserving
explicit drive letters and UNC paths. line_endings! normalizes mixed LF/CRLF
fixtures before producing the target-specific literal.
#[perf] accepts at most one importance level plus optional positive
iterations: usize and weight: u8 expressions. With perf-enabled, generated
benchmark tests ignore zero or malformed iteration environment values, emit the
versioned kael_perf metadata protocol, and keep conditional-compilation
attributes paired with their metadata tests.
See the Kael guide for framework-level usage.
§License
Licensed under the Apache License, Version 2.0.
Macros§
- line_
endings - This macro replaces the line endings
\nwith\r\nfor Windows. But if the target OS is not Windows, the line endings are returned as is. - path
- A macro used in tests for cross-platform path string literals in tests. On Windows it replaces
/with\\and addsC:to the beginning of absolute paths. On other platforms, the path is returned unmodified. - uri
- This macro replaces the path prefix
file:///withfile:///C:/for Windows. But if the target OS is not Windows, the URI is returned as is.
Attribute Macros§
- perf
- Marks a test as perf-sensitive, to be triaged when checking the performance
of a build. This also automatically applies
#[test].