-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc-json: replace jsondocck with jsondocckng #94140
Comments
2 Possible approaches for this: 1 Crate per testEach test is its own crate (in addition to the crate being documented). Rustbuild documents the More concretely foo.rs pub fn foo() {} foo_test.rs use jsondocck::{TCrate, main_test}
fn main() {main_test(test);}
fn test(t: TCrate) {
let foo = t.get_root::<Function>("foo");
assert_eq!(foo.decl.output, None);
} One crate for all testsAll tests live in the same (binary) crate. rustbuild the test document and builds the one test crate, and then calls the test crate binary with the name of the test to run and the path to json. The test crate has the all the test functions within it, and calls the appropried one based on the name of the test passed on the command line This feels simpler to impement, but may lead to a slower feedback loop, as the whole test crate needs to be recompilled whenever the contents of a single test is changed. I'm not sure which direction to go here, and would realy apprciate input |
Personally, 1 sounds better. I like the idea of one crate per test, with a helper they all rely on. On the other hand I agree it may be a little more complex. |
After some zulip discussion with @_Mark-Simulacrum, it looks like one-crate-per-test is infeasable, because compiletest can't build crates that have crates.io dependencys (needed for serde_json). Additionaly this looks alot like #40713 |
It might be worth just rewriting src/etc/check_missing_items.py to start with, as that should fit nicely into rustbuild, and it's out of sync whenever the format changes (and even when it doesn't due to undertesting). Eg pub type RefFn<'a> = &'a dyn for<'b> Fn(&'a i32) -> i32; fails it. Theirs a very barebones implementation here. |
dependencies: reduce the amount of crates pulling in atty It would be nice to have only one `hermit-abi` in `Cargo.lock` (rust-lang#107405 (comment)). The only crate pulling in the old `hermit-abi` version is `atty`, which is unmaintained. This PR upgrades three dependencies, which then no longer depend on `atty`: * `Cargo.lock`: `colored v2.0.0 -> v2.0.4` * `Cargo.lock`: `tracing-tree v0.2.3 -> v0.2.4` * Miri: `env_logger 0.9.3 -> 0.10.0` The only dependency chain left that pulls in `hermit-abi 0.1.19` is: `hermit-abi 0.1.19` -> `atty 0.2.14` -> `env_logger 0.7.1` -> `jsonpath_lib 0.2.6` -> `jsondocck 0.1.0` (src/tools/jsondocck) Replacing jsondocck with jsondocckng is tracked in rust-lang#94140.
dependencies: reduce the amount of crates pulling in atty It would be nice to have only one `hermit-abi` in `Cargo.lock` (rust-lang/rust#107405 (comment)). The only crate pulling in the old `hermit-abi` version is `atty`, which is unmaintained. This PR upgrades three dependencies, which then no longer depend on `atty`: * `Cargo.lock`: `colored v2.0.0 -> v2.0.4` * `Cargo.lock`: `tracing-tree v0.2.3 -> v0.2.4` * Miri: `env_logger 0.9.3 -> 0.10.0` The only dependency chain left that pulls in `hermit-abi 0.1.19` is: `hermit-abi 0.1.19` -> `atty 0.2.14` -> `env_logger 0.7.1` -> `jsonpath_lib 0.2.6` -> `jsondocck 0.1.0` (src/tools/jsondocck) Replacing jsondocck with jsondocckng is tracked in rust-lang/rust#94140.
We want to use https://github.com/aDotInTheVoid/jsondocckng which allows writing the tests in a seperate rust files, instread of the current
jsondocck
andcheck_missing_items.py
Reasons to do this
JsonPath
and@set
... commands"$.index[*][?(@.name=='...')]
) can be converted to rust code to avoid duplication. Paths referenced repeatedly can be replaced with a let'"\"vectorcall\""'
Drawbacks
Todo
@rustbot modify labels: +A-contributor-roadblock +A-testsuite +T-rustdoc +A-rustdoc-json +A-rustbuild
The text was updated successfully, but these errors were encountered: