Skip to content

Commit dea0afb

Browse files
authored
Merge pull request #6896 from cakebaker/env_add_cfg_attributes_to_tests
env: add missing `cfg` attributes to tests
2 parents 1a0bd63 + ab9e5cb commit dea0afb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/by-util/test_env.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::common::util::TestScenario;
1010
use crate::common::util::UChild;
1111
#[cfg(unix)]
1212
use nix::sys::signal::Signal;
13+
#[cfg(feature = "echo")]
1314
use regex::Regex;
1415
use std::env;
1516
use std::path::Path;
@@ -98,6 +99,7 @@ fn test_if_windows_batch_files_can_be_executed() {
9899
assert!(result.stdout_str().contains("Hello Windows World!"));
99100
}
100101

102+
#[cfg(feature = "echo")]
101103
#[test]
102104
fn test_debug_1() {
103105
let ts = TestScenario::new(util_name!());
@@ -118,6 +120,7 @@ fn test_debug_1() {
118120
);
119121
}
120122

123+
#[cfg(feature = "echo")]
121124
#[test]
122125
fn test_debug_2() {
123126
let ts = TestScenario::new(util_name!());
@@ -144,6 +147,7 @@ fn test_debug_2() {
144147
);
145148
}
146149

150+
#[cfg(feature = "echo")]
147151
#[test]
148152
fn test_debug1_part_of_string_arg() {
149153
let ts = TestScenario::new(util_name!());
@@ -165,6 +169,7 @@ fn test_debug1_part_of_string_arg() {
165169
);
166170
}
167171

172+
#[cfg(feature = "echo")]
168173
#[test]
169174
fn test_debug2_part_of_string_arg() {
170175
let ts = TestScenario::new(util_name!());
@@ -651,7 +656,7 @@ fn test_env_with_empty_executable_double_quotes() {
651656
}
652657

653658
#[test]
654-
#[cfg(unix)]
659+
#[cfg(all(unix, feature = "dirname", feature = "echo"))]
655660
fn test_env_overwrite_arg0() {
656661
let ts = TestScenario::new(util_name!());
657662

@@ -675,7 +680,7 @@ fn test_env_overwrite_arg0() {
675680
}
676681

677682
#[test]
678-
#[cfg(unix)]
683+
#[cfg(all(unix, feature = "echo"))]
679684
fn test_env_arg_argv0_overwrite() {
680685
let ts = TestScenario::new(util_name!());
681686

@@ -723,7 +728,7 @@ fn test_env_arg_argv0_overwrite() {
723728
}
724729

725730
#[test]
726-
#[cfg(unix)]
731+
#[cfg(all(unix, feature = "echo"))]
727732
fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
728733
let ts = TestScenario::new(util_name!());
729734

0 commit comments

Comments
 (0)