diff options
author | Aleksey Kladov <[email protected]> | 2019-10-17 17:36:55 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-17 20:54:38 +0100 |
commit | 7b15c4f7ae95e2e855cb783871906fa7bf364c4c (patch) | |
tree | 20a69aaf3ad803a4ca689ec143e9cc0a5049d5ca /crates/ra_tools/tests/cli.rs | |
parent | 65ab81e35868c09ac9c93cf1d53a607f5caede53 (diff) |
WIP: move to xtasks
Diffstat (limited to 'crates/ra_tools/tests/cli.rs')
-rw-r--r-- | crates/ra_tools/tests/cli.rs | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/crates/ra_tools/tests/cli.rs b/crates/ra_tools/tests/cli.rs deleted file mode 100644 index 609fd4d8b..000000000 --- a/crates/ra_tools/tests/cli.rs +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | use ra_tools::{gen_tests, generate_boilerplate, project_root, run_rustfmt, Verify}; | ||
2 | use walkdir::WalkDir; | ||
3 | |||
4 | #[test] | ||
5 | fn generated_grammar_is_fresh() { | ||
6 | if let Err(error) = generate_boilerplate(Verify) { | ||
7 | panic!("{}. Please update it by running `cargo gen-syntax`", error); | ||
8 | } | ||
9 | } | ||
10 | |||
11 | #[test] | ||
12 | fn generated_tests_are_fresh() { | ||
13 | if let Err(error) = gen_tests(Verify) { | ||
14 | panic!("{}. Please update tests by running `cargo gen-tests`", error); | ||
15 | } | ||
16 | } | ||
17 | |||
18 | #[test] | ||
19 | fn check_code_formatting() { | ||
20 | if let Err(error) = run_rustfmt(Verify) { | ||
21 | panic!("{}. Please format the code by running `cargo format`", error); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | #[test] | ||
26 | fn no_todo() { | ||
27 | WalkDir::new(project_root().join("crates")).into_iter().for_each(|e| { | ||
28 | let e = e.unwrap(); | ||
29 | if e.path().extension().map(|it| it != "rs").unwrap_or(true) { | ||
30 | return; | ||
31 | } | ||
32 | if e.path().ends_with("tests/cli.rs") { | ||
33 | return; | ||
34 | } | ||
35 | let text = std::fs::read_to_string(e.path()).unwrap(); | ||
36 | if text.contains("TODO") || text.contains("TOOD") { | ||
37 | panic!( | ||
38 | "\nTODO markers should not be committed to the master branch,\n\ | ||
39 | use FIXME instead\n\ | ||
40 | {}\n", | ||
41 | e.path().display(), | ||
42 | ) | ||
43 | } | ||
44 | }) | ||
45 | } | ||