@@ -9,7 +9,7 @@ use std::path::{Path, PathBuf};
9
9
10
10
// FIXME: The following limits should be reduced eventually.
11
11
const ENTRY_LIMIT : usize = 885 ;
12
- const ROOT_ENTRY_LIMIT : usize = 881 ;
12
+ const ROOT_ENTRY_LIMIT : usize = 880 ;
13
13
const ISSUES_ENTRY_LIMIT : usize = 1978 ;
14
14
15
15
fn check_entries ( tests_path : & Path , bad : & mut bool ) {
@@ -22,18 +22,19 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
22
22
}
23
23
}
24
24
25
+ let ( mut max, mut max_root, mut max_issues) = ( 0usize , 0usize , 0usize ) ;
25
26
for ( dir_path, count) in directories {
26
27
// Use special values for these dirs.
27
28
let is_root = tests_path. join ( "ui" ) == dir_path;
28
29
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 )
31
32
} else if is_issues_dir {
32
- ISSUES_ENTRY_LIMIT
33
+ ( ISSUES_ENTRY_LIMIT , & mut max_issues )
33
34
} else {
34
- ENTRY_LIMIT
35
+ ( ENTRY_LIMIT , & mut max )
35
36
} ;
36
-
37
+ * maxcnt = ( * maxcnt ) . max ( count ) ;
37
38
if count > limit {
38
39
tidy_error ! (
39
40
bad,
@@ -45,6 +46,21 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
45
46
) ;
46
47
}
47
48
}
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
+ }
48
64
}
49
65
50
66
pub fn check ( path : & Path , bad : & mut bool ) {
0 commit comments