File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ fn main() {
25
25
. subcommand (
26
26
SubCommand :: with_name ( "run" )
27
27
. alias ( "r" )
28
- . arg ( Arg :: with_name ( "file" ) . required ( true ) . index ( 1 ) ) ,
28
+ . arg ( Arg :: with_name ( "file" ) . required ( true ) . index ( 1 ) )
29
+ . arg ( Arg :: with_name ( "test" ) . short ( "t" ) . long ( "test" ) ) ,
29
30
)
30
31
. get_matches ( ) ;
31
32
Original file line number Diff line number Diff line change 1
1
use crate :: util:: clean;
2
+ use crate :: verify:: test;
2
3
use console:: { style, Emoji } ;
3
4
use indicatif:: ProgressBar ;
4
5
use std:: process:: Command ;
5
6
6
7
pub fn run ( matches : clap:: ArgMatches ) {
7
8
if let Some ( filename) = matches. value_of ( "file" ) {
9
+ if matches. is_present ( "test" ) {
10
+ match test ( filename) {
11
+ Ok ( _) => ( ) ,
12
+ Err ( _) => ( ) ,
13
+ }
14
+ std:: process:: exit ( 0 ) ;
15
+ }
8
16
let bar = ProgressBar :: new_spinner ( ) ;
9
17
bar. set_message ( format ! ( "Compiling {}..." , filename) . as_str ( ) ) ;
10
18
bar. enable_steady_tick ( 100 ) ;
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ fn compile_only(filename: &str) -> Result<(), ()> {
78
78
}
79
79
}
80
80
81
- fn test ( filename : & str ) -> Result < ( ) , ( ) > {
81
+ pub fn test ( filename : & str ) -> Result < ( ) , ( ) > {
82
82
let bar = ProgressBar :: new_spinner ( ) ;
83
83
bar. set_message ( format ! ( "Testing {}..." , filename) . as_str ( ) ) ;
84
84
bar. enable_steady_tick ( 100 ) ;
You can’t perform that action at this time.
0 commit comments