Skip to content

Commit 7b593a8

Browse files
committed
Run test in Powershell script
1 parent 47efdcb commit 7b593a8

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,23 +2490,9 @@ jobs:
24902490
- name: SourceKit Validation
24912491
id: sourcekit-validation
24922492
working-directory: ${{ github.workspace }}/SourceCache/swift-win32
2493-
continue-on-error: true
24942493
run: |
2495-
$diagnosticOutput = $( $output = & Get-Content ${{ github.workspace }}/tests/sourcekit-lsp-initialization-message | sourcekit-lsp.exe ) 2>&1
2496-
if (-not ($diagnosticOutput -Match "Succeeded") -or -not ($diagnosticOutput -Match "InitializeResult")) {
2497-
Write-Host "sourcekit-lsp failed to initialize"
2498-
Write-Host $diagnosticOutput
2499-
echo "failed=true" >> $GITHUB_OUTPUT
2500-
} else {
2501-
echo "failed=false" >> $GITHUB_OUTPUT
2502-
}
2503-
2504-
- name: SourceKit Validation Check
2505-
run: |
2506-
if (${{ steps.sourcekit-validation.outputs.failed == 'true' }}) {
2507-
Write-Host "sourcekit-lsp failed to initialize"
2508-
exit 1
2509-
}
2494+
$SourcekitLspPath = (Resolve-Path sourcekit-lsp.exe).Path
2495+
powershell.exe -File ${{ github.workspace }}/tests/sourcekit-lsp/initialization-test.ps1 -PathToSourcekitLsp $SourcekitLspPath
25102496
25112497
snapshot:
25122498
runs-on: ubuntu-latest
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
param(
2+
[Parameter(Mandatory)]
3+
[string] $PathToSourcekitLsp
4+
)
5+
6+
$diagnosticOutput = $( & Get-Content sourcekit-lsp-initialization-message | & $PathToSourcekitLsp ) 2>&1
7+
if (-not ($diagnosticOutput -Match "Succeeded") -or -not ($diagnosticOutput -Match "InitializeResult")) {
8+
Write-Host "sourcekit-lsp failed to initialize"
9+
Write-Host $diagnosticOutput
10+
exit 1
11+
}

0 commit comments

Comments
 (0)