about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-07-07 09:14:50 +0200
committerLukas Wirth <lukastw97@gmail.com>2024-07-07 09:14:50 +0200
commit7a2c8c2b39fbc8d84af666a8141d903fd43ddbc9 (patch)
tree36689e3a1f9ed2dcabec20c7aedfda413e123ac0
parent6f346c91bee8d35b22fc5a94d9224b7e00178cb8 (diff)
downloadrust-7a2c8c2b39fbc8d84af666a8141d903fd43ddbc9.tar.gz
rust-7a2c8c2b39fbc8d84af666a8141d903fd43ddbc9.zip
Run codegen commands as tests if their results are commited
-rw-r--r--src/tools/rust-analyzer/crates/parser/src/syntax_kind/generated.rs2
-rw-r--r--src/tools/rust-analyzer/crates/syntax/src/ast/generated/nodes.rs2
-rw-r--r--src/tools/rust-analyzer/crates/syntax/src/ast/generated/tokens.rs2
-rw-r--r--src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs5
-rw-r--r--src/tools/rust-analyzer/xtask/src/codegen/grammar.rs5
-rw-r--r--src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs5
-rw-r--r--src/tools/rust-analyzer/xtask/src/tidy.rs5
7 files changed, 23 insertions, 3 deletions
diff --git a/src/tools/rust-analyzer/crates/parser/src/syntax_kind/generated.rs b/src/tools/rust-analyzer/crates/parser/src/syntax_kind/generated.rs
index ef83420c523..ad3398453be 100644
--- a/src/tools/rust-analyzer/crates/parser/src/syntax_kind/generated.rs
+++ b/src/tools/rust-analyzer/crates/parser/src/syntax_kind/generated.rs
@@ -1,4 +1,4 @@
-//! Generated by `sourcegen_ast`, do not edit by hand.
+//! Generated by `cargo codegen grammar`, do not edit by hand.
 
 #![allow(bad_style, missing_docs, unreachable_pub)]
 #[doc = r" The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT`."]
diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/generated/nodes.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/generated/nodes.rs
index bae529a2c8e..ce189acd68e 100644
--- a/src/tools/rust-analyzer/crates/syntax/src/ast/generated/nodes.rs
+++ b/src/tools/rust-analyzer/crates/syntax/src/ast/generated/nodes.rs
@@ -1,4 +1,4 @@
-//! Generated by `sourcegen_ast`, do not edit by hand.
+//! Generated by `cargo codegen grammar`, do not edit by hand.
 
 #![allow(non_snake_case)]
 use crate::{
diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/generated/tokens.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/generated/tokens.rs
index 651a8ebbf79..85d20c2bd8c 100644
--- a/src/tools/rust-analyzer/crates/syntax/src/ast/generated/tokens.rs
+++ b/src/tools/rust-analyzer/crates/syntax/src/ast/generated/tokens.rs
@@ -1,4 +1,4 @@
-//! Generated by `sourcegen_ast`, do not edit by hand.
+//! Generated by `cargo codegen grammar`, do not edit by hand.
 
 use crate::{
     ast::AstToken,
diff --git a/src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs b/src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs
index 1256232287f..d06c9d65df3 100644
--- a/src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs
+++ b/src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs
@@ -195,3 +195,8 @@ fn reveal_hash_comments(text: &str) -> String {
         })
         .fold(String::new(), |mut acc, it| format_to_acc!(acc, "{it}\n"))
 }
+
+#[test]
+fn test() {
+    generate(true);
+}
diff --git a/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs b/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
index 89db39411b4..2d492f79f17 100644
--- a/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
+++ b/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
@@ -890,3 +890,8 @@ impl AstNodeSrc {
         });
     }
 }
+
+#[test]
+fn test() {
+    generate(true);
+}
diff --git a/src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs b/src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs
index 7ad530ab01b..5983b06e1b9 100644
--- a/src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs
+++ b/src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs
@@ -127,3 +127,8 @@ fn existing_tests(dir: &Path, ok: bool) -> HashMap<String, (PathBuf, Test)> {
     }
     res
 }
+
+#[test]
+fn test() {
+    generate(true);
+}
diff --git a/src/tools/rust-analyzer/xtask/src/tidy.rs b/src/tools/rust-analyzer/xtask/src/tidy.rs
index 98e52e7e970..e85f5182865 100644
--- a/src/tools/rust-analyzer/xtask/src/tidy.rs
+++ b/src/tools/rust-analyzer/xtask/src/tidy.rs
@@ -338,3 +338,8 @@ fn find_marks(set: &mut HashSet<String>, text: &str, mark: &str) {
         }
     }
 }
+
+#[test]
+fn test() {
+    Tidy {}.run(&Shell::new().unwrap()).unwrap();
+}