@@ -9,29 +9,31 @@ Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
9
9
Import-Module (Join-Path $PSScriptRoot " ../helpers/common-helpers.psm1" )
10
10
Import-Module (Join-Path $PSScriptRoot " ../builders/python-version.psm1" )
11
11
12
- function Analyze-MissingModules ([string ] $buildOutputLocation ) {
13
- $searchStringStart = " Failed to build these modules:"
14
- $searchStringEnd = " running build_scripts"
15
- $pattern = " $searchStringStart (.*?)$searchStringEnd "
12
+ BeforeAll {
13
+ function Analyze-MissingModules ([string ] $buildOutputLocation ) {
14
+ $searchStringStart = " Failed to build these modules:"
15
+ $searchStringEnd = " running build_scripts"
16
+ $pattern = " $searchStringStart (.*?)$searchStringEnd "
16
17
17
- $buildContent = Get-Content - Path $buildOutputLocation
18
- $splitBuiltOutput = $buildContent -split " \n" ;
18
+ $buildContent = Get-Content - Path $buildOutputLocation
19
+ $splitBuiltOutput = $buildContent -split " \n" ;
19
20
20
- # ## Search for missing modules that are displayed between the search strings
21
- $regexMatch = [regex ]::match($SplitBuiltOutput , $Pattern )
22
- if ($regexMatch.Success )
23
- {
24
- $module = $regexMatch.Groups [1 ].Value.Trim()
25
- Write-Host " Failed missing modules:"
26
- Write-Host $module
27
- if ( ($module -eq " _tkinter" ) -and ( [semver ]" $ ( $Version.Major ) .$ ( $Version.Minor ) " -ge [semver ]" 3.10" -and $Version.PreReleaseLabel ) ) {
28
- Write-Host " $module $Version ignored"
29
- } else {
30
- return 1
21
+ # ## Search for missing modules that are displayed between the search strings
22
+ $regexMatch = [regex ]::match($SplitBuiltOutput , $Pattern )
23
+ if ($regexMatch.Success )
24
+ {
25
+ $module = $regexMatch.Groups [1 ].Value.Trim()
26
+ Write-Host " Failed missing modules:"
27
+ Write-Host $module
28
+ if ( ($module -eq " _tkinter" ) -and ( [semver ]" $ ( $Version.Major ) .$ ( $Version.Minor ) " -ge [semver ]" 3.10" -and $Version.PreReleaseLabel ) ) {
29
+ Write-Host " $module $Version ignored"
30
+ } else {
31
+ return 1
32
+ }
31
33
}
32
- }
33
34
34
- return 0
35
+ return 0
36
+ }
35
37
}
36
38
37
39
Describe " Tests" {
0 commit comments