1
Fork 0

rustdoc: Don't run Markdown tests twice

This matches the behaviour for finding tests in Rust files.
This commit is contained in:
Oliver Middleton 2017-07-05 15:47:54 +01:00
parent ccf401f8f7
commit 1966a6798d

View file

@ -163,8 +163,12 @@ pub fn test(input: &str, cfgs: Vec<String>, libs: SearchPaths, externs: Externs,
true, opts, maybe_sysroot, None, true, opts, maybe_sysroot, None,
Some(input.to_owned()), Some(input.to_owned()),
render_type); render_type);
old_find_testable_code(&input_str, &mut collector, DUMMY_SP); if render_type == RenderType::Pulldown {
find_testable_code(&input_str, &mut collector, DUMMY_SP); old_find_testable_code(&input_str, &mut collector, DUMMY_SP);
find_testable_code(&input_str, &mut collector, DUMMY_SP);
} else {
old_find_testable_code(&input_str, &mut collector, DUMMY_SP);
}
test_args.insert(0, "rustdoctest".to_string()); test_args.insert(0, "rustdoctest".to_string());
testing::test_main(&test_args, collector.tests, testing::test_main(&test_args, collector.tests,
testing::Options::new().display_output(display_warnings)); testing::Options::new().display_output(display_warnings));