-
Notifications
You must be signed in to change notification settings - Fork 8
5 REQ lang
Sub-requirements of lang define conventions and syntax constructs
that must be followed by users that want to use mantra's built-in
automatic trace, test, and coverage collection for supported programming languages.
Contains conventions for Rust code to allow automated collection of traceability information by mantra.
-
Parents: [
lang.rust,trace.collect.auto.ast]
Note: <requirement IDs> is used below as placeholder for the actual IDs to trace with IDs being separated by , and optional whitespace characters.
The following patterns must be recognized as requirements traces in Rust code:
Attribute Macro:
These traces have an associates line span of the element the attribute is set on.
#[req(<requirement IDs>)]
fn foo() {}#[mod_path::req(<requirement IDs>)]
fn foo() {}#[cfg_attr(<some condition>, mod_path::req(<requirement IDs>))]
fn foo() {}Function-like Macro:
These traces only link to the line the macro is set at.
fn foo() {
reqcov!(<requirement IDs>)
}fn foo() {
mod_path::reqcov!(<requirement IDs>)
}Traces in Comments:
These traces have an associated line span of the element the comment is referred to.
/// [req(<requirement IDs>)]
fn foo() {}For traces in regular line comments, several restrictions apply to prevent false detection:
- Traces must be on a separate commented line without any other content except whitespace
- The line directly below a trace must contain a non-commented element to which the trace is linked to
- The affected line span depends on the non-commented element the trace is linked to
fn foo() {
// [req(<requirement IDs>)]
let x = 5;
}Note: Traces in block comments are not supported.
Please create an issue if you found any spelling mistakes.
You may also create an issue if you think the content of this wiki should be improved.
Note: This wiki is managed in its own repository. Any commits made using the edit button will be overwritten.
Note: Issues for the wiki are handled in the mantra repository, but pull requests for the wiki are handled in the mantra-wiki repository.
This wiki is MIT licensed, and works together with mantra.