diff options
author | Eric Huss <eric@huss.org> | 2018-11-04 10:38:51 -0800 |
---|---|---|
committer | Vasudev Kamath <vasudev@copyninja.info> | 2018-12-11 20:57:21 +0530 |
commit | 7cbc1d65072943aa2f8dbb4765c873f951d416b8 (patch) | |
tree | faee0abec74dd0e27a0279df03d6d71ca94fe2e4 | |
parent | 1809d591b96fd1d98a4702bc2c2ea03614e89eb6 (diff) |
[PATCH] Fix can_run_doc_tests order depends on hash.
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
-rw-r--r-- | src/cargo/core/compiler/context/mod.rs | 2 | ||||
-rw-r--r-- | tests/testsuite/rename_deps.rs | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/cargo/core/compiler/context/mod.rs b/src/cargo/core/compiler/context/mod.rs index 197356b24..dead2cb3f 100644 --- a/src/cargo/core/compiler/context/mod.rs +++ b/src/cargo/core/compiler/context/mod.rs @@ -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(), diff --git a/tests/testsuite/rename_deps.rs b/tests/testsuite/rename_deps.rs index fce7f2249..0eac889a3 100644 --- a/tests/testsuite/rename_deps.rs +++ b/tests/testsuite/rename_deps.rs @@ -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(); |