Skip to content

Commit c4707bb

Browse files
committed
Compile the new tests on all platforms
Since the code under test is currently compiled on all platforms. The current tests' assertions are not guaranteed to hold outside of Windows systems. (It would be unusual to call the functions they are testing outside of Windows. They are mainly not `cfg(windows)` to allow non-conditional compilation e.g. `if cfg!(windows)`, which is still usually fast since "runtime" conditions that are `false` constants facilitate removal of deda code.) So they are marked ignored, even though they are built.
1 parent 38704ba commit c4707bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gix-path/src/env/auxiliary.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub(super) fn find_git_associated_windows_executable_with_fallback(stem: &str) -
114114
})
115115
}
116116

117-
#[cfg(all(windows, test))]
117+
#[cfg(test)]
118118
mod tests {
119119
use std::path::Path;
120120

@@ -139,6 +139,7 @@ mod tests {
139139
];
140140

141141
#[test]
142+
#[cfg_attr(not(windows), ignore)]
142143
fn find_git_associated_windows_executable() {
143144
for stem in SHOULD_FIND {
144145
let path = super::find_git_associated_windows_executable(stem);
@@ -147,6 +148,7 @@ mod tests {
147148
}
148149

149150
#[test]
151+
#[cfg_attr(not(windows), ignore)]
150152
fn find_git_associated_windows_executable_no_extra() {
151153
for stem in SHOULD_NOT_FIND {
152154
let path = super::find_git_associated_windows_executable(stem);
@@ -155,6 +157,7 @@ mod tests {
155157
}
156158

157159
#[test]
160+
#[cfg_attr(not(windows), ignore)]
158161
fn find_git_associated_windows_executable_with_fallback() {
159162
for stem in SHOULD_FIND {
160163
let path = super::find_git_associated_windows_executable_with_fallback(stem);
@@ -163,6 +166,7 @@ mod tests {
163166
}
164167

165168
#[test]
169+
#[cfg_attr(not(windows), ignore)]
166170
fn find_git_associated_windows_executable_with_fallback_falls_back() {
167171
for stem in SHOULD_NOT_FIND {
168172
let path = super::find_git_associated_windows_executable_with_fallback(stem)

0 commit comments

Comments
 (0)