Skip to content

Commit 2f4068d

Browse files
authored
Merge pull request #431 from TypedDevs/codex/improve-runner-performance-on-windows
Improve Windows detection for parallel tests
2 parents 3f1fa02 + cc6392c commit 2f4068d

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Add project overview docs
1212
- Improve clock performance
1313
- Make install.sh args more flexible
14+
- Improve Windows detection allowing parallel tests on Git Bash, MSYS and Cygwin
1415

1516
## [0.20.0](https://github.com/TypedDevs/bashunit/compare/0.19.1...0.20.0) - 2025-06-01
1617

src/check_os.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ function check_os::is_macos() {
4141
}
4242

4343
function check_os::is_windows() {
44-
[[ "$(uname)" == *"MINGW"* ]]
44+
case "$(uname)" in
45+
*MINGW*|*MSYS*|*CYGWIN*)
46+
return 0
47+
;;
48+
*)
49+
return 1
50+
;;
51+
esac
4552
}
4653

4754
function check_os::is_busybox() {

tests/unit/check_os_test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ function test_detect_windows_os() {
5252
function window_linux_variations() {
5353
echo "MINGW"
5454
echo "junkMINGWjunk"
55+
echo "MSYS_NT-10.0"
56+
echo "junkMSYSjunk"
57+
echo "CYGWIN_NT-10.0"
58+
echo "junkCYGWINjunk"
5559
}
5660

5761
function test_alpine_is_busybox() {

0 commit comments

Comments
 (0)