Skip to content

Commit

Permalink
Rollup merge of #74153 - ehuss:fix-bootstrap-test-librustc, r=Mark-Si…
Browse files Browse the repository at this point in the history
…mulacrum

Fix x.py test for librustc crates.

#73352 introduced a bug where `x.py test src/librustc_ast` would fail to actually run the tests. The issue is that `krate` and `all_krates` were changed to return relative paths. This caused the code to do a test of "relative_path ends with absolute path" which is always false.  The solution is to swap that around.

The change to `Crate` isn't necessary, it just simplifies the code and makes it uniform with `CrateLibrustc`.
  • Loading branch information
Manishearth authored Jul 8, 2020
2 parents 0a2bacf + 7238726 commit 73b5236
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ impl Step for CrateLibrustc {
let compiler = builder.compiler(builder.top_stage, run.host);

for krate in builder.in_tree_crates("rustc-main") {
if run.path.ends_with(&krate.path) {
if krate.path.ends_with(&run.path) {
let test_kind = builder.kind.into();

builder.ensure(CrateLibrustc {
Expand Down Expand Up @@ -1669,7 +1669,7 @@ impl Step for Crate {
};

for krate in builder.in_tree_crates("test") {
if run.path.ends_with(&krate.local_path(&builder)) {
if krate.path.ends_with(&run.path) {
make(Mode::Std, krate);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_errors/json/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
sm,
true,
HumanReadableErrorType::Short(ColorConfig::Never),
None,
false,
);

Expand Down

0 comments on commit 73b5236

Please sign in to comment.