aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/ui.rs
blob: 33848b2ae79ec6954173417cc32f5ec4570eeb9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use trybuild::TestCases;
use version_check as rustc;

#[cfg_attr(not(windows), test)]
fn ui() {
    let t = TestCases::new();
    t.compile_fail("tests/ui/*.rs");

    if rustc::is_min_version("1.58").unwrap() {
        t.compile_fail("tests/ui/since_1.58/*.rs");
    }

    if rustc::is_max_version("1.57").unwrap() {
        t.compile_fail("tests/ui/before_1.58/*.rs");
    }

    if rustc::is_min_version("1.54").unwrap() && rustc::is_max_version("1.57").unwrap() {
        t.compile_fail("tests/ui/1.54_to_1.57/*.rs");
    }

    if rustc::is_max_version("1.53").unwrap() {
        t.compile_fail("tests/ui/before_1.54/*.rs");
    }
}