@@ -9,7 +9,7 @@ use std::path::{Path, PathBuf};
99
1010// FIXME: The following limits should be reduced eventually.
1111const ENTRY_LIMIT : usize = 885 ;
12- const ROOT_ENTRY_LIMIT : usize = 881 ;
12+ const ROOT_ENTRY_LIMIT : usize = 880 ;
1313const ISSUES_ENTRY_LIMIT : usize = 1978 ;
1414
1515fn check_entries ( tests_path : & Path , bad : & mut bool ) {
@@ -22,18 +22,19 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
2222 }
2323 }
2424
25+ let ( mut max, mut max_root, mut max_issues) = ( 0usize , 0usize , 0usize ) ;
2526 for ( dir_path, count) in directories {
2627 // Use special values for these dirs.
2728 let is_root = tests_path. join ( "ui" ) == dir_path;
2829 let is_issues_dir = tests_path. join ( "ui/issues" ) == dir_path;
29- let limit = if is_root {
30- ROOT_ENTRY_LIMIT
30+ let ( limit, maxcnt ) = if is_root {
31+ ( ROOT_ENTRY_LIMIT , & mut max_root )
3132 } else if is_issues_dir {
32- ISSUES_ENTRY_LIMIT
33+ ( ISSUES_ENTRY_LIMIT , & mut max_issues )
3334 } else {
34- ENTRY_LIMIT
35+ ( ENTRY_LIMIT , & mut max )
3536 } ;
36-
37+ * maxcnt = ( * maxcnt ) . max ( count ) ;
3738 if count > limit {
3839 tidy_error ! (
3940 bad,
@@ -45,6 +46,21 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
4546 ) ;
4647 }
4748 }
49+ if ENTRY_LIMIT > max {
50+ tidy_error ! ( bad, "`ENTRY_LIMIT` is too high (is {ENTRY_LIMIT}, should be {max})" ) ;
51+ }
52+ if ROOT_ENTRY_LIMIT > max_root {
53+ tidy_error ! (
54+ bad,
55+ "`ROOT_ENTRY_LIMIT` is too high (is {ROOT_ENTRY_LIMIT}, should be {max_root})"
56+ ) ;
57+ }
58+ if ISSUES_ENTRY_LIMIT > max_issues {
59+ tidy_error ! (
60+ bad,
61+ "`ISSUES_ENTRY_LIMIT` is too high (is {ISSUES_ENTRY_LIMIT}, should be {max_issues})"
62+ ) ;
63+ }
4864}
4965
5066pub fn check ( path : & Path , bad : & mut bool ) {
0 commit comments