mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Migrate most of the existing coverage tests over to run-coverage
This commit is contained in:
parent
22e119bbac
commit
e0625b4586
@ -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);
|
@ -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);
|
@ -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.
|
@ -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.
|
@ -1,5 +1,5 @@
|
||||
1| |#![allow(unused_assignments)]
|
||||
2| |// expect-exit-status-1
|
||||
2| |// failure-status: 1
|
||||
3| |
|
||||
4| |struct Firework {
|
||||
5| | strength: i32,
|
@ -1,5 +1,5 @@
|
||||
#![allow(unused_assignments)]
|
||||
// expect-exit-status-1
|
||||
// failure-status: 1
|
||||
|
||||
struct Firework {
|
||||
strength: i32,
|
@ -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,
|
@ -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,
|
@ -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() {
|
@ -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() {
|
@ -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 {
|
@ -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 {
|
@ -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 {
|
@ -1,5 +1,5 @@
|
||||
#![allow(unused_assignments)]
|
||||
// expect-exit-status-101
|
||||
// failure-status: 101
|
||||
|
||||
fn might_panic(should_panic: bool) {
|
||||
if should_panic {
|
@ -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 {
|
@ -1,5 +1,5 @@
|
||||
#![allow(unused_assignments)]
|
||||
// expect-exit-status-1
|
||||
// failure-status: 1
|
||||
|
||||
fn call(return_error: bool) -> Result<(),()> {
|
||||
if return_error {
|
@ -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;
|
@ -1,5 +1,5 @@
|
||||
#![allow(unused_assignments)]
|
||||
// expect-exit-status-1
|
||||
// failure-status: 1
|
||||
|
||||
fn main() -> Result<(),u8> {
|
||||
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
|
||||
# ignore-windows-gnu
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user