@@ -398,7 +398,7 @@ pub type OptRes = Result<TestOpts, String>;
398
398
399
399
fn optgroups ( ) -> getopts:: Options {
400
400
let mut opts = getopts:: Options :: new ( ) ;
401
- opts. optflag ( "" , "all " , "Run ignored and not ignored tests" )
401
+ opts. optflag ( "" , "include-ignored " , "Run ignored and not ignored tests" )
402
402
. optflag ( "" , "ignored" , "Run only ignored tests" )
403
403
. optflag ( "" , "test" , "Run tests and not benchmarks" )
404
404
. optflag ( "" , "bench" , "Run benchmarks instead of tests" )
@@ -498,7 +498,7 @@ Test Attributes:
498
498
contain: #[should_panic(expected = "foo")].
499
499
#[ignore] - When applied to a function which is already attributed as a
500
500
test, then the test runner will ignore these tests during
501
- normal test runs. Running with --ignored or --all will run
501
+ normal test runs. Running with --ignored or --include-ignored will run
502
502
these tests."# ,
503
503
usage = options. usage( & message)
504
504
) ;
@@ -552,9 +552,16 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
552
552
None
553
553
} ;
554
554
555
- let run_ignored = match ( matches. opt_present ( "all" ) , matches. opt_present ( "ignored" ) ) {
555
+ let include_ignored = matches. opt_present ( "include-ignored" ) ;
556
+ if !allow_unstable && include_ignored {
557
+ return Some ( Err (
558
+ "The \" include-ignored\" flag is only accepted on the nightly compiler" . into ( )
559
+ ) ) ;
560
+ }
561
+
562
+ let run_ignored = match ( include_ignored, matches. opt_present ( "ignored" ) ) {
556
563
( true , true ) => return Some ( Err (
557
- "the options --all and --ignored are mutually exclusive" . into ( )
564
+ "the options --include-ignored and --ignored are mutually exclusive" . into ( )
558
565
) ) ,
559
566
( true , false ) => RunIgnored :: Yes ,
560
567
( false , true ) => RunIgnored :: Only ,
@@ -1890,11 +1897,12 @@ mod tests {
1890
1897
}
1891
1898
1892
1899
#[ test]
1893
- fn parse_all_flag ( ) {
1900
+ fn parse_include_ignored_flag ( ) {
1894
1901
let args = vec ! [
1895
1902
"progname" . to_string( ) ,
1896
1903
"filter" . to_string( ) ,
1897
- "--all" . to_string( ) ,
1904
+ "-Zunstable-options" . to_string( ) ,
1905
+ "--include-ignored" . to_string( ) ,
1898
1906
] ;
1899
1907
let opts = parse_opts ( & args) . unwrap ( ) . unwrap ( ) ;
1900
1908
assert_eq ! ( opts. run_ignored, RunIgnored :: Yes ) ;
@@ -1918,8 +1926,8 @@ mod tests {
1918
1926
}
1919
1927
1920
1928
#[ test]
1921
- pub fn run_all_option ( ) {
1922
- // When we run "--all " tests, the ignore flag should be set to false on
1929
+ pub fn run_include_ignored_option ( ) {
1930
+ // When we "--include-ignored " tests, the ignore flag should be set to false on
1923
1931
// all tests and no test filtered out
1924
1932
1925
1933
let mut opts = TestOpts :: new ( ) ;
@@ -2041,9 +2049,9 @@ mod tests {
2041
2049
"test::ignored_tests_result_in_ignored" . to_string( ) ,
2042
2050
"test::first_free_arg_should_be_a_filter" . to_string( ) ,
2043
2051
"test::parse_ignored_flag" . to_string( ) ,
2044
- "test::parse_all_flag " . to_string( ) ,
2052
+ "test::parse_include_ignored_flag " . to_string( ) ,
2045
2053
"test::filter_for_ignored_option" . to_string( ) ,
2046
- "test::run_all_option " . to_string( ) ,
2054
+ "test::run_include_ignored_option " . to_string( ) ,
2047
2055
"test::sort_tests" . to_string( ) ,
2048
2056
] ;
2049
2057
let tests = {
@@ -2073,9 +2081,9 @@ mod tests {
2073
2081
"test::filter_for_ignored_option" . to_string( ) ,
2074
2082
"test::first_free_arg_should_be_a_filter" . to_string( ) ,
2075
2083
"test::ignored_tests_result_in_ignored" . to_string( ) ,
2076
- "test::parse_all_flag" . to_string( ) ,
2077
2084
"test::parse_ignored_flag" . to_string( ) ,
2078
- "test::run_all_option" . to_string( ) ,
2085
+ "test::parse_include_ignored_flag" . to_string( ) ,
2086
+ "test::run_include_ignored_option" . to_string( ) ,
2079
2087
"test::sort_tests" . to_string( ) ,
2080
2088
] ;
2081
2089
0 commit comments