Fix can_run_doc_tests order depends on hash.
authorEric Huss <eric@huss.org>
Sun, 4 Nov 2018 18:38:51 +0000 (10:38 -0800)
committerXimin Luo <infinity0@debian.org>
Fri, 9 Nov 2018 10:56:54 +0000 (10:56 +0000)
The deps are sorted, but the name is the same so the order depends on the metadata hash.
Fix by sorting by the actual name, too.

Gbp-Pq: Name 1002_fix_doc_tests_order_hash.patch

src/cargo/core/compiler/context/mod.rs
tests/testsuite/rename_deps.rs

index 197356b2424ebdcfbac6f396f33175881e9329fa..dead2cb3feda890c644951fd77a0862c91a367c9 100644 (file)
@@ -259,6 +259,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
                         }
                     }
                 }
+                // Help with tests to get a stable order with renamed deps.
+                doctest_deps.sort();
                 self.compilation.to_doc_test.push(compilation::Doctest {
                     package: unit.pkg.clone(),
                     target: unit.target.clone(),
index fce7f2249e2975fc245725b436912723b10ae78c..0eac889a3da6be15ac33955fe6b551cad87c7e0f 100644 (file)
@@ -333,8 +333,8 @@ fn can_run_doc_tests() {
 [DOCTEST] foo
 [RUNNING] `rustdoc --test [CWD]/src/lib.rs \
         [..] \
-        --extern baz=[CWD]/target/debug/deps/libbar-[..].rlib \
         --extern bar=[CWD]/target/debug/deps/libbar-[..].rlib \
+        --extern baz=[CWD]/target/debug/deps/libbar-[..].rlib \
         [..]`
 ",
         ).run();