File tree Expand file tree Collapse file tree 3 files changed +28
-21
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 3 files changed +28
-21
lines changed Original file line number Diff line number Diff line change 1
- use std:: env;
2
- use std:: io:: IsTerminal ;
3
- use std:: sync:: Arc ;
4
-
5
- use compiletest:: { early_config_check, parse_config, run_tests} ;
6
-
7
1
fn main ( ) {
8
- tracing_subscriber:: fmt:: init ( ) ;
9
-
10
- // colored checks stdout by default, but for some reason only stderr is a terminal.
11
- // compiletest *does* print many things to stdout, but it doesn't really matter.
12
- if std:: io:: stderr ( ) . is_terminal ( )
13
- && matches ! ( std:: env:: var( "NO_COLOR" ) . as_deref( ) , Err ( _) | Ok ( "0" ) )
14
- {
15
- colored:: control:: set_override ( true ) ;
16
- }
17
-
18
- let config = Arc :: new ( parse_config ( env:: args ( ) . collect ( ) ) ) ;
19
-
20
- early_config_check ( & config) ;
21
-
22
- run_tests ( config) ;
2
+ compiletest:: cli:: main ( ) ;
23
3
}
Original file line number Diff line number Diff line change
1
+ //! Isolates the APIs used by `bin/main.rs`, to help minimize the surface area
2
+ //! of public exports from the compiletest library crate.
3
+
4
+ use std:: env;
5
+ use std:: io:: IsTerminal ;
6
+ use std:: sync:: Arc ;
7
+
8
+ use crate :: { early_config_check, parse_config, run_tests} ;
9
+
10
+ pub fn main ( ) {
11
+ tracing_subscriber:: fmt:: init ( ) ;
12
+
13
+ // colored checks stdout by default, but for some reason only stderr is a terminal.
14
+ // compiletest *does* print many things to stdout, but it doesn't really matter.
15
+ if std:: io:: stderr ( ) . is_terminal ( )
16
+ && matches ! ( std:: env:: var( "NO_COLOR" ) . as_deref( ) , Err ( _) | Ok ( "0" ) )
17
+ {
18
+ colored:: control:: set_override ( true ) ;
19
+ }
20
+
21
+ let config = Arc :: new ( parse_config ( env:: args ( ) . collect ( ) ) ) ;
22
+
23
+ early_config_check ( & config) ;
24
+
25
+ run_tests ( config) ;
26
+ }
Original file line number Diff line number Diff line change 3
3
#[ cfg( test) ]
4
4
mod tests;
5
5
6
+ pub mod cli;
6
7
pub mod common;
7
8
mod debuggers;
8
9
pub mod diagnostics;
You can’t perform that action at this time.
0 commit comments