File tree 1 file changed +17
-0
lines changed
src/bootstrap/src/core/config
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use std::fs::{File, remove_file};
4
4
use std:: io:: Write ;
5
5
use std:: path:: Path ;
6
6
7
+ use build_helper:: ci:: CiEnv ;
7
8
use clap:: CommandFactory ;
8
9
use serde:: Deserialize ;
9
10
@@ -532,3 +533,19 @@ fn test_exclude() {
532
533
533
534
assert_eq ! ( first_excluded, exclude_path) ;
534
535
}
536
+
537
+ #[ test]
538
+ fn test_ci_flag ( ) {
539
+ let config = Config :: parse_inner ( Flags :: parse ( & [ "check" . into ( ) , "--ci=false" . into ( ) ] ) , |& _| {
540
+ toml:: from_str ( "" )
541
+ } ) ;
542
+ assert ! ( !config. is_running_on_ci) ;
543
+
544
+ let config = Config :: parse_inner ( Flags :: parse ( & [ "check" . into ( ) , "--ci=true" . into ( ) ] ) , |& _| {
545
+ toml:: from_str ( "" )
546
+ } ) ;
547
+ assert ! ( config. is_running_on_ci) ;
548
+
549
+ let config = Config :: parse_inner ( Flags :: parse ( & [ "check" . into ( ) ] ) , |& _| toml:: from_str ( "" ) ) ;
550
+ assert_eq ! ( config. is_running_on_ci, CiEnv :: is_ci( ) ) ;
551
+ }
You can’t perform that action at this time.
0 commit comments