2019-11-05 20:48:28 +03:00
|
|
|
$result = 0
|
|
|
|
$errorColor = "Red"
|
|
|
|
$successColor = "Green"
|
|
|
|
|
2024-09-11 07:39:51 +03:00
|
|
|
if ($args[1] -eq '--eslint') {
|
2020-05-11 23:24:54 +03:00
|
|
|
npm run lint
|
|
|
|
if ($LASTEXITCODE -ne 0)
|
|
|
|
{
|
2024-09-11 07:39:51 +03:00
|
|
|
Write-Host "`nESLint Failed.`n" -ForegroundColor $errorColor
|
2020-05-11 23:24:54 +03:00
|
|
|
$result = 1
|
|
|
|
}
|
2023-04-07 01:19:21 +03:00
|
|
|
else
|
2020-05-11 23:24:54 +03:00
|
|
|
{
|
2024-09-11 07:39:51 +03:00
|
|
|
Write-Host "`nESLint Succeeded.`n" -ForegroundColor $successColor
|
2020-05-11 23:24:54 +03:00
|
|
|
}
|
2019-12-12 01:51:03 +03:00
|
|
|
}
|
|
|
|
|
2023-04-07 01:19:21 +03:00
|
|
|
if ($args[1] -ne 'sdk' -and $args[1] -ne 'rnt') {
|
|
|
|
pushd vscode-dotnet-runtime-library
|
|
|
|
if (Test-Path node_modules) { rm -r -force node_modules }
|
|
|
|
npm ci --silent
|
|
|
|
npm run test
|
|
|
|
if ($LASTEXITCODE -ne 0)
|
|
|
|
{
|
|
|
|
Write-Host "`nAcquisition Library Tests Failed.`n" -ForegroundColor $errorColor
|
|
|
|
$result = 1
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Write-Host "`nAcquisition Library Tests Succeeded.`n" -ForegroundColor $successColor
|
|
|
|
}
|
|
|
|
popd
|
2019-11-05 20:48:28 +03:00
|
|
|
}
|
|
|
|
|
2023-04-07 01:19:21 +03:00
|
|
|
if ($args[1] -ne 'sdk' -and $args[1] -ne 'lib') {
|
|
|
|
pushd vscode-dotnet-runtime-extension
|
|
|
|
if (Test-Path node_modules) { rm -r -force node_modules }
|
|
|
|
npm ci --silent
|
|
|
|
npm run test
|
|
|
|
if ($LASTEXITCODE -ne 0)
|
|
|
|
{
|
|
|
|
Write-Host "`n.NET Runtime Acquisition Extension Tests Failed.`n" -ForegroundColor $errorColor
|
|
|
|
$result = 1
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Write-Host "`n.NET Runtime Acquisition Extension Tests Succeeded.`n" -ForegroundColor $successColor
|
|
|
|
}
|
|
|
|
popd
|
2021-02-09 20:37:28 +03:00
|
|
|
}
|
|
|
|
|
2023-04-07 01:19:21 +03:00
|
|
|
if ($args[1] -ne 'lib' -and $args[1] -ne 'rnt') {
|
|
|
|
pushd vscode-dotnet-sdk-extension
|
|
|
|
if (Test-Path node_modules) { rm -r -force node_modules }
|
|
|
|
npm ci --silent
|
|
|
|
npm run test
|
|
|
|
if ($LASTEXITCODE -ne 0)
|
|
|
|
{
|
|
|
|
Write-Host "`n.NET SDK Acquisition Extension Tests Failed.`n" -ForegroundColor $errorColor
|
|
|
|
$result = 1
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Write-Host "`n.NET SDK Acquisition Extension Tests Succeeded.`n" -ForegroundColor $successColor
|
|
|
|
}
|
|
|
|
popd
|
2019-11-05 20:48:28 +03:00
|
|
|
}
|
|
|
|
|
2023-04-07 01:19:21 +03:00
|
|
|
if ($result -ne 0)
|
2019-11-05 20:48:28 +03:00
|
|
|
{
|
|
|
|
Write-Host "`n`nTests Failed.`n" -ForegroundColor $errorColor
|
|
|
|
exit $result
|
|
|
|
}
|
2023-04-07 01:19:21 +03:00
|
|
|
else
|
2019-11-05 20:48:28 +03:00
|
|
|
{
|
2023-04-07 01:19:21 +03:00
|
|
|
Write-Host "`n`nAll Tests Succeeded.`n" -ForegroundColor $successColor
|
2019-11-05 20:48:28 +03:00
|
|
|
exit $result
|
|
|
|
}
|