@@ -9,9 +9,11 @@ use std::num::NonZeroUsize;
99use std:: path:: PathBuf ;
1010use std:: str:: FromStr ;
1111use std:: sync:: atomic:: { AtomicBool , Ordering } ;
12+ use std:: sync:: { Arc , Mutex } ;
1213use std:: thread:: { self , ScopedJoinHandle , scope} ;
1314use std:: { env, process} ;
1415
16+ use tidy:: diagnostics:: DiagCtx ;
1517use tidy:: * ;
1618
1719fn main ( ) {
@@ -54,6 +56,8 @@ fn main() {
5456 let ci_info = CiInfo :: new ( & mut bad) ;
5557 let bad = std:: sync:: Arc :: new ( AtomicBool :: new ( bad) ) ;
5658
59+ let mut diag_ctx = DiagCtx :: new ( verbose) ;
60+
5761 let drain_handles = |handles : & mut VecDeque < ScopedJoinHandle < ' _ , ( ) > > | {
5862 // poll all threads for completion before awaiting the oldest one
5963 for i in ( 0 ..handles. len ( ) ) . rev ( ) {
@@ -87,76 +91,73 @@ fn main() {
8791 ( @ $p: ident, name=$name: expr $( , $args: expr) * ) => {
8892 drain_handles( & mut handles) ;
8993
94+ let diag_ctx = diag_ctx. clone( ) ;
9095 let handle = thread:: Builder :: new( ) . name( $name) . spawn_scoped( s, || {
91- let mut flag = false ;
92- $p:: check( $( $args, ) * & mut flag) ;
93- if ( flag) {
94- bad. store( true , Ordering :: Relaxed ) ;
95- }
96+ $p:: check( $( $args, ) * diag_ctx) ;
9697 } ) . unwrap( ) ;
9798 handles. push_back( handle) ;
9899 }
99100 }
100101
101- check ! ( target_specific_tests, & tests_path) ;
102+ // check!(target_specific_tests, &tests_path);
102103
103104 // Checks that are done on the cargo workspace.
104- check ! ( deps, & root_path, & cargo, bless) ;
105- check ! ( extdeps, & root_path) ;
105+ // check!(deps, &root_path, &cargo, bless);
106+ // check!(extdeps, &root_path);
106107
107108 // Checks over tests.
108- check ! ( tests_placement, & root_path) ;
109- check ! ( tests_revision_unpaired_stdout_stderr, & tests_path) ;
110- check ! ( debug_artifacts, & tests_path) ;
111- check ! ( ui_tests, & root_path, bless) ;
112- check ! ( mir_opt_tests, & tests_path, bless) ;
113- check ! ( rustdoc_gui_tests, & tests_path) ;
114- check ! ( rustdoc_css_themes, & librustdoc_path) ;
115- check ! ( rustdoc_templates, & librustdoc_path) ;
116- check ! ( rustdoc_json, & src_path, & ci_info) ;
117- check ! ( known_bug, & crashes_path) ;
118- check ! ( unknown_revision, & tests_path) ;
109+ // check!(tests_placement, &root_path);
110+ // check!(tests_revision_unpaired_stdout_stderr, &tests_path);
111+ // check!(debug_artifacts, &tests_path);
112+ // check!(ui_tests, &root_path, bless);
113+ // check!(mir_opt_tests, &tests_path, bless);
114+ // check!(rustdoc_gui_tests, &tests_path);
115+ // check!(rustdoc_css_themes, &librustdoc_path);
116+ // check!(rustdoc_templates, &librustdoc_path);
117+ // check!(rustdoc_json, &src_path, &ci_info);
118+ // check!(known_bug, &crashes_path);
119+ // check!(unknown_revision, &tests_path);
119120
120121 // Checks that only make sense for the compiler.
121- check ! ( error_codes, & root_path, & [ & compiler_path, & librustdoc_path] , verbose, & ci_info) ;
122- check ! ( fluent_alphabetical, & compiler_path, bless) ;
123- check ! ( fluent_period, & compiler_path) ;
124- check ! ( fluent_lowercase, & compiler_path) ;
125- check ! ( target_policy, & root_path) ;
126- check ! ( gcc_submodule, & root_path, & compiler_path) ;
122+ // check!(error_codes, &root_path, &[&compiler_path, &librustdoc_path], verbose, &ci_info);
123+ // check!(fluent_alphabetical, &compiler_path, bless);
124+ // check!(fluent_period, &compiler_path);
125+ // check!(fluent_lowercase, &compiler_path);
126+ // check!(target_policy, &root_path);
127+ // check!(gcc_submodule, &root_path, &compiler_path);
127128
128129 // Checks that only make sense for the std libs.
129- check ! ( pal, & library_path) ;
130+ // check!(pal, &library_path);
130131
131132 // Checks that need to be done for both the compiler and std libraries.
132- check ! ( unit_tests, & src_path, false ) ;
133- check ! ( unit_tests, & compiler_path, false ) ;
134- check ! ( unit_tests, & library_path, true ) ;
135-
136- if bins:: check_filesystem_support ( & [ & root_path] , & output_directory) {
137- check ! ( bins, & root_path) ;
138- }
133+ // check!(unit_tests, &src_path, false);
134+ // check!(unit_tests, &compiler_path, false);
135+ // check!(unit_tests, &library_path, true);
136+ //
137+ // if bins::check_filesystem_support(&[&root_path], &output_directory) {
138+ // check!(bins, &root_path);
139+ // }
139140
140141 check ! ( style, & src_path) ;
141142 check ! ( style, & tests_path) ;
142143 check ! ( style, & compiler_path) ;
143144 check ! ( style, & library_path) ;
144145
145- check ! ( edition, & src_path) ;
146- check ! ( edition, & compiler_path) ;
147- check ! ( edition, & library_path) ;
148-
149- check ! ( alphabetical, & root_manifest) ;
150- check ! ( alphabetical, & src_path) ;
151- check ! ( alphabetical, & tests_path) ;
152- check ! ( alphabetical, & compiler_path) ;
153- check ! ( alphabetical, & library_path) ;
154-
155- check ! ( x_version, & root_path, & cargo) ;
156-
157- check ! ( triagebot, & root_path) ;
158-
159- check ! ( filenames, & root_path) ;
146+ // check!(edition, &src_path);
147+ // check!(edition, &compiler_path);
148+ // check!(edition, &library_path);
149+ //
150+ // check!(alphabetical, &root_manifest);
151+ // check!(alphabetical, &src_path);
152+ // check!(alphabetical, &tests_path);
153+ // check!(alphabetical, &compiler_path);
154+ // check!(alphabetical, &library_path);
155+ //
156+ // check!(x_version, &root_path, &cargo);
157+ //
158+ // check!(triagebot, &root_path);
159+ //
160+ // check!(filenames, &root_path);
160161
161162 let collected = {
162163 drain_handles ( & mut handles) ;
@@ -175,24 +176,24 @@ fn main() {
175176 }
176177 r
177178 } ;
178- check ! ( unstable_book, & src_path, collected) ;
179-
180- check ! (
181- extra_checks,
182- & root_path,
183- & output_directory,
184- & ci_info,
185- & librustdoc_path,
186- & tools_path,
187- & npm,
188- & cargo,
189- bless,
190- extra_checks,
191- pos_args
192- ) ;
179+ // check!(unstable_book, &src_path, collected);
180+ //
181+ // check!(
182+ // extra_checks,
183+ // &root_path,
184+ // &output_directory,
185+ // &ci_info,
186+ // &librustdoc_path,
187+ // &tools_path,
188+ // &npm,
189+ // &cargo,
190+ // bless,
191+ // extra_checks,
192+ // pos_args
193+ // );
193194 } ) ;
194195
195- if bad . load ( Ordering :: Relaxed ) {
196+ if diag_ctx . into_conclusion ( ) {
196197 eprintln ! ( "some tidy checks failed" ) ;
197198 process:: exit ( 1 ) ;
198199 }
0 commit comments