@@ -16,54 +16,45 @@ class PlatformHelperTest extends Specification {
16
16
platform. windows == isWindows
17
17
18
18
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
30
- ' AIX' | ' ppc64' | ' aix' | ' ppc64' | 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
31
+ ' AIX' | ' ppc64' || ' aix' | ' ppc64' | false
31
32
}
32
33
33
34
@Unroll
34
- def " verify ARM handling #archProp (#unameProp)" () {
35
+ def " verify #osProp ARM handling #archProp (#unameProp)" () {
35
36
given :
36
- def platform = PlatformHelperKt . parsePlatform(" Linux" , archProp, { unameProp })
37
+ def osType = PlatformHelperKt . parseOsType(osProp)
38
+ def platform = PlatformHelperKt . parsePlatform(osType, archProp, { unameProp })
37
39
38
40
expect :
39
- platform. name == " linux"
40
- platform. arch == osArch
41
-
42
- where :
43
- archProp | unameProp | osArch
44
- ' arm' | ' armv7l' | ' armv7l' // Raspberry Pi 3
45
- ' arm' | ' armv8l' | ' arm64'
46
- ' aarch32' | ' arm' | ' arm'
47
- ' aarch64' | ' arm64' | ' arm64'
48
- ' aarch64' | ' aarch64' | ' arm64'
49
- ' ppc64le' | ' ppc64le' | ' ppc64le'
50
- }
51
-
52
- @Unroll
53
- def " verify ARM handling Mac OS #archProp (#unameProp)" () {
54
- given :
55
- def platform = PlatformHelperKt . parsePlatform(" Mac OS X" , archProp, { unameProp })
56
-
57
- expect :
58
- platform. name == " darwin"
41
+ platform. name == osName
59
42
platform. arch == osArch
60
43
61
44
where :
62
- archProp | unameProp | osArch
63
- ' aarch32' | ' arm' | ' arm'
64
- ' aarch64' | ' arm64' | ' arm64'
65
- ' aarch64' | ' aarch64' | ' arm64'
66
- ' aarch64' | ' x86_64' | ' x64' // This shouldn't really happen but according to PR #204 it does
45
+ osProp | archProp || osName | unameProp | osArch
46
+ ' Linux' | ' arm' || ' linux' | ' armv7l' | ' armv7l' // Raspberry Pi 3
47
+ ' Linux' | ' arm' || ' linux' | ' armv8l' | ' arm64'
48
+ ' Linux' | ' aarch32' || ' linux' | ' arm' | ' arm'
49
+ ' Linux' | ' aarch64' || ' linux' | ' arm64' | ' arm64'
50
+ ' Linux' | ' aarch64' || ' linux' | ' aarch64' | ' arm64'
51
+ ' Linux' | ' ppc64le' || ' linux' | ' ppc64le' | ' ppc64le'
52
+ ' Mac OS X' | ' aarch32' || ' darwin' | ' arm' | ' arm'
53
+ ' Mac OS X' | ' aarch64' || ' darwin' | ' arm64' | ' arm64'
54
+ ' Mac OS X' | ' aarch64' || ' darwin' | ' aarch64' | ' arm64'
55
+ ' Mac OS X' | ' aarch64' || ' darwin' | ' x86_64' | ' x64' // This unfortunately happens see PR #204
56
+ ' Windows 10' | ' aarch64' || ' win' | ' 12' | ' arm64'
57
+ ' Windows 11' | ' aarch64' || ' win' | ' 9' | ' x64' // Not sure if this can actually happen
67
58
}
68
59
69
60
def " throw exception if unsupported os" () {
0 commit comments