about summary refs log tree commit diff
path: root/src/librustdoc/test.rs
AgeCommit message (Collapse)AuthorLines
2019-04-22upgrade rustdoc's pulldown-cmark to 0.4.1Andy Russell-5/+1
2019-04-02Update rustdocOliver Scherer-1/+1
2019-03-30Remove redundant importFabian Drinck-2/+1
2019-03-10Make the rustc driver and interface demand drivenJohn Kåre Alsaker-172/+122
2019-03-07Keep current behavior while accepting error countEsteban Küber-1/+1
2019-03-07fix bad use of with_emitterEsteban Küber-2/+2
2019-02-28Introduce rustc_interface and move some methods thereJohn Kåre Alsaker-7/+8
2019-02-24hir: remove NodeId from Lifetime and Tyljedrz-1/+1
2019-02-24Auto merge of #58232 - ljedrz:HirIdification_continued, r=Zoxcbors-1/+1
HirId-ify intravisit A big step towards https://github.com/rust-lang/rust/pull/57578. This affects mostly `hir::{collector, intravisit}` and `rustc::lint`.
2019-02-23Transition librustdoc to 2018 editionHirokazu Hata-3/+3
2019-02-20hir: HirId-ify intravisitljedrz-1/+1
2019-02-20Rollup merge of #56470 - llogiq:process-termination-doctest, r=GuillaumeGomezkennytm-4/+10
Modify doctest's auto-`fn main()` to allow `Result`s This lets the default `fn main()` ~~return `impl Termination`~~ unwrap Results, which allows the use of `?` in most tests without adding it manually. This fixes #56260 ~~Blocked on `std::process::Termination` stabilization.~~ Using `Termination` would have been cleaner, but this should work OK.
2019-02-17Modify doctest's auto-`fn main()` to allow `Result`sAndre Bogus-4/+10
This lets the default `fn main()` unwrap any `Result`s, which allows the use of `?` in most tests without adding it manually.
2019-01-20rustdoc: Don't modify library path for doctestsOliver Middleton-20/+3
It shouldn't be needed anymore because doctests are no longer compiled with `prefer-dynamic`.
2019-01-17Minor changes to wording and formatting.Wesley Norris-1/+2
2019-01-17Fix tidy error.Wesley Norris-2/+10
2019-01-17Persist doc test executables to given path.Wesley Norris-5/+37
2019-01-13Always calculate glob map but only for glob usesIgor Matuszewski-2/+0
Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance.
2019-01-07semi-revert libsyntax doctest parsing if a macro is wrapping mainQuietMisdreavus-3/+48
2019-01-05Rollup merge of #57338 - QuietMisdreavus:doctest-file-name, r=GuillaumeGomezkennytm-2/+2
rustdoc: force binary filename for compiled doctests Fixes https://github.com/rust-lang/rust/issues/57317, needed for https://github.com/rust-lang/rust-by-example/issues/1137 Right now, when building a doctest, rustdoc provides the compiler an output directory (a temp dir) but lets the compiler name the executable. If the doctest needs to be executed, it then tries to run a binary named `rust_out` from that directory. For the most part, this works fine. However, if the doctest sets its own crate name, the compiler uses that name for the output binary instead. This causes rustdoc to try to execute a nonexistent binary, causing the test to fail. This PR changes the paths rustdoc gives to the compiler when building doctests to force the output *filename* instead of just the *directory*.
2019-01-04force binary filename for compiled doctestsQuietMisdreavus-2/+2
2019-01-02make `panictry!` private to libsyntaxAndy Russell-4/+9
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2018-12-26Store `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.Alexander Regueiro-3/+3
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-16Rollup merge of #56793 - QuietMisdreavus:better-doctests, r=GuillaumeGomezMazdak Farrokhzad-16/+58
rustdoc: look for comments when scraping attributes/crates from doctests Fixes https://github.com/rust-lang/rust/issues/56727 When scraping out crate-level attributes and `extern crate` statements, we wouldn't look for comments, so any presence of comments would shunt it and everything after it into "everything else". This could cause parsing issues when looking for `fn main` and `extern crate my_crate` later on, which would in turn cause rustdoc to incorrectly wrap a test with `fn main` when it already had one declared. I took the opportunity to clean up the logic a little bit, but it would still benefit from a libsyntax-based loop like the `fn main` detection.
2018-12-14include comments in doctest partition logicQuietMisdreavus-16/+55
2018-12-13add `crates` to the final doctestQuietMisdreavus-0/+3
2018-12-12Introduce `SearchPath` and replace `SearchPaths` with `Vec<SearchPath>`.Nicholas Nethercote-4/+4
It's more idiomatic, makes the code shorter, and will help with the next commit.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-51/+51
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-9/+9
fixes remaining test failures
2018-11-05Auto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomezbors-34/+25
rustdoc: refactor: centralize all command-line argument parsing This is something i've wanted to do for a while, since we keep having to add new arguments to places like `rust_input` or `core::run_core` whenever we add a new CLI flag or the like. Those functions have inflated up to 11-19, and in some cases hiding away the locations where some CLI flags were being parsed, obscuring their use. Now, we have a central place where all command-line configuration occurs, including argument validation. One note about the design: i grouped together all the arguments that `html::render::run` needed, so that i could pass them on from compilation in one lump instead of trying to thread through individual items or clone the entire blob ahead of time. One other thing this adds is that rustdoc also now recognizes all the `-Z` options that rustc does, since we were manually grabbing a few previously. Now we parse a full `DebuggingOptions` struct and hand it directly to rustc when scraping docs.
2018-11-02pass the Options struct instead of individual argsQuietMisdreavus-34/+25
2018-11-01buffer errors from initial tokenization when parsingQuietMisdreavus-4/+11
2018-11-01silence errors found during doctest pre-parsingQuietMisdreavus-1/+11
2018-11-01add a line between extracted crates and everything elseQuietMisdreavus-0/+3
2018-11-01Separates inner attributes from code during doctest parsing.Wesley Norris-23/+37
2018-11-01Tidy up source file and fix typo.Wesley Norris-6/+6
2018-11-01Replaces fn main search and extern crate search with proper parsing.Wesley Norris-14/+81
2018-10-26Remove redundant cloneShotaro Yamada-2/+2
2018-10-18Auto merge of #54349 - GuillaumeGomez:no-example-lint, r=QuietMisdreavusbors-25/+35
[rustdoc] Add lint for doc without codeblocks Fixes #53805. r? @QuietMisdreavus
2018-10-09Use default of preferring static over dynamic linking in rustdoc tests.Felix S. Klock II-1/+0
2018-10-09Add lint for doc without codeblocksGuillaume Gomez-25/+35
2018-09-22Rollup merge of #54350 - Munksgaard:support-edition-in-doc-test, r=steveklabnikPietro Albini-1/+1
Support specifying edition in doc test Fixes #52623 r? @QuietMisdreavus
2018-09-19Add support for running doc test in specific editionPhilip Munksgaard-1/+1
2018-09-18Remove unneeded clone() from testsErich Cordoba-4/+4
The expected.clone() calls were not needed for the tests. This is just to keep consistency between the test cases.
2018-08-19mv codemap source_mapDonato Sciarra-14/+14
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19mv CodeMap SourceMapDonato Sciarra-6/+6
2018-08-09set the syntax edition in the driver's phase 1QuietMisdreavus-2/+1
2018-08-04Move basic_options to impl of DefaultMark Rousskov-2/+2