@@ -16,53 +16,44 @@ class PlatformHelperTest extends Specification {
1616 platform. windows == isWindows
1717
1818 where :
19- osProp | archProp | osName | osArch | isWindows
20- ' Windows 8' | ' x86' | ' win' | ' x86' | true
21- ' Windows 8' | ' x86_64' | ' win' | ' x64' | true
22- ' Mac OS X' | ' x86' | ' darwin' | ' x86' | false
23- ' Mac OS X' | ' x86_64' | ' darwin' | ' x64' | false
24- ' Linux' | ' x86' | ' linux' | ' x86' | false
25- ' Linux' | ' x86_64' | ' linux' | ' x64' | false
26- ' Linux' | ' ppc64le' | ' linux' | ' ppc64le' | false
27- ' Linux' | ' s390x' | ' linux' | ' s390x' | false
28- ' SunOS' | ' x86' | ' sunos' | ' x86' | false
29- ' SunOS' | ' x86_64' | ' sunos' | ' x64' | false
19+ osProp | archProp || osName | osArch | isWindows
20+ ' Windows 8' | ' x86' || ' win' | ' x86' | true
21+ ' Windows 8' | ' x86_64' || ' win' | ' x64' | true
22+ ' Windows 10' | ' x86_64' || ' win' | ' x64' | true
23+ ' Mac OS X' | ' x86' || ' darwin' | ' x86' | false
24+ ' Mac OS X' | ' x86_64' || ' darwin' | ' x64' | false
25+ ' Linux' | ' x86' || ' linux' | ' x86' | false
26+ ' Linux' | ' x86_64' || ' linux' | ' x64' | false
27+ ' Linux' | ' ppc64le' || ' linux' | ' ppc64le' | false
28+ ' Linux' | ' s390x' || ' linux' | ' s390x' | false
29+ ' SunOS' | ' x86' || ' sunos' | ' x86' | false
30+ ' SunOS' | ' x86_64' || ' sunos' | ' x64' | false
3031 }
3132
3233 @Unroll
33- def " verify ARM handling #archProp (#unameProp)" () {
34+ def " verify #osProp ARM handling #archProp (#unameProp)" () {
3435 given :
35- def platform = PlatformHelperKt . parsePlatform(" Linux" , archProp, { unameProp })
36+ def osType = PlatformHelperKt . parseOsType(osProp)
37+ def platform = PlatformHelperKt . parsePlatform(osType, archProp, { unameProp })
3638
3739 expect :
38- platform. name == " linux"
39- platform. arch == osArch
40-
41- where :
42- archProp | unameProp | osArch
43- ' arm' | ' armv7l' | ' armv7l' // Raspberry Pi 3
44- ' arm' | ' armv8l' | ' arm64'
45- ' aarch32' | ' arm' | ' arm'
46- ' aarch64' | ' arm64' | ' arm64'
47- ' aarch64' | ' aarch64' | ' arm64'
48- ' ppc64le' | ' ppc64le' | ' ppc64le'
49- }
50-
51- @Unroll
52- def " verify ARM handling Mac OS #archProp (#unameProp)" () {
53- given :
54- def platform = PlatformHelperKt . parsePlatform(" Mac OS X" , archProp, { unameProp })
55-
56- expect :
57- platform. name == " darwin"
40+ platform. name == osName
5841 platform. arch == osArch
5942
6043 where :
61- archProp | unameProp | osArch
62- ' aarch32' | ' arm' | ' arm'
63- ' aarch64' | ' arm64' | ' arm64'
64- ' aarch64' | ' aarch64' | ' arm64'
65- ' aarch64' | ' x86_64' | ' x64' // This shouldn't really happen but according to PR #204 it does
44+ osProp | archProp || osName | unameProp | osArch
45+ ' Linux' | ' arm' || ' linux' | ' armv7l' | ' armv7l' // Raspberry Pi 3
46+ ' Linux' | ' arm' || ' linux' | ' armv8l' | ' arm64'
47+ ' Linux' | ' aarch32' || ' linux' | ' arm' | ' arm'
48+ ' Linux' | ' aarch64' || ' linux' | ' arm64' | ' arm64'
49+ ' Linux' | ' aarch64' || ' linux' | ' aarch64' | ' arm64'
50+ ' Linux' | ' ppc64le' || ' linux' | ' ppc64le' | ' ppc64le'
51+ ' Mac OS X' | ' aarch32' || ' darwin' | ' arm' | ' arm'
52+ ' Mac OS X' | ' aarch64' || ' darwin' | ' arm64' | ' arm64'
53+ ' Mac OS X' | ' aarch64' || ' darwin' | ' aarch64' | ' arm64'
54+ ' Mac OS X' | ' aarch64' || ' darwin' | ' x86_64' | ' x64' // This unfortunately happens see PR #204
55+ ' Windows 10' | ' aarch64' || ' win' | ' 12' | ' arm64'
56+ ' Windows 11' | ' aarch64' || ' win' | ' 9' | ' x64' // Not sure if this can actually happen
6657 }
6758
6859 def " throw exception if unsupported os" () {
0 commit comments