[macOS] Deprecate stale code, update structure accordingly (#11473)

This commit is contained in:
Erik Bershel
2025-01-27 14:09:51 +01:00
committed by GitHub
parent 19c847488e
commit 620ebdf37b
54 changed files with 105 additions and 3203 deletions

View File

@@ -57,14 +57,6 @@ Describe "Android" {
Sdkmanager = "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
}
)
if ($os.IsMonterey) {
$testCases += @(
@{
PackageName = "SDK tools"
Sdkmanager = "$env:ANDROID_HOME/tools/bin/sdkmanager"
}
)
}
It "Sdkmanager from <PackageName> is available" -TestCases $testCases {
"$Sdkmanager --version" | Should -ReturnZeroExitCode

View File

@@ -26,12 +26,6 @@ Describe "cmake" {
}
}
Describe "Subversion" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Subversion" {
"svn --version" | Should -ReturnZeroExitCode
}
}
Describe "SwiftFormat" {
It "SwiftFormat" {
"swiftformat --version" | Should -ReturnZeroExitCode
@@ -87,7 +81,7 @@ Describe "7-Zip" {
}
}
Describe "Apache Ant" -Skip:($os.IsMonterey) {
Describe "Apache Ant" {
It "Apache Ant" {
"ant -version" | Should -ReturnZeroExitCode
}
@@ -111,12 +105,6 @@ Describe "bazel" {
}
}
Describe "Julia" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Julia" {
"julia --version" | Should -ReturnZeroExitCode
}
}
Describe "jq" {
It "jq" {
"jq --version" | Should -ReturnZeroExitCode
@@ -135,31 +123,13 @@ Describe "wget" {
}
}
Describe "vagrant" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "vagrant" {
"vagrant --version" | Should -ReturnZeroExitCode
}
}
Describe "virtualbox" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "virtualbox" {
"vboxmanage -v" | Should -ReturnZeroExitCode
}
}
Describe "R" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "R" {
"R --version" | Should -ReturnZeroExitCode
}
}
Describe "Homebrew" {
It "Homebrew" {
"brew --version" | Should -ReturnZeroExitCode
}
}
Describe "Kotlin" -Skip:($os.IsMonterey) {
Describe "Kotlin" {
$kotlinPackages = @("kapt", "kotlin", "kotlinc", "kotlinc-jvm", "kotlinc-js")
It "<toolName> is available" -TestCases ($kotlinPackages | ForEach-Object { @{ toolName = $_ } }) {
@@ -173,12 +143,6 @@ Describe "yq" {
}
}
Describe "imagemagick" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "imagemagick" {
"magick -version" | Should -ReturnZeroExitCode
}
}
Describe "pkgconf" {
It "pkgconf" {
"pkgconf --version" | Should -ReturnZeroExitCode

View File

@@ -58,77 +58,18 @@ Describe "AzCopy" {
}
}
Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Conda" {
[System.Environment]::GetEnvironmentVariable("CONDA") | Should -Not -BeNullOrEmpty
$condaBinPath = Join-Path $env:CONDA "bin" "conda"
"$condaBinPath --version" | Should -ReturnZeroExitCode
}
}
Describe "Stack" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Stack" {
"stack --version" | Should -ReturnZeroExitCode
}
}
Describe "CocoaPods" {
It "CocoaPods" {
"pod --version" | Should -ReturnZeroExitCode
}
}
Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$vsMacVersions = (Get-ToolsetContent).xamarin.vsmac.versions
$defaultVSMacVersion = (Get-ToolsetContent).xamarin.vsmac.default
$testCases = $vsMacVersions | ForEach-Object {
$vsPath = "/Applications/Visual Studio $_.app"
if ($_ -eq $defaultVSMacVersion) {
$vsPath = "/Applications/Visual Studio.app"
}
@{ vsversion = $_ ; vspath = $vsPath }
}
It "Visual Studio <vsversion> for Mac is installed" -TestCases $testCases {
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
$vsPath | Should -Exist
$vstoolPath | Should -Exist
}
It "Visual Studio $defaultVSMacVersion for Mac is default" {
$vsPath = "/Applications/Visual Studio.app"
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
$vsPath | Should -Exist
$vstoolPath | Should -Exist
}
}
Describe "Swig" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Swig" {
"swig -version" | Should -ReturnZeroExitCode
}
}
Describe "Bicep" {
It "Bicep" {
"bicep --version" | Should -ReturnZeroExitCode
}
}
Describe "Go" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Go" {
"go version" | Should -ReturnZeroExitCode
}
}
Describe "VirtualBox" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Check kext kernel modules" {
kextstat | Out-String | Should -Match "org.virtualbox.kext"
}
}
Describe "CodeQL Bundle" {
It "Is installed" {
$CodeQLVersionWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
@@ -141,28 +82,6 @@ Describe "CodeQL Bundle" {
}
}
Describe "Colima" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Colima" {
"colima version" | Should -ReturnZeroExitCode
}
}
Describe "Compiled" -Skip:(-not $os.IsMonterey) {
It "Apache Ant" {
"ant -version" | Should -ReturnZeroExitCode
}
$kotlinPackages = @("kapt", "kotlin", "kotlinc", "kotlinc-jvm", "kotlin-dce-js")
It "<toolName> is available" -TestCases ($kotlinPackages | ForEach-Object { @{ toolName = $_ } }) {
"$toolName -version" | Should -ReturnZeroExitCode
}
It "sbt" {
"sbt -version" | Should -ReturnZeroExitCode
}
}
Describe "Unxip" {
It "Unxip" {
"unxip --version" | Should -ReturnZeroExitCode

View File

@@ -1,30 +0,0 @@
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "Haskell" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
Context "GHCup" {
It "GHCup" {
"ghcup --version" | Should -ReturnZeroExitCode
}
}
Context "GHC" {
It "GHC" {
"ghc --version" | Should -ReturnZeroExitCode
}
}
Context "Cabal" {
It "Cabal" {
"cabal --version" | Should -ReturnZeroExitCode
}
}
Context "Stack" {
It "Stack" {
"stack --version" | Should -ReturnZeroExitCode
}
It "Stack hook is not installed" {
"$HOME/.stack/hooks/ghc-install.sh" | Should -Not -Exist
}
}
}

View File

@@ -0,0 +1,74 @@
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking
$os = Get-OSVersion
BeforeAll {
function Get-ShortSymlink {
param (
[string] $Version
)
$versionParts = $Version.Split(".")
return [String]::Join(".", $versionParts[0..1])
}
}
Describe "Mono" -Skip:($os.IsSequoia) {
$MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions"
$monoToolsetVersion = @((Get-ToolsetContent).mono.framework.version)
$versionFolderPath = Join-Path $MONO_VERSIONS_PATH ([System.Version]::Parse($monoToolsetVersion).ToString(3))
$testCase = @{ MonoVersion = $monoToolsetVersion; VersionFolderPath = $versionFolderPath; MonoVersionsPath = $MONO_VERSIONS_PATH }
It "is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$monoBinPath = Join-Path $VersionFolderPath "bin" "mono"
$VersionFolderPath | Should -Exist
$monoBinPath | Should -Exist
}
It "is available via short link" -TestCases $testCase {
param (
[string] $MonoVersion,
[string] $MonoVersionsPath,
[string] $VersionFolderPath
)
$shortSymlink = Get-ShortSymlink $MonoVersion # only 'major.minor'
$shortSymlinkFolderPath = Join-Path $MonoVersionsPath $shortSymlink
if ($shortSymlink -eq "4.8") { return } # Skip this test for Mono 4.8 because it doesn't contain VERSION file
$shortVersionPath = Join-Path $shortSymlinkFolderPath "VERSION"
$fullVersionPath = Join-Path $VersionFolderPath "VERSION"
Confirm-IdenticalFileContent -File1 $shortVersionPath -File2 $fullVersionPath
}
It "NUnit console is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$nunitPath = Join-Path $VersionFolderPath "Commands" "nunit3-console"
$nunitPath | Should -Exist
}
It "Nuget is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$nugetBinaryPath = Join-Path $VersionFolderPath "lib" "mono" "nuget" "nuget.exe"
$nugetBinaryWrapperPath = Join-Path $VersionFolderPath "bin" "nuget"
$nugetCommandPath = Join-Path $VersionFolderPath "Commands" "nuget"
$nugetBinaryPath | Should -Exist
$nugetCommandPath | Should -Exist
$nugetBinaryWrapperPath | Should -Exist
}
It "Nuget is valid" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$nugetBinaryWrapperPath = Join-Path $VersionFolderPath "bin" "nuget"
"$nugetBinaryWrapperPath" | Should -ReturnZeroExitCode
}
It "MSBuild is available" {
"msbuild -version" | Should -ReturnZeroExitCode
}
}

View File

@@ -1,12 +0,0 @@
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "PipxPackages" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$pipxToolset = (Get-ToolsetContent).pipx
$testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} }
It "<package>" -TestCases $testCases {
"$cmd" | Should -ReturnZeroExitCode
}
}

View File

@@ -6,11 +6,6 @@ function Get-ShortVersion([System.Version] $Version) {
return [System.Version]::Parse($Version).ToString(2)
}
function Invoke-BashUtilsFunction([string] $FunctionName, [string]$parameter) {
$xamarinUtilsPath = "$PSScriptRoot/../provision/utils/xamarin-utils.sh"
return Invoke-Expression "bash -c `"source $xamarinUtilsPath && $FunctionName $parameter`""
}
Describe "Toolset JSON validation" {
$toolsets | ForEach-Object {
It "$($_.Name) is valid" {
@@ -33,109 +28,5 @@ $toolsets | ForEach-Object {
$toolset.xcode.versions | Should -Contain $toolset.xcode.default
}
}
Context "VSMac" {
$vsmacVersion = $toolset.xamarin.vsmac
It "Version '$vsmacVersion' is available and can be downloaded" {
$vsmacUrl = Invoke-BashUtilsFunction("buildVSMacDownloadUrl", $vsmacVersion)
Confirm-UrlAvailability $vsmacUrl
}
}
Context "Mono" {
$sdkVersions = $toolset.xamarin.mono_versions
$sdkVersions | ForEach-Object {
It "Version '$_' is available and can be downloaded" {
$sdkUrl = Invoke-BashUtilsFunction("buildMonoDownloadUrl", $_)
Confirm-UrlAvailability $sdkUrl
}
}
It "Version list doesn't contain versions with the same major/minor version" {
$versions = $sdkVersions | ForEach-Object { Get-ShortVersion $_ }
Confirm-ArrayWithoutDuplicates $versions -Because "It doesn't allow to install more than one version with the same major/minor"
}
}
Context "Xamarin.iOS" {
$sdkVersions = $toolset.xamarin.ios_versions
$sdkVersions | ForEach-Object {
It "Version '$_' is available and can be downloaded" {
$sdkUrl = Invoke-BashUtilsFunction("buildXamariniIOSDownloadUrl", $_)
Confirm-UrlAvailability $sdkUrl
}
}
It "Version list doesn't contain versions with the same major/minor version" {
$versions = $sdkVersions | ForEach-Object { Get-ShortVersion $_ }
Confirm-ArrayWithoutDuplicates $versions -Because "It doesn't allow to install more than one version with the same major/minor"
}
}
Context "Xamarin.Mac" {
$sdkVersions = $toolset.xamarin.mac_versions
$sdkVersions | ForEach-Object {
It "Version '$_' is available and can be downloaded" {
$sdkUrl = Invoke-BashUtilsFunction("buildXamarinMacDownloadUrl", $_)
Confirm-UrlAvailability $sdkUrl
}
}
It "Version list doesn't contain versions with the same major/minor version" {
$versions = $sdkVersions | ForEach-Object { Get-ShortVersion $_ }
Confirm-ArrayWithoutDuplicates $versions -Because "It doesn't allow to install more than one version with the same major/minor"
}
}
Context "Xamarin.Android" {
$sdkVersions = $toolset.xamarin.android_versions
$sdkVersions | ForEach-Object {
It "Version '$_' is available and can be downloaded" {
$sdkUrl = Invoke-BashUtilsFunction("buildXamarinAndroidDownloadUrl", $_)
Confirm-UrlAvailability $sdkUrl
}
}
It "Version list doesn't contain versions with the same major/minor version" {
$versions = $sdkVersions | ForEach-Object { $_.Replace("-", ".") } | ForEach-Object { Get-ShortVersion $_ }
Confirm-ArrayWithoutDuplicates $versions -Because "It doesn't allow to install more than one version with the same major/minor"
}
}
Context "Xamarin bundles" {
$monoVersions = $toolset.xamarin.mono_versions | ForEach-Object { Get-ShortVersion $_ }
$iOSVersions = $toolset.xamarin.ios_versions | ForEach-Object { Get-ShortVersion $_ }
$macVersions = $toolset.xamarin.mac_versions | ForEach-Object { Get-ShortVersion $_ }
# Old Xamarin.Android version looks like "9.0.0-18" that doesn't support by System.Version
$androidVersions = $toolset.xamarin.android_versions | ForEach-Object { Get-ShortVersion $_.Replace("-", ".") }
$bundles = $toolset.xamarin.bundles
$bundles | ForEach-Object {
It "'$($_.symlink)' is valid" {
$monoVersions | Should -Contain $_.mono
$iOSVersions | Should -Contain $_.ios
$macVersions | Should -Contain $_.mac
$androidVersions | Should -Contain $_.android
}
}
It "Each bundle has unique symlink" {
$symlinks = $bundles | ForEach-Object { $_.symlink }
Confirm-ArrayWithoutDuplicates $symlinks -Because "Bundle symlinks should be unique"
}
It "Current bundle is valid" {
$currentBundleSymlink = $toolset.xamarin.bundle_default
if ($currentBundleSymlink -ne "latest") {
$bundleSymlinks = $bundles | ForEach-Object { $_.symlink }
$bundleSymlinks | Should -Contain $currentBundleSymlink -Because "Current bundle should be installed"
}
}
}
}
}

View File

@@ -1,25 +0,0 @@
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Apache CLI" {
"httpd -v" | Should -ReturnZeroExitCode
}
It "Apache Service" {
$service = brew services list --json | ConvertFrom-Json | Where-Object { $_.name -eq "httpd" }
$service.status | Should -Match "(stopped|none)"
}
}
Describe "Nginx" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Nginx CLI" {
"nginx -v" | Should -ReturnZeroExitCode
}
It "Nginx Service" {
$service = brew services list --json | ConvertFrom-Json | Where-Object { $_.name -eq "nginx" }
$service.status | Should -Match "(stopped|none)"
}
}

View File

@@ -1,317 +0,0 @@
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking
$os = Get-OSVersion
if ($os.IsVentura -or $os.IsSonoma) {
$MONO_VERSIONS = @((Get-ToolsetContent).mono.framework.version)
$XAMARIN_IOS_VERSIONS = @()
$XAMARIN_MAC_VERSIONS = @()
$XAMARIN_ANDROID_VERSIONS = @()
} elseif ($os.IsMonterey) {
$MONO_VERSIONS = (Get-ToolsetContent).xamarin.mono_versions
$XAMARIN_IOS_VERSIONS = (Get-ToolsetContent).xamarin.ios_versions
$XAMARIN_MAC_VERSIONS = (Get-ToolsetContent).xamarin.mac_versions
$XAMARIN_ANDROID_VERSIONS = (Get-ToolsetContent).xamarin.android_versions
} elseif ($os.IsSequoia) {
Write-Host "Skipping all the Mono and Xamarin tests as deprecated"
# Dummy workaround for the issue with the tests discovery
$MONO_VERSIONS = @()
$XAMARIN_IOS_VERSIONS = @()
$XAMARIN_MAC_VERSIONS = @()
$XAMARIN_ANDROID_VERSIONS = @()
}
BeforeAll {
function Get-ShortSymlink {
param (
[string] $Version
)
$versionParts = $Version.Split(".")
return [String]::Join(".", $versionParts[0..1])
}
}
Describe "Mono" -Skip:($os.IsSequoia) {
$MONO_VERSIONS | ForEach-Object {
Context "$_" {
$MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions"
$versionFolderPath = Join-Path $MONO_VERSIONS_PATH ([System.Version]::Parse($_).ToString(3))
$testCase = @{ MonoVersion = $_; VersionFolderPath = $versionFolderPath; MonoVersionsPath = $MONO_VERSIONS_PATH }
It "is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$monoBinPath = Join-Path $VersionFolderPath "bin" "mono"
$VersionFolderPath | Should -Exist
$monoBinPath | Should -Exist
}
It "is available via short link" -TestCases $testCase {
param (
[string] $MonoVersion,
[string] $MonoVersionsPath,
[string] $VersionFolderPath
)
$shortSymlink = Get-ShortSymlink $MonoVersion # only 'major.minor'
$shortSymlinkFolderPath = Join-Path $MonoVersionsPath $shortSymlink
if ($shortSymlink -eq "4.8") { return } # Skip this test for Mono 4.8 because it doesn't contain VERSION file
$shortVersionPath = Join-Path $shortSymlinkFolderPath "VERSION"
$fullVersionPath = Join-Path $VersionFolderPath "VERSION"
Confirm-IdenticalFileContent -File1 $shortVersionPath -File2 $fullVersionPath
}
It "NUnit console is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$nunitPath = Join-Path $VersionFolderPath "Commands" "nunit3-console"
$nunitPath | Should -Exist
}
It "Nuget is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$nugetBinaryPath = Join-Path $VersionFolderPath "lib" "mono" "nuget" "nuget.exe"
$nugetBinaryWrapperPath = Join-Path $VersionFolderPath "bin" "nuget"
$nugetCommandPath = Join-Path $VersionFolderPath "Commands" "nuget"
$nugetBinaryPath | Should -Exist
$nugetCommandPath | Should -Exist
$nugetBinaryWrapperPath | Should -Exist
}
It "Nuget is valid" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$nugetBinaryWrapperPath = Join-Path $VersionFolderPath "bin" "nuget"
"$nugetBinaryWrapperPath" | Should -ReturnZeroExitCode
}
}
}
It "MSBuild is available" {
"msbuild -version" | Should -ReturnZeroExitCode
}
}
Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$XAMARIN_IOS_VERSIONS | ForEach-Object {
Context "$_" {
$XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions"
$versionFolderPath = Join-Path $XAMARIN_IOS_VERSIONS_PATH $_
$testCase = @{ XamarinIosVersion = $_; VersionFolderPath = $versionFolderPath; IosVersionsPath = $XAMARIN_IOS_VERSIONS_PATH }
It "is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$xamarinBinPath = Join-Path $VersionFolderPath "bin"
$VersionFolderPath | Should -Exist
$xamarinBinPath | Should -Exist
}
It "is available via short link" -TestCases $testCase {
param (
[string] $XamarinIosVersion,
[string] $IosVersionsPath,
[string] $VersionFolderPath
)
$shortSymlink = Get-ShortSymlink $XamarinIosVersion # only 'major.minor'
$shortSymlinkFolderPath = Join-Path $IosVersionsPath $shortSymlink
$shortVersionPath = Join-Path $shortSymlinkFolderPath "VERSION"
$fullVersionPath = Join-Path $VersionFolderPath "VERSION"
Confirm-IdenticalFileContent -File1 $shortVersionPath -File2 $fullVersionPath
}
}
}
}
Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$XAMARIN_MAC_VERSIONS | ForEach-Object {
Context "$_" {
$XAMARIN_MAC_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Mac.framework/Versions"
$versionFolderPath = Join-Path $XAMARIN_MAC_VERSIONS_PATH $_
$testCase = @{ XamarinMacVersion = $_; VersionFolderPath = $versionFolderPath; MacVersionsPath = $XAMARIN_MAC_VERSIONS_PATH }
It "is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$xamarinBinPath = Join-Path $VersionFolderPath "bin"
$VersionFolderPath | Should -Exist
$xamarinBinPath | Should -Exist
}
It "is available via short link" -TestCases $testCase {
param (
[string] $XamarinMacVersion,
[string] $MacVersionsPath,
[string] $VersionFolderPath
)
$shortSymlink = Get-ShortSymlink $XamarinMacVersion # only 'major.minor'
$shortSymlinkFolderPath = Join-Path $MacVersionsPath $shortSymlink
$shortVersionPath = Join-Path $shortSymlinkFolderPath "VERSION"
$fullVersionPath = Join-Path $VersionFolderPath "VERSION"
Confirm-IdenticalFileContent -File1 $shortVersionPath -File2 $fullVersionPath
}
}
}
}
Describe "Xamarin.Android" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$XAMARIN_ANDROID_VERSIONS | ForEach-Object {
Context "$_" {
$XAMARIN_ANDROID_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions"
$versionFolderPath = Join-Path $XAMARIN_ANDROID_VERSIONS_PATH $_
$testCase = @{ XamarinAndroidVersion = $_; VersionFolderPath = $versionFolderPath; AndroidVersionsPath = $XAMARIN_ANDROID_VERSIONS_PATH }
It "is installed" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$xamarinLibPath = Join-Path $VersionFolderPath "lib"
$xamarinLibPath | Should -Exist
}
It "is available via short link" -TestCases $testCase {
param (
[string] $XamarinAndroidVersion,
[string] $AndroidVersionsPath,
[string] $VersionFolderPath
)
$shortSymlink = Get-ShortSymlink $XamarinAndroidVersion # only 'major.minor'
$shortSymlinkFolderPath = Join-Path $AndroidVersionsPath $shortSymlink
$shortVersionPath = Join-Path $shortSymlinkFolderPath "VERSION"
$fullVersionPath = Join-Path $VersionFolderPath "VERSION"
Confirm-IdenticalFileContent -File1 $shortVersionPath -File2 $fullVersionPath
}
It "has correct symlinks" -TestCases $testCase {
param ( [string] $VersionFolderPath )
$xamarinLibPath = Join-Path $VersionFolderPath "lib"
Join-Path $xamarinLibPath "xbuild" | Should -Exist
Join-Path $xamarinLibPath "xbuild-frameworks" | Should -Exist
}
}
}
}
Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
BeforeAll {
$MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions"
$XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions"
$XAMARIN_MAC_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Mac.framework/Versions"
$XAMARIN_ANDROID_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions"
}
If ($XAMARIN_BUNDLES.Count -eq 0) { return } # Skip this test if there are no bundles
[array]$XAMARIN_BUNDLES = (Get-ToolsetContent).xamarin.bundles
$XAMARIN_DEFAULT_BUNDLE = (Get-ToolsetContent).xamarin.bundle_default
If ($XAMARIN_DEFAULT_BUNDLE -eq "latest") { $XAMARIN_DEFAULT_BUNDLE = $XAMARIN_BUNDLES[0].symlink }
$currentBundle = [PSCustomObject] @{
symlink = "Current"
mono = $XAMARIN_DEFAULT_BUNDLE
ios = $XAMARIN_DEFAULT_BUNDLE
mac = $XAMARIN_DEFAULT_BUNDLE
android = $XAMARIN_DEFAULT_BUNDLE
}
$latestBundle = [PSCustomObject] @{
symlink = "Latest"
mono = $XAMARIN_BUNDLES[0].mono
ios = $XAMARIN_BUNDLES[0].ios
mac = $XAMARIN_BUNDLES[0].mac
android = $XAMARIN_BUNDLES[0].android
}
$bundles = $XAMARIN_BUNDLES + $currentBundle + $latestBundle
$allBundles = $bundles | ForEach-Object { @{BundleSymlink = $_.symlink; BundleMono = $_.mono; BundleIos = $_.ios; BundleMac = $_.mac; BundleAndroid = $_.android } }
It "Mono symlink <BundleSymlink> exists" -TestCases $allBundles {
param ( [string] $BundleSymlink )
(Join-Path $MONO_VERSIONS_PATH $BundleSymlink) | Should -Exist
}
It "Mono symlink <BundleSymlink> points to the correct version" -TestCases $allBundles {
param (
[string] $BundleSymlink,
[string] $BundleMono
)
if ($BundleMono -eq "4.8") { return } # Skip this test for Mono 4.8 because it doesn't contain VERSION file
$sourceVersionPath = Join-Path $MONO_VERSIONS_PATH $BundleMono "VERSION"
$targetVersionPath = Join-Path $MONO_VERSIONS_PATH $BundleSymlink "VERSION"
Confirm-IdenticalFileContent -File1 $targetVersionPath -File2 $sourceVersionPath
}
It "iOS symlink <BundleSymlink> exists" -TestCases $allBundles {
param ( [string] $BundleSymlink )
(Join-Path $XAMARIN_IOS_VERSIONS_PATH $BundleSymlink) | Should -Exist
}
It "iOS symlink <BundleSymlink> points to the correct version" -TestCases $allBundles {
param (
[string] $BundleSymlink,
[string] $BundleIos
)
$sourceVersionPath = Join-Path $XAMARIN_IOS_VERSIONS_PATH $BundleIos "VERSION"
$targetVersionPath = Join-Path $XAMARIN_IOS_VERSIONS_PATH $BundleSymlink "VERSION"
Confirm-IdenticalFileContent -File1 $targetVersionPath -File2 $sourceVersionPath
}
It "Mac symlink <BundleSymlink> exists" -TestCases $allBundles {
param ( [string] $BundleSymlink )
(Join-Path $XAMARIN_MAC_VERSIONS_PATH $BundleSymlink) | Should -Exist
}
It "Mac symlink <BundleSymlink> points to the correct version" -TestCases $allBundles {
param (
[string] $BundleSymlink,
[string] $BundleMac
)
$sourceVersionPath = Join-Path $XAMARIN_MAC_VERSIONS_PATH $BundleMac "VERSION"
$targetVersionPath = Join-Path $XAMARIN_MAC_VERSIONS_PATH $BundleSymlink "VERSION"
Confirm-IdenticalFileContent -File1 $targetVersionPath -File2 $sourceVersionPath
}
It "Xamarin.Android symlink <BundleSymlink> exists" -TestCases $allBundles {
param ( [string] $BundleSymlink )
(Join-Path $XAMARIN_ANDROID_VERSIONS_PATH $BundleSymlink) | Should -Exist
}
It "Android symlink <BundleSymlink> points to the correct version" -TestCases $allBundles {
param (
[string] $BundleSymlink,
[string] $BundleAndroid
)
$sourceVersionPath = Join-Path $XAMARIN_ANDROID_VERSIONS_PATH $BundleAndroid "VERSION"
$targetVersionPath = Join-Path $XAMARIN_ANDROID_VERSIONS_PATH $BundleSymlink "VERSION"
Confirm-IdenticalFileContent -File1 $targetVersionPath -File2 $sourceVersionPath
}
}
Describe "Nuget" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Nuget config contains nuget.org feed" {
Get-Content $env:HOME/.config/NuGet/NuGet.Config | Out-String | Should -Match "nuget.org"
}
}

View File

@@ -122,20 +122,3 @@ Describe "Xcode simulators" {
Switch-Xcode -Version $defaultXcode
}
}
Describe "Xcode Simulators Naming" -Skip:(-not $os.IsMonterey) {
$testCases = Get-BrokenXcodeSimulatorsList
It "Simulator '<SimulatorName> [<RuntimeId>]'" -TestCases $testCases {
$simctlPath = Get-XcodeToolPath -Version $XcodeVersion -ToolName "simctl"
[string]$rawDevicesInfo = Invoke-Expression "$simctlPath list devices --json"
$jsonDevicesInfo = ($rawDevicesInfo | ConvertFrom-Json).devices
$foundSimulators = $jsonDevicesInfo.$RuntimeId | Where-Object { $_.deviceTypeIdentifier -eq $DeviceId }
$foundSimulators | Should -HaveCount 1
$foundSimulators[0].name | Should -Be $SimulatorName
$foundSimulators = $jsonDevicesInfo.$RuntimeId | Where-Object { $_.name -eq $SimulatorName }
$foundSimulators | Should -HaveCount 1
$foundSimulators[0].deviceTypeIdentifier | Should -Be $DeviceId
}
}