Skip to content

Commit 955f8a2

Browse files
committed
docs(tests): add @Covers annotations to all integration test programs
Each test .rs file now has a //! @Covers: line describing the Rust constructs it exercises (e.g. closures, enums, fn pointer coercion). These are module-level doc comments so they show up in rustdoc, and the trace-report tooling extracts them for the coverage summary. Golden files regenerated for the programs where the new doc comment changed the crate-level attributes in the MIR output.
1 parent cbfb88e commit 955f8a2

35 files changed

Lines changed: 181 additions & 100 deletions

tests/integration/programs/assert_eq.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: assert_eq macro expansion, string formatting machinery
12
fn main() {
23
let a = 42;
34
let b = 3 + 39;

tests/integration/programs/binop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: binary operators (arithmetic, bitwise, comparison)
12
fn test_binop(x:i32, y:i32) -> () {
23
// Arithmetic
34
// Addition

tests/integration/programs/char-trivial.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: char type, char literals, equality
12
fn main() {
23
let a:char = 'a';
34

tests/integration/programs/closure-args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: closure with captured arguments, closure call
12
fn main() {
23
let sum = |x, y| -> i32 { x + y };
34

tests/integration/programs/closure-args.smir.json.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2620,7 +2620,7 @@
26202620
],
26212621
[
26222622
{
2623-
"FunType": "{closure@tests/integration/programs/closure-args.rs:2:15: 2:28}"
2623+
"FunType": "{closure@tests/integration/programs/closure-args.rs:3:15: 3:28}"
26242624
}
26252625
]
26262626
]

tests/integration/programs/closure-no-args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: zero-argument closure, closure call
12
fn main() {
23
let sum = || -> u32 { 42 };
34

tests/integration/programs/closure-no-args.smir.json.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@
23152315
],
23162316
[
23172317
{
2318-
"FunType": "{closure@tests/integration/programs/closure-no-args.rs:2:15: 2:24}"
2318+
"FunType": "{closure@tests/integration/programs/closure-no-args.rs:3:15: 3:24}"
23192319
}
23202320
]
23212321
]

tests/integration/programs/const-arithm-simple.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: function calls, usize comparison, return values
12
fn test(x: usize, y:usize) -> bool {
23
return x > y;
34
}

tests/integration/programs/div.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: integer division
12
fn main() {
23
assert!(420 / 10 ==42);
34
}

tests/integration/programs/double-ref-deref.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! @covers: double references, double dereference
12
fn main() {
23
let a = 42;
34
let b = &a;

0 commit comments

Comments
 (0)