forked from dotnet/vscode-dotnet-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ps1
78 lines (73 loc) · 1.94 KB
/
test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
$result = 0
$errorColor = "Red"
$successColor = "Green"
if ($args[1] -eq '--tslint') {
npm run lint
if ($LASTEXITCODE -ne 0)
{
Write-Host "`nTSLint Failed.`n" -ForegroundColor $errorColor
$result = 1
}
else
{
Write-Host "`nTSLint Succeeded.`n" -ForegroundColor $successColor
}
}
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
}
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
}
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
}
if ($result -ne 0)
{
Write-Host "`n`nTests Failed.`n" -ForegroundColor $errorColor
exit $result
}
else
{
Write-Host "`n`nAll Tests Succeeded.`n" -ForegroundColor $successColor
exit $result
}