aboutsummaryrefslogtreecommitdiff
path: root/xtask/tests/tidy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/tests/tidy.rs')
-rw-r--r--xtask/tests/tidy.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs
index 9a6933b09..cb83e07fd 100644
--- a/xtask/tests/tidy.rs
+++ b/xtask/tests/tidy.rs
@@ -5,6 +5,7 @@ use std::{
5 5
6use xshell::{cmd, read_file}; 6use xshell::{cmd, read_file};
7use xtask::{ 7use xtask::{
8 cargo_files,
8 codegen::{self, Mode}, 9 codegen::{self, Mode},
9 project_root, run_rustfmt, rust_files, 10 project_root, run_rustfmt, rust_files,
10}; 11};
@@ -94,6 +95,32 @@ fn rust_files_are_tidy() {
94} 95}
95 96
96#[test] 97#[test]
98fn cargo_files_are_tidy() {
99 for cargo in cargo_files() {
100 let mut section = None;
101 for (line_no, text) in read_file(&cargo).unwrap().lines().enumerate() {
102 let text = text.trim();
103 if text.starts_with("[") {
104 section = Some(text);
105 continue;
106 }
107 if !section.map(|it| it.starts_with("[dependencies")).unwrap_or(false) {
108 continue;
109 }
110 let text: String = text.split_whitespace().collect();
111 if text.contains("path=") && !text.contains("version") {
112 panic!(
113 "\ncargo internal dependencies should have version.\n\
114 {}:{}\n",
115 cargo.display(),
116 line_no + 1
117 )
118 }
119 }
120 }
121}
122
123#[test]
97fn check_merge_commits() { 124fn check_merge_commits() {
98 let stdout = cmd!("git rev-list --merges --invert-grep --author 'bors\\[bot\\]' HEAD~19..") 125 let stdout = cmd!("git rev-list --merges --invert-grep --author 'bors\\[bot\\]' HEAD~19..")
99 .read() 126 .read()