about summary refs log tree commit diff
path: root/xtask/tests
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2019-10-25 14:16:46 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2019-10-25 14:47:48 +0300
commit0dd35ff2b2ceffdb926953fdacc7d30e1968047d (patch)
treea8bcab00ef1c434e56845034f22a5595d119dea7 /xtask/tests
parent518f99e16b993e3414a81181c8bad7a89e590ece (diff)
downloadrust-0dd35ff2b2ceffdb926953fdacc7d30e1968047d.tar.gz
rust-0dd35ff2b2ceffdb926953fdacc7d30e1968047d.zip
auto-generate assists docs and tests
Diffstat (limited to 'xtask/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 543c7d7c453..573ffadbf8e 100644
--- a/xtask/tests/tidy-tests/cli.rs
+++ b/xtask/tests/tidy-tests/cli.rs
@@ -19,6 +19,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) {
         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 fe5852bc628..b766aeff16d 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)) {