Compare commits

...

4 Commits

Author SHA1 Message Date
aparnajyothi-y
7a0de94d02 Update python-tests.ps1 2024-10-08 18:00:40 +05:30
aparnajyothi-y
852aa61b41 Update python-tests.ps1 2024-10-08 17:41:36 +05:30
aparnajyothi-y
8038923f91 Update python-tests.ps1 2024-10-08 17:28:06 +05:30
aparnajyothi-y
989f86547f Update python-tests.ps1 2024-10-08 17:05:37 +05:30

View File

@@ -13,29 +13,35 @@ Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
BeforeAll { BeforeAll {
function Analyze-MissingModules([string] $buildOutputLocation) { function Analyze-MissingModules([string] $buildOutputLocation) {
$searchStringStart = "Failed to build these modules:" $searchStringStart = "Failed to build these modules:"
$searchStringEnd = "running build_scripts" $searchStringEnd = "running build_scripts"
$pattern = "$searchStringStart(.*?)$searchStringEnd" $pattern = "$searchStringStart(.*?)$searchStringEnd"
$buildContent = Get-Content -Path $buildOutputLocation $buildContent = Get-Content -Path $buildOutputLocation
$splitBuiltOutput = $buildContent -split "\n"; $splitBuiltOutput = $buildContent -split "\n"
### Search for missing modules that are displayed between the search strings ### Search for missing modules that are displayed between the search strings
$regexMatch = [regex]::match($SplitBuiltOutput, $Pattern) $regexMatch = [regex]::match($splitBuiltOutput, $pattern)
if ($regexMatch.Success) if ($regexMatch.Success) {
{ $module = $regexMatch.Groups[1].Value.Trim()
$module = $regexMatch.Groups[1].Value.Trim() Write-Host "Failed missing modules:"
Write-Host "Failed missing modules:" Write-Host $module
Write-Host $module try {
if ( ($module -eq "_tkinter") -and ( [semver]"$($Version.Major).$($Version.Minor)" -ge [semver]"3.10" -and $Version.PreReleaseLabel ) ) { $semver = [semver]"$($Version.Major).$($Version.Minor)"
Write-Host "$module $Version ignored" } catch {
} else { Write-Error "Invalid Semantic Version format: $Version"
return 1 return 1
}
} }
return 0 if (($module -eq "_tkinter") -and ($semver -ge [semver]"3.8")) {
Write-Host "$module $Version ignored"
} else {
return 1
}
} }
return 0
}
} }
Describe "Tests" { Describe "Tests" {
@@ -54,7 +60,7 @@ Describe "Tests" {
# linux has no display name and no $DISPLAY environment variable - skip tk test # linux has no display name and no $DISPLAY environment variable - skip tk test
# if (-not (($Platform -match "ubuntu") -or ($Platform -match "linux"))) { # if (-not (($Platform -match "ubuntu") -or ($Platform -match "linux"))) {
# It "Check if tcl/tk has the same headed and library versions" { # It "Check if tcl/tk has the same headed and library versions" {
# "python ./sources/tcltk.py" | Should -ReturnZeroExitCode # "python ./sources/tcltk.py" | Should -ReturnZeroExitCode
# } # }
# } # }