aboutsummaryrefslogtreecommitdiff
path: root/xtask/tests/tidy-tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-25 12:16:46 +0100
committerAleksey Kladov <[email protected]>2019-10-25 12:47:48 +0100
commit0dd35ff2b2ceffdb926953fdacc7d30e1968047d (patch)
treea8bcab00ef1c434e56845034f22a5595d119dea7 /xtask/tests/tidy-tests
parent518f99e16b993e3414a81181c8bad7a89e590ece (diff)
auto-generate assists docs and tests
Diffstat (limited to 'xtask/tests/tidy-tests')
-rw-r--r--xtask/tests/tidy-tests/cli.rs7
-rw-r--r--xtask/tests/tidy-tests/docs.rs4
2 files changed, 10 insertions, 1 deletions
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
@@ -19,6 +19,13 @@ fn generated_tests_are_fresh() {
19} 19}
20 20
21#[test] 21#[test]
22fn generated_assists_are_fresh() {
23 if let Err(error) = codegen::generate_assists_docs(Mode::Verify) {
24 panic!("{}. Please update assists by running `cargo xtask codegen`", error);
25 }
26}
27
28#[test]
22fn check_code_formatting() { 29fn check_code_formatting() {
23 if let Err(error) = run_rustfmt(Mode::Verify) { 30 if let Err(error) = run_rustfmt(Mode::Verify) {
24 panic!("{}. Please format the code by running `cargo format`", error); 31 panic!("{}. Please format the code by running `cargo format`", error);
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};
8use xtask::project_root; 8use xtask::project_root;
9 9
10fn is_exclude_dir(p: &Path) -> bool { 10fn is_exclude_dir(p: &Path) -> bool {
11 let exclude_dirs = ["tests", "test_data"]; 11 // Test hopefully don't really need comments, and for assists we already
12 // have special comments which are source of doc tests and user docs.
13 let exclude_dirs = ["tests", "test_data", "assists"];
12 let mut cur_path = p; 14 let mut cur_path = p;
13 while let Some(path) = cur_path.parent() { 15 while let Some(path) = cur_path.parent() {
14 if exclude_dirs.iter().any(|dir| path.ends_with(dir)) { 16 if exclude_dirs.iter().any(|dir| path.ends_with(dir)) {