Skip to content

Commit

Permalink
Migrate most of the existing coverage tests over to run-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Jun 28, 2023
1 parent 22e119b commit e0625b4
Show file tree
Hide file tree
Showing 81 changed files with 24 additions and 20 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-101
2| |// failure-status: 101
3| |
4| 4|fn might_fail_assert(one_plus_one: u32) {
5| 4| println!("does 1 + 1 = {}?", one_plus_one);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-101
// failure-status: 101

fn might_fail_assert(one_plus_one: u32) {
println!("does 1 + 1 = {}?", one_plus_one);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1| |#![allow(unused_assignments, unused_variables)]
2| |// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
3| 1|fn main() {
2| |// compile-flags: -C opt-level=2
3| 1|fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
4| 1| // Initialize test constants in a way that cannot be determined at compile time, to ensure
5| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
6| 1| // dependent conditions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(unused_assignments, unused_variables)]
// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
fn main() {
// compile-flags: -C opt-level=2
fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
// Initialize test constants in a way that cannot be determined at compile time, to ensure
// rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
// dependent conditions.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-1
2| |// failure-status: 1
3| |
4| |struct Firework {
5| | strength: i32,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-1
// failure-status: 1

struct Firework {
strength: i32,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-1
2| |// failure-status: 1
3| |
4| |struct Firework<T> where T: Copy + std::fmt::Display {
5| | strength: T,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-1
// failure-status: 1

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

// expect-exit-status-101
// failure-status: 101
#[derive(PartialEq, Eq)]
struct Foo(u32);
fn test3() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-101
2| |// failure-status: 101
3| |
4| 4|fn might_overflow(to_add: u32) -> u32 {
5| 4| if to_add > 5 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-101
// failure-status: 101

fn might_overflow(to_add: u32) -> u32 {
if to_add > 5 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-101
2| |// failure-status: 101
3| |
4| 4|fn might_panic(should_panic: bool) {
5| 4| if should_panic {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-101
// failure-status: 101

fn might_panic(should_panic: bool) {
if should_panic {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-1
2| |// failure-status: 1
3| |
4| 6|fn call(return_error: bool) -> Result<(),()> {
5| 6| if return_error {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-1
// failure-status: 1

fn call(return_error: bool) -> Result<(),()> {
if return_error {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-1
2| |// failure-status: 1
3| |
4| 1|fn main() -> Result<(),u8> {
5| 1| let mut countdown = 10;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-1
// failure-status: 1

fn main() -> Result<(),u8> {
let mut countdown = 10;
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions tests/run-make/coverage-reports/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# NOTE: Most of the tests previously associated with this makefile have been
# migrated over to the custom `run-coverage` test suite instead, so only a few
# harder-to-port tests remain here.

# needs-profiler-support
# ignore-windows-gnu

Expand Down

0 comments on commit e0625b4

Please sign in to comment.