File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/bootstrap/src/core/config Expand file tree Collapse file tree 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};
44use std:: io:: Write ;
55use std:: path:: Path ;
66
7+ use build_helper:: ci:: CiEnv ;
78use clap:: CommandFactory ;
89use serde:: Deserialize ;
910
@@ -532,3 +533,19 @@ fn test_exclude() {
532533
533534 assert_eq ! ( first_excluded, exclude_path) ;
534535}
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