| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2025-06-11 | Update extracted-doctest feature documentation | Guillaume Gomez | -0/+1 | |
| 2025-06-10 | Add more tests to check extracted doctests feature | Guillaume Gomez | -3/+55 | |
| 2025-06-10 | Give more information into extracted doctest information | Guillaume Gomez | -2/+2 | |
| 2025-05-22 | Collect and use `#![doc(test(attr(..)))]` at module level too | Urgau | -29/+39 | |
| 2025-05-22 | Auto merge of #140527 - GuillaumeGomez:doctest-main-fn, r=notriddle | bors | -11/+9 | |
| Emit a warning if the doctest `main` function will not be run Fixes #140310. I think we could try to go much further like adding a "link" (ie UI annotations) on the `main` function in the doctest. However that will require some more computation, not sure if it's worth it or not. Can still be done in a follow-up if we want it. For now, this PR does two things: 1. Pass the `DiagCtxt` to the doctest parser to emit the warning. 2. Correctly generate the `Span` to where the doctest is starting (I hope the way I did it isn't too bad either...). cc `@fmease` r? `@notriddle` | ||||
| 2025-05-02 | Create a builder for DocTestBuilder type | Guillaume Gomez | -14/+9 | |
| 2025-05-02 | Emit a warning if the doctest `main` function will not be run | Guillaume Gomez | -0/+3 | |
| 2025-04-15 | Replace flag `--doctest-compilation-args` with a simpler one: ↵ | León Orell Valerian Liehr | -22/+0 | |
| `--doctest-build-arg` More notably, the value of the new flag does *not* get lexed shell-like and ad hoc. | ||||
| 2025-03-27 | Only take outer attributes into account when generating content between ↵ | Guillaume Gomez | -117/+14 | |
| first non-crate items and the crate items | ||||
| 2025-03-27 | Add new regression test for doctest | Guillaume Gomez | -0/+131 | |
| 2025-03-27 | Improve comment and test for generated doctest with code comments | Guillaume Gomez | -1/+23 | |
| 2025-03-27 | Correctly handle line comments in attributes and generate extern crates | Guillaume Gomez | -3/+27 | |
| outside of wrapping function | ||||
| 2025-03-27 | Correctly handle `fn main` in macro | Guillaume Gomez | -5/+5 | |
| 2025-02-28 | Fully qualify `Result` in generated doctest code | Guillaume Gomez | -1/+1 | |
| 2024-12-20 | Move test into the `tests.rs` file | Guillaume Gomez | -0/+22 | |
| 2024-08-13 | Run fmt | Guillaume Gomez | -1/+2 | |
| 2024-08-13 | Improve code readability | Guillaume Gomez | -0/+1 | |
| 2024-08-13 | Rename `DocTest` into `DocTestBuilder` | Guillaume Gomez | -3/+8 | |
| 2024-08-13 | Correctly handle doctests with invalid AST | Guillaume Gomez | -1/+1 | |
| 2024-08-13 | Split doctests into two categories: mergeable ones and standalone ones | Guillaume Gomez | -2/+3 | |
| 2024-08-13 | Split doctests between standalone and mergeable ones | Guillaume Gomez | -1/+1 | |
| 2024-08-13 | Simplify doctest tests | Guillaume Gomez | -27/+24 | |
| 2024-08-13 | Add `DocTest` type | Guillaume Gomez | -2/+16 | |
| 2024-07-29 | Reformat `use` declarations. | Nicholas Nethercote | -1/+2 | |
| The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options. | ||||
| 2024-06-07 | Fix broken rustdoc unit tests | Noah Lev | -22/+37 | |
| 2024-02-15 | add extra indent spaces for rust-playground link | yukang | -1/+43 | |
| 2023-04-25 | pass `unused_extern_crates` in `librustdoc::doctest::make_test` | ozkanonur | -0/+4 | |
| Signed-off-by: ozkanonur <work@onurozkan.dev> | ||||
| 2021-12-12 | Rename `TestOptions` to `GlobalTestOptions` | Noah Lev | -17/+17 | |
| It seems to apply to all doctests in the crate. | ||||
| 2021-11-26 | Remove `--display-doctest-warnings` | Joshua Nelson | -16/+1 | |
| This can be replicated in full with other existing features, there's no need to have a separate option for it. This also fixes a bug where `--test-args=--show-output` had no effect, and updates the documentation. | ||||
| 2021-09-14 | Rename --display-warnings to --display-doctest-warnings | Guillaume Gomez | -3/+4 | |
| 2021-02-11 | Fix injected errors when running doctests on a crate named after a keyword | Joshua Nelson | -4/+4 | |
| Unfortunately, this can't currently be tested. The problem is that we need the file to be compiled first to then be used as dependency, which cannot be done currently unfortunately in the rustdoc test suites. Example: ```rust // name this file "foo.rs" /// ``` /// let x = foo::foo(); /// ``` pub fn foo() {} ``` If you run `rustdoc --test foo.rs`, you'll get: ``` running 1 test test foo.rs - foo (line 1) ... FAILED failures: ---- foo.rs - foo (line 1) stdout ---- error[E0463]: can't find crate for `foo` --> foo.rs:0:1 | 2 | extern crate foo; | ^^^^^^^^^^^^^^^^^ can't find crate ``` If a test were possible, it would look something like ````rust #![crate_name = "mod"] #![crate_type = "lib"] //! ``` //! // NOTE: requires that the literal string 'mod' appears in the doctest for //! // the bug to appear //! assert_eq!(1, 1); //! ``` ```` | ||||
| 2020-12-29 | Remove unnecessary semicolon from Rustdoc-generated code | Aaron Hill | -2/+2 | |
| 2020-12-20 | add an attribute to inner doctest fn | Arpad Borsos | -3/+3 | |
| 2020-12-19 | Remap instrument-coverage line numbers in doctests | Arpad Borsos | -17/+52 | |
| This uses the `SourceMap::doctest_offset_line` method to re-map line numbers from doctests. Remapping columns is not yet done. Part of issue #79417. | ||||
| 2020-11-17 | Update doctest tests | Guillaume Gomez | -34/+34 | |
| 2020-08-27 | Rename rustdoc/test -> rustdoc/doctest | Aleksey Kladov | -0/+279 | |
| This modules contains the implementation of doctests, and not the tests of rustdoc itself. This name is confusing, so let's rename it to doctest for clarity. | ||||
