diff --git a/tests/python-tests.ps1 b/tests/python-tests.ps1 index 52f7fcc..9d80512 100644 --- a/tests/python-tests.ps1 +++ b/tests/python-tests.ps1 @@ -13,35 +13,35 @@ Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1") BeforeAll { function Analyze-MissingModules([string] $buildOutputLocation) { - $searchStringStart = "Failed to build these modules:" - $searchStringEnd = "running build_scripts" - $pattern = "$searchStringStart(.*?)$searchStringEnd" + $searchStringStart = "Failed to build these modules:" + $searchStringEnd = "running build_scripts" + $pattern = "$searchStringStart(.*?)$searchStringEnd" - $buildContent = Get-Content -Path $buildOutputLocation - $splitBuiltOutput = $buildContent -split "\n" + $buildContent = Get-Content -Path $buildOutputLocation + $splitBuiltOutput = $buildContent -split "\n" - ### Search for missing modules that are displayed between the search strings - $regexMatch = [regex]::match($splitBuiltOutput, $pattern) - if ($regexMatch.Success) { - $module = $regexMatch.Groups[1].Value.Trim() - Write-Host "Failed missing modules:" - Write-Host $module - try { - $semver = [semver]"$($Version.Major).$($Version.Minor)" - } catch { - Write-Error "Invalid Semantic Version format: $Version" - return 1 - } - - if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.10") -and $Version.PreReleaseLabel) { - Write-Host "$module $Version ignored" - } else { - return 1 - } + ### Search for missing modules that are displayed between the search strings + $regexMatch = [regex]::match($splitBuiltOutput, $pattern) + if ($regexMatch.Success) { + $module = $regexMatch.Groups[1].Value.Trim() + Write-Host "Failed missing modules:" + Write-Host $module + try { + $semver = [semver]"$($Version.Major).$($Version.Minor)" + } catch { + Write-Error "Invalid Semantic Version format: $Version" + return 1 } - return 0 + if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.10") -and $Version.PreReleaseLabel) { + Write-Host "$module $Version ignored" + } else { + return 1 + } } + + return 0 +} } Describe "Tests" {