-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make macOS platform detection more robust
If we don't know the platform, then take the last row.
- Loading branch information
1 parent
c002f93
commit 8833f0d
Showing
3 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# macos platforms | ||
|
||
Code | ||
get_cran_macos_platform("4.2") | ||
Output | ||
rversion platform subdir | ||
35 4.2 x86_64-apple-darwin17.0 | ||
36 4.2 aarch64-apple-darwin20 big-sur-arm64 | ||
Code | ||
get_cran_macos_platform("4.3") | ||
Output | ||
rversion platform subdir | ||
37 4.3 x86_64-apple-darwin20 big-sur-x86_64 | ||
38 4.3 aarch64-apple-darwin20 big-sur-arm64 | ||
Code | ||
get_cran_macos_platform("4.4") | ||
Output | ||
rversion platform subdir | ||
39 4.4 x86_64-apple-darwin20 big-sur-x86_64 | ||
40 4.4 aarch64-apple-darwin20 big-sur-arm64 | ||
Code | ||
get_cran_macos_platform("4.5") | ||
Output | ||
rversion platform subdir | ||
41 4.5 x86_64-apple-darwin20 big-sur-x86_64 | ||
42 4.5 aarch64-apple-darwin20 big-sur-arm64 | ||
Code | ||
get_cran_macos_platform("4.6") | ||
Output | ||
rversion platform subdir | ||
43 4.6 x86_64-apple-darwin20 big-sur-x86_64 | ||
44 4.6 aarch64-apple-darwin20 big-sur-arm64 | ||
Code | ||
get_cran_macos_platform("5.0") | ||
Output | ||
rversion platform subdir | ||
45 5.0 x86_64-apple-darwin20 big-sur-x86_64 | ||
46 5.0 aarch64-apple-darwin20 big-sur-arm64 | ||
Code | ||
get_cran_macos_platform("10.0") | ||
Output | ||
rversion platform subdir | ||
45 5.0 x86_64-apple-darwin20 big-sur-x86_64 | ||
46 5.0 aarch64-apple-darwin20 big-sur-arm64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
test_that("macos platforms", { | ||
skip_on_cran() | ||
expect_snapshot({ | ||
get_cran_macos_platform("4.2") | ||
get_cran_macos_platform("4.3") | ||
get_cran_macos_platform("4.4") | ||
get_cran_macos_platform("4.5") | ||
get_cran_macos_platform("4.6") | ||
get_cran_macos_platform("5.0") | ||
get_cran_macos_platform("10.0") | ||
}) | ||
|
||
# error if we don't know the platform | ||
# we do this so we can detect the failure on the CI and update | ||
# the platform | ||
v <- paste0(getRversion()[,1:2]) | ||
expect_true(v %in% macos_cran_platforms$rversion) | ||
|
||
# In case CRAN changes the platform for R-devel | ||
if (Sys.info()[["sysname"]] == "Darwin" && .Platform$pkgType != "source") { | ||
plt <- get_cran_macos_platform(v) | ||
expect_true(R.Version()$platform %in% plt$platform) | ||
expect_true(.Platform$pkgType %in% paste0("mac.binary.", plt$subdir)) | ||
} | ||
}) |