-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups #143823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
33668c1
832b627
b4dfd51
4aad9ab
b9ae117
6f8a7f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,14 @@ use camino::{Utf8Path, Utf8PathBuf}; | |
use semver::Version; | ||
use serde::de::{Deserialize, Deserializer, Error as _}; | ||
|
||
pub use self::Mode::*; | ||
pub use self::TestMode::*; | ||
use crate::executor::{ColorConfig, OutputFormat}; | ||
use crate::fatal; | ||
use crate::util::{Utf8PathBufExt, add_dylib_path, string_enum}; | ||
|
||
string_enum! { | ||
#[derive(Clone, Copy, PartialEq, Debug)] | ||
pub enum Mode { | ||
pub enum TestMode { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. However, note that |
||
Pretty => "pretty", | ||
DebugInfo => "debuginfo", | ||
Codegen => "codegen", | ||
|
@@ -34,7 +34,7 @@ string_enum! { | |
} | ||
} | ||
|
||
impl Mode { | ||
impl TestMode { | ||
pub fn aux_dir_disambiguator(self) -> &'static str { | ||
// Pretty-printing tests could run concurrently, and if they do, | ||
// they need to keep their output segregated. | ||
|
@@ -147,7 +147,7 @@ pub enum Sanitizer { | |
/// (for changed test detection). | ||
#[derive(Debug, Clone)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remark: I was wondering what a default |
||
pub struct Config { | ||
/// Some test [`Mode`]s support [snapshot testing], where a *reference snapshot* of outputs (of | ||
/// Some [`TestMode`]s support [snapshot testing], where a *reference snapshot* of outputs (of | ||
/// `stdout`, `stderr`, or other form of artifacts) can be compared to the *actual output*. | ||
/// | ||
/// This option can be set to `true` to update the *reference snapshots* in-place, otherwise | ||
|
@@ -269,20 +269,20 @@ pub struct Config { | |
/// FIXME: reconsider this string; this is hashed for test build stamp. | ||
pub stage_id: String, | ||
|
||
/// The test [`Mode`]. E.g. [`Mode::Ui`]. Each test mode can correspond to one or more test | ||
/// The [`TestMode`]. E.g. [`TestMode::Ui`]. Each test mode can correspond to one or more test | ||
/// suites. | ||
/// | ||
/// FIXME: stop using stringly-typed test suites! | ||
pub mode: Mode, | ||
pub mode: TestMode, | ||
|
||
/// The test suite. | ||
/// | ||
/// Example: `tests/ui/` is the "UI" test *suite*, which happens to also be of the [`Mode::Ui`] | ||
/// test *mode*. | ||
/// Example: `tests/ui/` is the "UI" test *suite*, which happens to also be of the | ||
/// [`TestMode::Ui`] test *mode*. | ||
/// | ||
/// Note that the same test directory (e.g. `tests/coverage/`) may correspond to multiple test | ||
/// modes, e.g. `tests/coverage/` can be run under both [`Mode::CoverageRun`] and | ||
/// [`Mode::CoverageMap`]. | ||
/// modes, e.g. `tests/coverage/` can be run under both [`TestMode::CoverageRun`] and | ||
/// [`TestMode::CoverageMap`]. | ||
/// | ||
/// FIXME: stop using stringly-typed test suites! | ||
pub suite: String, | ||
|
@@ -538,8 +538,8 @@ pub struct Config { | |
// Configuration for various run-make tests frobbing things like C compilers or querying about | ||
// various LLVM component information. | ||
// | ||
// FIXME: this really should be better packaged together. | ||
// FIXME: these need better docs, e.g. for *host*, or for *target*? | ||
// FIXME: this really should be better packaged together. FIXME: these need better docs, e.g. | ||
// for *host*, or for *target*? | ||
pub cc: String, | ||
pub cxx: String, | ||
pub cflags: String, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I'm also going to double-check if we need
string_enum
at all (or if it even makes sense in this formulation) in a follow-up.