about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-07-08 20:03:32 +0000
committerbors <bors@rust-lang.org>2020-07-08 20:03:32 +0000
commit8aa18cbdc5d4bc33bd61e2d9a4b643d87f5d21de (patch)
tree3653ae1b581d96a6e366c6ba9f96e584dd8b7be6 /src
parent1d919c9377f4602d991ca1c7ba852e7555943740 (diff)
parent723872639995246b586473867ded975465e1466f (diff)
downloadrust-8aa18cbdc5d4bc33bd61e2d9a4b643d87f5d21de.tar.gz
rust-8aa18cbdc5d4bc33bd61e2d9a4b643d87f5d21de.zip
Auto merge of #74153 - ehuss:fix-bootstrap-test-librustc, r=Mark-Simulacrum
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`.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/test.rs4
-rw-r--r--src/librustc_errors/json/tests.rs1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 31253255809..1916d96bed7 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -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 {
@@ -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);
             }
         }
diff --git a/src/librustc_errors/json/tests.rs b/src/librustc_errors/json/tests.rs
index 35912901d68..a2ed6ad6f35 100644
--- a/src/librustc_errors/json/tests.rs
+++ b/src/librustc_errors/json/tests.rs
@@ -59,6 +59,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
             sm,
             true,
             HumanReadableErrorType::Short(ColorConfig::Never),
+            None,
             false,
         );