We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcdcb6b commit e36c1b8Copy full SHA for e36c1b8
src/librustdoc/doctest.rs
@@ -667,6 +667,18 @@ fn run_test(
667
"--extern=rustdoc_tests_merged_{edition}=",
668
edition = doctest.edition
669
));
670
+ for extern_str in &rustdoc_options.extern_strs {
671
+ if let Some((_cratename, path)) = extern_str.split_once('=') {
672
+ // Direct dependencies of the tests themselves are
673
+ // indirect dependencies of the test runner.
674
+ // They need to be in the library search path.
675
+ let dir = Path::new(path)
676
+ .parent()
677
+ .filter(|x| x.components().count() > 0)
678
+ .unwrap_or(Path::new("."));
679
+ compiler_runner.arg("-L").arg(dir);
680
+ }
681
682
extern_path.push(&output_bundle_file);
683
compiler_runner.arg(extern_path);
684
compiler_runner.arg(&runner_input_file);
0 commit comments