aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/dev/architecture.md2
-rw-r--r--xtask/src/help.rs1
-rw-r--r--xtask/src/main.rs10
-rw-r--r--xtask/tests/tidy-tests/cli.rs2
4 files changed, 4 insertions, 11 deletions
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md
index 5ec5352e7..6fd396dee 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -78,7 +78,7 @@ Rust syntax tree structure and parser. See
78Tests for ra_syntax are mostly data-driven: `test_data/parser` contains subdirectories with a bunch of `.rs` 78Tests for ra_syntax are mostly data-driven: `test_data/parser` contains subdirectories with a bunch of `.rs`
79(test vectors) and `.txt` files with corresponding syntax trees. During testing, we check 79(test vectors) and `.txt` files with corresponding syntax trees. During testing, we check
80`.rs` against `.txt`. If the `.txt` file is missing, it is created (this is how you update 80`.rs` against `.txt`. If the `.txt` file is missing, it is created (this is how you update
81tests). Additionally, running `cargo gen-tests` will walk the grammar module and collect 81tests). Additionally, running `cargo xtask codegen` will walk the grammar module and collect
82all `// test test_name` comments into files inside `test_data/parser/inline` directory. 82all `// test test_name` comments into files inside `test_data/parser/inline` directory.
83 83
84See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which 84See [#93](https://github.com/rust-analyzer/rust-analyzer/pull/93) for an example PR which
diff --git a/xtask/src/help.rs b/xtask/src/help.rs
index 4c6bf6b53..730eb5c61 100644
--- a/xtask/src/help.rs
+++ b/xtask/src/help.rs
@@ -13,7 +13,6 @@ SUBCOMMANDS:
13 format-hook 13 format-hook
14 fuzz-tests 14 fuzz-tests
15 codegen 15 codegen
16 gen-tests
17 install 16 install
18 lint"; 17 lint";
19 18
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 0b19c34f4..db901ced2 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -57,19 +57,13 @@ fn main() -> Result<()> {
57 }; 57 };
58 install(opts)? 58 install(opts)?
59 } 59 }
60 "gen-tests" => {
61 if matches.contains(["-h", "--help"]) {
62 help::print_no_param_subcommand_help(&subcommand);
63 return Ok(());
64 }
65 codegen::generate_parser_tests(Mode::Overwrite)?
66 }
67 "codegen" => { 60 "codegen" => {
68 if matches.contains(["-h", "--help"]) { 61 if matches.contains(["-h", "--help"]) {
69 help::print_no_param_subcommand_help(&subcommand); 62 help::print_no_param_subcommand_help(&subcommand);
70 return Ok(()); 63 return Ok(());
71 } 64 }
72 codegen::generate_syntax(Mode::Overwrite)? 65 codegen::generate_syntax(Mode::Overwrite)?;
66 codegen::generate_parser_tests(Mode::Overwrite)?;
73 } 67 }
74 "format" => { 68 "format" => {
75 if matches.contains(["-h", "--help"]) { 69 if matches.contains(["-h", "--help"]) {
diff --git a/xtask/tests/tidy-tests/cli.rs b/xtask/tests/tidy-tests/cli.rs
index 304d77d89..543c7d7c4 100644
--- a/xtask/tests/tidy-tests/cli.rs
+++ b/xtask/tests/tidy-tests/cli.rs
@@ -14,7 +14,7 @@ fn generated_grammar_is_fresh() {
14#[test] 14#[test]
15fn generated_tests_are_fresh() { 15fn generated_tests_are_fresh() {
16 if let Err(error) = codegen::generate_parser_tests(Mode::Verify) { 16 if let Err(error) = codegen::generate_parser_tests(Mode::Verify) {
17 panic!("{}. Please update tests by running `cargo xtask gen-tests`", error); 17 panic!("{}. Please update tests by running `cargo xtask codegen`", error);
18 } 18 }
19} 19}
20 20