Skip to content

Commit

Permalink
Run test in Powershell script
Browse files Browse the repository at this point in the history
  • Loading branch information
z2oh committed Mar 7, 2024
1 parent 47efdcb commit bc796d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/swift-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2490,23 +2490,9 @@ jobs:
- name: SourceKit Validation
id: sourcekit-validation
working-directory: ${{ github.workspace }}/SourceCache/swift-win32
continue-on-error: true
run: |
$diagnosticOutput = $( $output = & Get-Content ${{ github.workspace }}/tests/sourcekit-lsp-initialization-message | sourcekit-lsp.exe ) 2>&1
if (-not ($diagnosticOutput -Match "Succeeded") -or -not ($diagnosticOutput -Match "InitializeResult")) {
Write-Host "sourcekit-lsp failed to initialize"
Write-Host $diagnosticOutput
echo "failed=true" >> $GITHUB_OUTPUT
} else {
echo "failed=false" >> $GITHUB_OUTPUT
}
- name: SourceKit Validation Check
run: |
if (${{ steps.sourcekit-validation.outputs.failed == 'true' }}) {
Write-Host "sourcekit-lsp failed to initialize"
exit 1
}
$SourcekitLspPath = (Resolve-Path sourcekit-lsp.exe).Path
powershell.exe -File ${{ github.workspace }}/tests/sourcekit-lsp/initialization-test.ps1 -PathToSourcekitLsp $SourcekitLspPath
snapshot:
runs-on: ubuntu-latest
Expand Down
11 changes: 11 additions & 0 deletions tests/sourcekit-lsp/initialization-test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
param(
[Parameter(Mandatory)]
[string] $PathToSourcekitLsp
)

$diagnosticOutput = $( & Get-Content sourcekit-lsp-initialization-message | & $PathToSourcekitLsp ) 2>&1
if (-not ($diagnosticOutput -Match "Succeeded") -or -not ($diagnosticOutput -Match "InitializeResult")) {
Write-Host "sourcekit-lsp failed to initialize"
Write-Host $diagnosticOutput
exit 1
}
File renamed without changes.

0 comments on commit bc796d1

Please sign in to comment.