Migrate most of the existing coverage tests over to run-coverage

This commit is contained in:
Zalathar 2023-06-12 18:07:04 +10:00
parent 22e119bbac
commit e0625b4586
81 changed files with 24 additions and 20 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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.

View File

@ -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.

View File

@ -1,5 +1,5 @@
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-1
2| |// failure-status: 1
3| |
4| |struct Firework {
5| | strength: i32,

View File

@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-1
// failure-status: 1
struct Firework {
strength: i32,

View File

@ -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,

View File

@ -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,

View File

@ -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() {

View File

@ -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() {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-101
// failure-status: 101
fn might_panic(should_panic: bool) {
if should_panic {

View File

@ -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 {

View File

@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-1
// failure-status: 1
fn call(return_error: bool) -> Result<(),()> {
if return_error {

View File

@ -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;

View File

@ -1,5 +1,5 @@
#![allow(unused_assignments)]
// expect-exit-status-1
// failure-status: 1
fn main() -> Result<(),u8> {
let mut countdown = 10;

View File

@ -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