Simplify tidy tests

This commit is contained in:
Aleksey Kladov 2020-05-06 10:25:25 +02:00
parent eea431180e
commit 845d47759e
2 changed files with 33 additions and 35 deletions

View file

@ -1,32 +0,0 @@
use xtask::{
codegen::{self, Mode},
run_rustfmt,
};
#[test]
fn generated_grammar_is_fresh() {
if let Err(error) = codegen::generate_syntax(Mode::Verify) {
panic!("{}. Please update it by running `cargo xtask codegen`", error);
}
}
#[test]
fn generated_tests_are_fresh() {
if let Err(error) = codegen::generate_parser_tests(Mode::Verify) {
panic!("{}. Please update tests by running `cargo xtask codegen`", error);
}
}
#[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);
}
}

View file

@ -1,11 +1,41 @@
mod cli;
use std::{ use std::{
collections::HashMap, collections::HashMap,
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };
use xtask::{not_bash::fs2, project_root, rust_files}; use xtask::{
codegen::{self, Mode},
not_bash::fs2,
project_root, run_rustfmt, rust_files,
};
#[test]
fn generated_grammar_is_fresh() {
if let Err(error) = codegen::generate_syntax(Mode::Verify) {
panic!("{}. Please update it by running `cargo xtask codegen`", error);
}
}
#[test]
fn generated_tests_are_fresh() {
if let Err(error) = codegen::generate_parser_tests(Mode::Verify) {
panic!("{}. Please update tests by running `cargo xtask codegen`", error);
}
}
#[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);
}
}
#[test] #[test]
fn rust_files_are_tidy() { fn rust_files_are_tidy() {