UI tests for -Z instrument-xray
I'm tired of testing it manually, just codify my expectations in tests. They're pretty low-maintenance.
This commit is contained in:
parent
0e60df9ed1
commit
d748f08547
9 changed files with 41 additions and 1 deletions
|
@ -9,7 +9,7 @@ use std::path::Path;
|
|||
|
||||
const ENTRY_LIMIT: usize = 1000;
|
||||
// FIXME: The following limits should be reduced eventually.
|
||||
const ROOT_ENTRY_LIMIT: usize = 939;
|
||||
const ROOT_ENTRY_LIMIT: usize = 940;
|
||||
const ISSUES_ENTRY_LIMIT: usize = 2001;
|
||||
|
||||
fn check_entries(path: &Path, bad: &mut bool) {
|
||||
|
|
6
tests/ui/instrument-xray/flags-always-never-1.rs
Normal file
6
tests/ui/instrument-xray/flags-always-never-1.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Checks that `-Z instrument-xray` does not allow `always` and `never` simultaneously.
|
||||
//
|
||||
// compile-flags: -Z instrument-xray=always,never
|
||||
// error-pattern: incorrect value `always,never` for unstable option `instrument-xray`
|
||||
|
||||
fn main() {}
|
2
tests/ui/instrument-xray/flags-always-never-1.stderr
Normal file
2
tests/ui/instrument-xray/flags-always-never-1.stderr
Normal file
|
@ -0,0 +1,2 @@
|
|||
error: incorrect value `always,never` for unstable option `instrument-xray` - either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit` was expected
|
||||
|
8
tests/ui/instrument-xray/flags-always-never-2.rs
Normal file
8
tests/ui/instrument-xray/flags-always-never-2.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// Checks that `-Z instrument-xray` allows `always` and `never` sequentially.
|
||||
// (The last specified setting wins, like `-Z instrument-xray=no` as well.)
|
||||
//
|
||||
// compile-flags: -Z instrument-xray=always
|
||||
// compile-flags: -Z instrument-xray=never
|
||||
// check-pass
|
||||
|
||||
fn main() {}
|
8
tests/ui/instrument-xray/flags-basic.rs
Normal file
8
tests/ui/instrument-xray/flags-basic.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// Verifies basic `-Z instrument-xray` flags.
|
||||
//
|
||||
// compile-flags: -Z instrument-xray
|
||||
// compile-flags: -Z instrument-xray=skip-exit
|
||||
// compile-flags: -Z instrument-xray=ignore-loops,instruction-threshold=300
|
||||
// check-pass
|
||||
|
||||
fn main() {}
|
6
tests/ui/instrument-xray/flags-dupe-always.rs
Normal file
6
tests/ui/instrument-xray/flags-dupe-always.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Checks that `-Z instrument-xray` does not allow duplicates.
|
||||
//
|
||||
// compile-flags: -Z instrument-xray=always,always
|
||||
// error-pattern: incorrect value `always,always` for unstable option `instrument-xray`
|
||||
|
||||
fn main() {}
|
2
tests/ui/instrument-xray/flags-dupe-always.stderr
Normal file
2
tests/ui/instrument-xray/flags-dupe-always.stderr
Normal file
|
@ -0,0 +1,2 @@
|
|||
error: incorrect value `always,always` for unstable option `instrument-xray` - either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit` was expected
|
||||
|
6
tests/ui/instrument-xray/flags-dupe-ignore-loops.rs
Normal file
6
tests/ui/instrument-xray/flags-dupe-ignore-loops.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Checks that `-Z instrument-xray` does not allow duplicates.
|
||||
//
|
||||
// compile-flags: -Z instrument-xray=ignore-loops,ignore-loops
|
||||
// error-pattern: incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray`
|
||||
|
||||
fn main() {}
|
2
tests/ui/instrument-xray/flags-dupe-ignore-loops.stderr
Normal file
2
tests/ui/instrument-xray/flags-dupe-ignore-loops.stderr
Normal file
|
@ -0,0 +1,2 @@
|
|||
error: incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray` - either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit` was expected
|
||||
|
Loading…
Add table
Reference in a new issue