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