Migrate most of the existing coverage tests over to run-coverage
This commit is contained in:
parent
22e119bbac
commit
e0625b4586
81 changed files with 24 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
||||||
1| |#![allow(unused_assignments)]
|
1| |#![allow(unused_assignments)]
|
||||||
2| |// expect-exit-status-101
|
2| |// failure-status: 101
|
||||||
3| |
|
3| |
|
||||||
4| 4|fn might_fail_assert(one_plus_one: u32) {
|
4| 4|fn might_fail_assert(one_plus_one: u32) {
|
||||||
5| 4| println!("does 1 + 1 = {}?", one_plus_one);
|
5| 4| println!("does 1 + 1 = {}?", one_plus_one);
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
// expect-exit-status-101
|
// failure-status: 101
|
||||||
|
|
||||||
fn might_fail_assert(one_plus_one: u32) {
|
fn might_fail_assert(one_plus_one: u32) {
|
||||||
println!("does 1 + 1 = {}?", one_plus_one);
|
println!("does 1 + 1 = {}?", one_plus_one);
|
|
@ -1,6 +1,6 @@
|
||||||
1| |#![allow(unused_assignments, unused_variables)]
|
1| |#![allow(unused_assignments, unused_variables)]
|
||||||
2| |// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
|
2| |// compile-flags: -C opt-level=2
|
||||||
3| 1|fn main() {
|
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
|
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
|
5| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
|
||||||
6| 1| // dependent conditions.
|
6| 1| // dependent conditions.
|
|
@ -1,6 +1,6 @@
|
||||||
#![allow(unused_assignments, unused_variables)]
|
#![allow(unused_assignments, unused_variables)]
|
||||||
// compile-flags: -C opt-level=2 # fix described in rustc_middle/mir/mono.rs
|
// compile-flags: -C opt-level=2
|
||||||
fn main() {
|
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
|
// 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
|
// rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
|
||||||
// dependent conditions.
|
// dependent conditions.
|
|
@ -1,5 +1,5 @@
|
||||||
1| |#![allow(unused_assignments)]
|
1| |#![allow(unused_assignments)]
|
||||||
2| |// expect-exit-status-1
|
2| |// failure-status: 1
|
||||||
3| |
|
3| |
|
||||||
4| |struct Firework {
|
4| |struct Firework {
|
||||||
5| | strength: i32,
|
5| | strength: i32,
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
// expect-exit-status-1
|
// failure-status: 1
|
||||||
|
|
||||||
struct Firework {
|
struct Firework {
|
||||||
strength: i32,
|
strength: i32,
|
|
@ -1,5 +1,5 @@
|
||||||
1| |#![allow(unused_assignments)]
|
1| |#![allow(unused_assignments)]
|
||||||
2| |// expect-exit-status-1
|
2| |// failure-status: 1
|
||||||
3| |
|
3| |
|
||||||
4| |struct Firework<T> where T: Copy + std::fmt::Display {
|
4| |struct Firework<T> where T: Copy + std::fmt::Display {
|
||||||
5| | strength: T,
|
5| | strength: T,
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
// expect-exit-status-1
|
// failure-status: 1
|
||||||
|
|
||||||
struct Firework<T> where T: Copy + std::fmt::Display {
|
struct Firework<T> where T: Copy + std::fmt::Display {
|
||||||
strength: T,
|
strength: T,
|
|
@ -1,6 +1,6 @@
|
||||||
1| |// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
|
1| |// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
|
||||||
2| |
|
2| |
|
||||||
3| |// expect-exit-status-101
|
3| |// failure-status: 101
|
||||||
4| 21|#[derive(PartialEq, Eq)]
|
4| 21|#[derive(PartialEq, Eq)]
|
||||||
5| |struct Foo(u32);
|
5| |struct Foo(u32);
|
||||||
6| 1|fn test3() {
|
6| 1|fn test3() {
|
|
@ -1,6 +1,6 @@
|
||||||
// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
|
// This demonstrated Issue #84561: function-like macros produce unintuitive coverage results.
|
||||||
|
|
||||||
// expect-exit-status-101
|
// failure-status: 101
|
||||||
#[derive(PartialEq, Eq)]
|
#[derive(PartialEq, Eq)]
|
||||||
struct Foo(u32);
|
struct Foo(u32);
|
||||||
fn test3() {
|
fn test3() {
|
|
@ -1,5 +1,5 @@
|
||||||
1| |#![allow(unused_assignments)]
|
1| |#![allow(unused_assignments)]
|
||||||
2| |// expect-exit-status-101
|
2| |// failure-status: 101
|
||||||
3| |
|
3| |
|
||||||
4| 4|fn might_overflow(to_add: u32) -> u32 {
|
4| 4|fn might_overflow(to_add: u32) -> u32 {
|
||||||
5| 4| if to_add > 5 {
|
5| 4| if to_add > 5 {
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
// expect-exit-status-101
|
// failure-status: 101
|
||||||
|
|
||||||
fn might_overflow(to_add: u32) -> u32 {
|
fn might_overflow(to_add: u32) -> u32 {
|
||||||
if to_add > 5 {
|
if to_add > 5 {
|
|
@ -1,5 +1,5 @@
|
||||||
1| |#![allow(unused_assignments)]
|
1| |#![allow(unused_assignments)]
|
||||||
2| |// expect-exit-status-101
|
2| |// failure-status: 101
|
||||||
3| |
|
3| |
|
||||||
4| 4|fn might_panic(should_panic: bool) {
|
4| 4|fn might_panic(should_panic: bool) {
|
||||||
5| 4| if should_panic {
|
5| 4| if should_panic {
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
// expect-exit-status-101
|
// failure-status: 101
|
||||||
|
|
||||||
fn might_panic(should_panic: bool) {
|
fn might_panic(should_panic: bool) {
|
||||||
if should_panic {
|
if should_panic {
|
|
@ -1,5 +1,5 @@
|
||||||
1| |#![allow(unused_assignments)]
|
1| |#![allow(unused_assignments)]
|
||||||
2| |// expect-exit-status-1
|
2| |// failure-status: 1
|
||||||
3| |
|
3| |
|
||||||
4| 6|fn call(return_error: bool) -> Result<(),()> {
|
4| 6|fn call(return_error: bool) -> Result<(),()> {
|
||||||
5| 6| if return_error {
|
5| 6| if return_error {
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
// expect-exit-status-1
|
// failure-status: 1
|
||||||
|
|
||||||
fn call(return_error: bool) -> Result<(),()> {
|
fn call(return_error: bool) -> Result<(),()> {
|
||||||
if return_error {
|
if return_error {
|
|
@ -1,5 +1,5 @@
|
||||||
1| |#![allow(unused_assignments)]
|
1| |#![allow(unused_assignments)]
|
||||||
2| |// expect-exit-status-1
|
2| |// failure-status: 1
|
||||||
3| |
|
3| |
|
||||||
4| 1|fn main() -> Result<(),u8> {
|
4| 1|fn main() -> Result<(),u8> {
|
||||||
5| 1| let mut countdown = 10;
|
5| 1| let mut countdown = 10;
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
// expect-exit-status-1
|
// failure-status: 1
|
||||||
|
|
||||||
fn main() -> Result<(),u8> {
|
fn main() -> Result<(),u8> {
|
||||||
let mut countdown = 10;
|
let mut countdown = 10;
|
|
@ -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
|
# needs-profiler-support
|
||||||
# ignore-windows-gnu
|
# ignore-windows-gnu
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue