File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change
1
+ extern crate lit;
2
+ extern crate clap;
3
+
4
+ use clap:: { App , Arg } ;
5
+ use std:: env:: consts;
6
+
7
+ fn main ( ) {
8
+ let app = App :: new ( "Example of a testing tool CLI frontend" )
9
+ . version ( env ! ( "CARGO_PKG_VERSION" ) )
10
+ . author ( env ! ( "CARGO_PKG_AUTHORS" ) )
11
+ . about ( env ! ( "CARGO_PKG_DESCRIPTION" ) )
12
+ . arg ( Arg :: with_name ( "v" )
13
+ . short ( "v" )
14
+ . multiple ( true )
15
+ . help ( "Sets the level of verbosity" ) ) ;
16
+
17
+ let app = lit:: config:: clap:: mount_inside_app ( app, true ) ;
18
+
19
+ let matches = app. get_matches ( ) ;
20
+
21
+ println ! ( "Verbose: {}" , matches. is_present( "v" ) ) ;
22
+
23
+ lit:: run:: tests ( lit:: event_handler:: Default :: default ( ) , |config| {
24
+ config. add_search_path ( "integration-tests/" ) ;
25
+ config. add_extension ( "txt" ) ;
26
+
27
+ config. constants . insert ( "arch" . to_owned ( ) , consts:: ARCH . to_owned ( ) ) ;
28
+ config. constants . insert ( "os" . to_owned ( ) , consts:: OS . to_owned ( ) ) ;
29
+
30
+ lit:: config:: clap:: parse_arguments ( & matches, config) ;
31
+ } ) . unwrap ( )
32
+ }
You can’t perform that action at this time.
0 commit comments