Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ impl<'a> Builder<'a> {
crate::toolstate::ToolStateCheck,
test::ExpandYamlAnchors,
test::Tidy,
test::TidySelfTest,
test::Ui,
test::RunPassValgrind,
test::MirOpt,
Expand Down
34 changes: 34 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,40 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
}
}

/// Runs tidy's own tests.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct TidySelfTest;

impl Step for TidySelfTest {
type Output = ();
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.alias("tidyselftest")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(TidySelfTest);
}

fn run(self, builder: &Builder<'_>) {
let bootstrap_host = builder.config.build;
let compiler = builder.compiler(0, bootstrap_host);
let cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolBootstrap,
bootstrap_host,
"test",
"src/tools/tidy",
SourceType::InTree,
&[],
);
try_run(builder, &mut cargo.into());
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct ExpandYamlAnchors;

Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/mingw-check-tidy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy
ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy tidyselftest
4 changes: 2 additions & 2 deletions src/tools/tidy/src/features/version/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fn test_try_from_invalid_version() {

#[test]
fn test_try_from_single() {
assert_eq!("1.32.0".parse(), Ok(Version { parts: [1, 32, 0] }));
assert_eq!("1.0.0".parse(), Ok(Version { parts: [1, 0, 0] }));
assert_eq!("1.32.0".parse(), Ok(Version::Explicit { parts: [1, 32, 0] }));
assert_eq!("1.0.0".parse(), Ok(Version::Explicit { parts: [1, 0, 0] }));
}

#[test]
Expand Down