Skip to content

Commit 7a2c8c2

Browse files
committed
Run codegen commands as tests if their results are commited
1 parent 6f346c9 commit 7a2c8c2

File tree

7 files changed

+23
-3
lines changed

7 files changed

+23
-3
lines changed

src/tools/rust-analyzer/crates/parser/src/syntax_kind/generated.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Generated by `sourcegen_ast`, do not edit by hand.
1+
//! Generated by `cargo codegen grammar`, do not edit by hand.
22
33
#![allow(bad_style, missing_docs, unreachable_pub)]
44
#[doc = r" The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT`."]

src/tools/rust-analyzer/crates/syntax/src/ast/generated/nodes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Generated by `sourcegen_ast`, do not edit by hand.
1+
//! Generated by `cargo codegen grammar`, do not edit by hand.
22
33
#![allow(non_snake_case)]
44
use crate::{

src/tools/rust-analyzer/crates/syntax/src/ast/generated/tokens.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Generated by `sourcegen_ast`, do not edit by hand.
1+
//! Generated by `cargo codegen grammar`, do not edit by hand.
22
33
use crate::{
44
ast::AstToken,

src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs

+5
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,8 @@ fn reveal_hash_comments(text: &str) -> String {
195195
})
196196
.fold(String::new(), |mut acc, it| format_to_acc!(acc, "{it}\n"))
197197
}
198+
199+
#[test]
200+
fn test() {
201+
generate(true);
202+
}

src/tools/rust-analyzer/xtask/src/codegen/grammar.rs

+5
Original file line numberDiff line numberDiff line change
@@ -890,3 +890,8 @@ impl AstNodeSrc {
890890
});
891891
}
892892
}
893+
894+
#[test]
895+
fn test() {
896+
generate(true);
897+
}

src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs

+5
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,8 @@ fn existing_tests(dir: &Path, ok: bool) -> HashMap<String, (PathBuf, Test)> {
127127
}
128128
res
129129
}
130+
131+
#[test]
132+
fn test() {
133+
generate(true);
134+
}

src/tools/rust-analyzer/xtask/src/tidy.rs

+5
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,8 @@ fn find_marks(set: &mut HashSet<String>, text: &str, mark: &str) {
338338
}
339339
}
340340
}
341+
342+
#[test]
343+
fn test() {
344+
Tidy {}.run(&Shell::new().unwrap()).unwrap();
345+
}

0 commit comments

Comments
 (0)