File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ ext\soap\tests
2020ext\spl\tests
2121ext\sqlite3\tests
2222ext\standard\tests
23+ ext\uri\tests
2324ext\xmlreader\tests
2425ext\xmlwriter\tests
2526ext\xml\tests
Original file line number Diff line number Diff line change @@ -31,16 +31,32 @@ function Get-TestsList {
3131 $directories = Get-Content " $PSScriptRoot \..\config\${Type} _test_directories"
3232 }
3333
34- foreach ($line in $directories ) {
35- $path = " $line " .Trim()
36- if ([string ]::IsNullOrWhiteSpace($path )) {
37- continue
38- }
34+ $testsFound = 0
35+ $outputFilePath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath ($OutputFile )
36+ $writer = [System.IO.StreamWriter ]::new($outputFilePath , $false )
37+ try {
38+ foreach ($line in $directories ) {
39+ $path = " $line " .Trim()
40+ if ([string ]::IsNullOrWhiteSpace($path )) {
41+ continue
42+ }
43+
44+ if (-not (Test-Path - Path $path - PathType Container)) {
45+ Write-Host " Skipping missing test directory: $path "
46+ continue
47+ }
3948
40- $ttr = Get-ChildItem - Path $path - Filter " *.phpt" - Recurse
41- foreach ($t in $ttr ) {
42- Add-Content $OutputFile $t.FullName
49+ Get-ChildItem - Path $path - Filter " *.phpt" - Recurse | ForEach-Object {
50+ $testsFound ++
51+ $writer.WriteLine ($_.FullName )
52+ }
4353 }
54+ } finally {
55+ $writer.Dispose ()
56+ }
57+
58+ if ($testsFound -eq 0 ) {
59+ throw " No tests were found in the configured $Type test directories."
4460 }
4561 }
4662 end {
You can’t perform that action at this time.
0 commit comments