Skip to content

Commit e0625b4

Browse files
committed
Migrate most of the existing coverage tests over to run-coverage
1 parent 22e119b commit e0625b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+24
-20
lines changed
File renamed without changes.

tests/run-make/coverage-reports/expected_show_coverage.assert.txt renamed to tests/run-coverage/assert.coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1| |#![allow(unused_assignments)]
2-
2| |// expect-exit-status-101
2+
2| |// failure-status: 101
33
3| |
44
4| 4|fn might_fail_assert(one_plus_one: u32) {
55
5| 4| println!("does 1 + 1 = {}?", one_plus_one);

tests/run-make/coverage/assert.rs renamed to tests/run-coverage/assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused_assignments)]
2-
// expect-exit-status-101
2+
// failure-status: 101
33

44
fn might_fail_assert(one_plus_one: u32) {
55
println!("does 1 + 1 = {}?", one_plus_one);
File renamed without changes.
File renamed without changes.

tests/run-make/coverage-reports/expected_show_coverage.closure.txt renamed to tests/run-coverage/closure.coverage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
1| |#![allow(unused_assignments, unused_variables)]
2-
2| |// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
3-
3| 1|fn main() {
2+
2| |// compile-flags: -C opt-level=2
3+
3| 1|fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
44
4| 1| // Initialize test constants in a way that cannot be determined at compile time, to ensure
55
5| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
66
6| 1| // dependent conditions.

tests/run-make/coverage/closure.rs renamed to tests/run-coverage/closure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![allow(unused_assignments, unused_variables)]
2-
// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
3-
fn main() {
2+
// compile-flags: -C opt-level=2
3+
fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
44
// Initialize test constants in a way that cannot be determined at compile time, to ensure
55
// rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
66
// dependent conditions.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1| |#![allow(unused_assignments)]
2-
2| |// expect-exit-status-1
2+
2| |// failure-status: 1
33
3| |
44
4| |struct Firework {
55
5| | strength: i32,

tests/run-make/coverage/drop_trait.rs renamed to tests/run-coverage/drop_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused_assignments)]
2-
// expect-exit-status-1
2+
// failure-status: 1
33

44
struct Firework {
55
strength: i32,

tests/run-make/coverage-reports/expected_show_coverage.generics.txt renamed to tests/run-coverage/generics.coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1| |#![allow(unused_assignments)]
2-
2| |// expect-exit-status-1
2+
2| |// failure-status: 1
33
3| |
44
4| |struct Firework<T> where T: Copy + std::fmt::Display {
55
5| | strength: T,

tests/run-make/coverage/generics.rs renamed to tests/run-coverage/generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused_assignments)]
2-
// expect-exit-status-1
2+
// failure-status: 1
33

44
struct Firework<T> where T: Copy + std::fmt::Display {
55
strength: T,
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
1| |// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
22
2| |
3-
3| |// expect-exit-status-101
3+
3| |// failure-status: 101
44
4| 21|#[derive(PartialEq, Eq)]
55
5| |struct Foo(u32);
66
6| 1|fn test3() {

tests/run-make/coverage/issue-84561.rs renamed to tests/run-coverage/issue-84561.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
22

3-
// expect-exit-status-101
3+
// failure-status: 101
44
#[derive(PartialEq, Eq)]
55
struct Foo(u32);
66
fn test3() {

tests/run-make/coverage-reports/expected_show_coverage.overflow.txt renamed to tests/run-coverage/overflow.coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1| |#![allow(unused_assignments)]
2-
2| |// expect-exit-status-101
2+
2| |// failure-status: 101
33
3| |
44
4| 4|fn might_overflow(to_add: u32) -> u32 {
55
5| 4| if to_add > 5 {

tests/run-make/coverage/overflow.rs renamed to tests/run-coverage/overflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused_assignments)]
2-
// expect-exit-status-101
2+
// failure-status: 101
33

44
fn might_overflow(to_add: u32) -> u32 {
55
if to_add > 5 {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1| |#![allow(unused_assignments)]
2-
2| |// expect-exit-status-101
2+
2| |// failure-status: 101
33
3| |
44
4| 4|fn might_panic(should_panic: bool) {
55
5| 4| if should_panic {

tests/run-make/coverage/panic_unwind.rs renamed to tests/run-coverage/panic_unwind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused_assignments)]
2-
// expect-exit-status-101
2+
// failure-status: 101
33

44
fn might_panic(should_panic: bool) {
55
if should_panic {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1| |#![allow(unused_assignments)]
2-
2| |// expect-exit-status-1
2+
2| |// failure-status: 1
33
3| |
44
4| 6|fn call(return_error: bool) -> Result<(),()> {
55
5| 6| if return_error {

tests/run-make/coverage/try_error_result.rs renamed to tests/run-coverage/try_error_result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused_assignments)]
2-
// expect-exit-status-1
2+
// failure-status: 1
33

44
fn call(return_error: bool) -> Result<(),()> {
55
if return_error {
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1| |#![allow(unused_assignments)]
2-
2| |// expect-exit-status-1
2+
2| |// failure-status: 1
33
3| |
44
4| 1|fn main() -> Result<(),u8> {
55
5| 1| let mut countdown = 10;

tests/run-make/coverage/while_early_ret.rs renamed to tests/run-coverage/while_early_ret.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused_assignments)]
2-
// expect-exit-status-1
2+
// failure-status: 1
33

44
fn main() -> Result<(),u8> {
55
let mut countdown = 10;
File renamed without changes.

tests/run-make/coverage-reports/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# NOTE: Most of the tests previously associated with this makefile have been
2+
# migrated over to the custom `run-coverage` test suite instead, so only a few
3+
# harder-to-port tests remain here.
4+
15
# needs-profiler-support
26
# ignore-windows-gnu
37

0 commit comments

Comments
 (0)