Skip to content

compiletest: make some internals pub for use as a library#154997

Open
akintewe wants to merge 1 commit intorust-lang:mainfrom
akintewe:compiletest-make-public
Open

compiletest: make some internals pub for use as a library#154997
akintewe wants to merge 1 commit intorust-lang:mainfrom
akintewe:compiletest-make-public

Conversation

@akintewe
Copy link
Copy Markdown

@akintewe akintewe commented Apr 8, 2026

Make Config, TestPaths, CollectedTest, CollectedTestDesc, ShouldFail, FileDirectives, parse_config and collect_and_make_tests public so that external tools can depend on compiletest as a library and use its test collection infrastructure directly, without re-implementing parts of bootstrap and compiletest.

r? jackh726

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 8, 2026

compiletest directives have been modified. Please add or update docs for the
new or modified directive in src/doc/rustc-dev-guide/.

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 8, 2026
@akintewe akintewe force-pushed the compiletest-make-public branch from 15fdf1d to b750a8b Compare April 8, 2026 16:55
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 8, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@akintewe akintewe force-pushed the compiletest-make-public branch from 534e6af to b750a8b Compare April 8, 2026 17:08
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Make Config, TestPaths, CollectedTest, CollectedTestDesc, ShouldFail,
FileDirectives, parse_config and collect_and_make_tests public so that
external tools can depend on compiletest as a library and use its test
collection infrastructure directly.

r? jackh726
@akintewe akintewe force-pushed the compiletest-make-public branch from b750a8b to 590c610 Compare April 8, 2026 17:27
@akintewe akintewe requested a review from jackh726 April 8, 2026 17:28
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
fmt: checked 6782 files
Diff in /checkout/src/tools/compiletest/src/lib.rs:24:
 mod util;
 
 // Re-export types needed by external tools that use compiletest as a library.
-pub use common::{Config, TestPaths};
-pub use executor::{CollectedTest, CollectedTestDesc, ShouldFail};
-
 use core::panic;
 use std::collections::HashSet;
 use std::fmt::Write;
Diff in /checkout/src/tools/compiletest/src/lib.rs:37:
 
 use build_helper::git::{get_git_modified_files, get_git_untracked_files};
 use camino::{Utf8Component, Utf8Path, Utf8PathBuf};
+pub use common::{Config, TestPaths};
+pub use executor::{CollectedTest, CollectedTestDesc, ShouldFail};
 use getopts::Options;
 use rayon::iter::{ParallelBridge, ParallelIterator};
 use tracing::debug;
Diff in /checkout/src/tools/compiletest/src/lib.rs:44:
 
 use self::directives::{EarlyProps, make_test_description};
 use crate::common::{
-    CodegenBackend, CompareMode, Debugger, PassMode, TestMode, UI_EXTENSIONS,
-    expected_output_path, output_base_dir, output_relative_path,
+    CodegenBackend, CompareMode, Debugger, PassMode, TestMode, UI_EXTENSIONS, expected_output_path,
+    output_base_dir, output_relative_path,
 };
 use crate::directives::{AuxProps, DirectivesCache, FileDirectives};
 use crate::edition::parse_edition;
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:00:46
  local time: Wed Apr  8 17:31:59 UTC 2026
  network time: Wed, 08 Apr 2026 17:31:59 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants