File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,16 +480,22 @@ fn test_split_string_into_args_debug_output_whitespace_handling() {
480480fn test_gnu_e20 ( ) {
481481 let env_bin = String :: from ( crate :: common:: util:: TESTS_BINARY ) + " " + util_name ! ( ) ;
482482
483- let ( input, output) = (
484- [
485- String :: from ( "-i" ) ,
486- String :: from ( r#"-SA="B\_C=D" "# ) + env_bin. escape_default ( ) . to_string ( ) . as_str ( ) + "" ,
487- ] ,
488- "A=B C=D\n " ,
489- ) ;
483+ let input = [
484+ String :: from ( "-i" ) ,
485+ String :: from ( r#"-SA="B\_C=D" "# ) + env_bin. escape_default ( ) . to_string ( ) . as_str ( ) + "" ,
486+ ] ;
487+
488+ let mut output = "A=B C=D\n " . to_string ( ) ;
489+
490+ // Workaround for the test to pass when coverage is being run.
491+ // If enabled, the binary called by env_bin will most probably be
492+ // instrumented for coverage, and thus will set the
493+ // __LLVM_PROFILE_RT_INIT_ONCE
494+ if env:: var ( "__LLVM_PROFILE_RT_INIT_ONCE" ) . is_ok ( ) {
495+ output. push_str ( "__LLVM_PROFILE_RT_INIT_ONCE=__LLVM_PROFILE_RT_INIT_ONCE\n " ) ;
496+ }
490497
491- let out = new_ucmd ! ( ) . args ( & input) . succeeds ( ) ;
492- assert_eq ! ( out. stdout_str( ) , output) ;
498+ new_ucmd ! ( ) . args ( & input) . succeeds ( ) . stdout_is ( output) ;
493499}
494500
495501#[ test]
You can’t perform that action at this time.
0 commit comments