File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -525,14 +525,20 @@ fn test_gnu_e20() {
525
525
let scene = TestScenario :: new ( util_name ! ( ) ) ;
526
526
527
527
let env_bin = String :: from ( uutests:: util:: get_tests_binary ( ) ) + " " + util_name ! ( ) ;
528
-
529
- let ( input, output) = (
530
- [
531
- String :: from ( "-i" ) ,
532
- String :: from ( r#"-SA="B\_C=D" "# ) + env_bin. escape_default ( ) . to_string ( ) . as_str ( ) + "" ,
533
- ] ,
534
- "A=B C=D\n " ,
535
- ) ;
528
+ let input = [
529
+ String :: from ( "-i" ) ,
530
+ String :: from ( r#"-SA="B\_C=D" "# ) + env_bin. escape_default ( ) . to_string ( ) . as_str ( ) + "" ,
531
+ ] ;
532
+
533
+ let mut output = "A=B C=D\n " . to_string ( ) ;
534
+
535
+ // Workaround for the test to pass when coverage is being run.
536
+ // If enabled, the binary called by env_bin will most probably be
537
+ // instrumented for coverage, and thus will set the
538
+ // __LLVM_PROFILE_RT_INIT_ONCE
539
+ if env:: var ( "__LLVM_PROFILE_RT_INIT_ONCE" ) . is_ok ( ) {
540
+ output. push_str ( "__LLVM_PROFILE_RT_INIT_ONCE=__LLVM_PROFILE_RT_INIT_ONCE\n " ) ;
541
+ }
536
542
537
543
let out = scene. ucmd ( ) . args ( & input) . succeeds ( ) ;
538
544
assert_eq ! ( out. stdout_str( ) , output) ;
You can’t perform that action at this time.
0 commit comments