diff options
Diffstat (limited to 'tests/trybuild.rs')
-rw-r--r-- | tests/trybuild.rs | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/tests/trybuild.rs b/tests/trybuild.rs index 32f38cc..3ea1c3b 100644 --- a/tests/trybuild.rs +++ b/tests/trybuild.rs @@ -1,29 +1,19 @@ -// Copyright 2019 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// UI tests depend on the exact error messages emitted by rustc, but those error -// messages are not stable, and sometimes change between Rust versions. Thus, we -// maintain one set of UI tests for each Rust version that we test in CI, and we -// pin to specific versions in CI (a specific stable version, a specific date of -// the nightly compiler, and a specific MSRV). Updating those pinned versions -// may also require updating these tests. -// - `tests/ui-nightly` - Contains the source of truth for our UI test source -// files (`.rs`), and contains `.err` and `.out` files for nightly -// - `tests/ui-stable` - Contains symlinks to the `.rs` files in -// `tests/ui-nightly`, and contains `.err` and `.out` files for stable -// - `tests/ui-msrv` - Contains symlinks to the `.rs` files in -// `tests/ui-nightly`, and contains `.err` and `.out` files for MSRV - -#[rustversion::nightly] -const SOURCE_FILES_GLOB: &str = "tests/ui-nightly/*.rs"; -#[rustversion::stable(1.69.0)] -const SOURCE_FILES_GLOB: &str = "tests/ui-stable/*.rs"; -#[rustversion::stable(1.61.0)] -const SOURCE_FILES_GLOB: &str = "tests/ui-msrv/*.rs"; +// Copyright 2019 The Fuchsia Authors +// +// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0 +// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT +// license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option. +// This file may not be copied, modified, or distributed except according to +// those terms. #[test] +#[cfg_attr(miri, ignore)] fn ui() { + let version = testutil::ToolchainVersion::extract_from_pwd().unwrap(); + // See the doc comment on this method for an explanation of what this does + // and why we store source files in different directories. + let source_files_dirname = version.get_ui_source_files_dirname_and_maybe_print_warning(); + let t = trybuild::TestCases::new(); - t.compile_fail(SOURCE_FILES_GLOB); + t.compile_fail(format!("tests/{source_files_dirname}/*.rs")); } |