From 0dd35ff2b2ceffdb926953fdacc7d30e1968047d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Oct 2019 14:16:46 +0300 Subject: auto-generate assists docs and tests --- xtask/tests/tidy-tests/cli.rs | 7 +++++++ xtask/tests/tidy-tests/docs.rs | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'xtask/tests/tidy-tests') diff --git a/xtask/tests/tidy-tests/cli.rs b/xtask/tests/tidy-tests/cli.rs index 543c7d7c4..573ffadbf 100644 --- a/xtask/tests/tidy-tests/cli.rs +++ b/xtask/tests/tidy-tests/cli.rs @@ -18,6 +18,13 @@ fn generated_tests_are_fresh() { } } +#[test] +fn generated_assists_are_fresh() { + if let Err(error) = codegen::generate_assists_docs(Mode::Verify) { + panic!("{}. Please update assists by running `cargo xtask codegen`", error); + } +} + #[test] fn check_code_formatting() { if let Err(error) = run_rustfmt(Mode::Verify) { diff --git a/xtask/tests/tidy-tests/docs.rs b/xtask/tests/tidy-tests/docs.rs index fe5852bc6..b766aeff1 100644 --- a/xtask/tests/tidy-tests/docs.rs +++ b/xtask/tests/tidy-tests/docs.rs @@ -8,7 +8,9 @@ use walkdir::{DirEntry, WalkDir}; use xtask::project_root; fn is_exclude_dir(p: &Path) -> bool { - let exclude_dirs = ["tests", "test_data"]; + // Test hopefully don't really need comments, and for assists we already + // have special comments which are source of doc tests and user docs. + let exclude_dirs = ["tests", "test_data", "assists"]; let mut cur_path = p; while let Some(path) = cur_path.parent() { if exclude_dirs.iter().any(|dir| path.ends_with(dir)) { -- cgit v1.2.3