-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.ps1
109 lines (88 loc) · 3.8 KB
/
run-tests.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
dotnet restore ./tests/NLog.UnitTests/
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.UnitTests/ --framework net6.0 --configuration release --no-restore
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
if ($isWindows -or $Env:WinDir)
{
dotnet publish .\tests\TestTrimPublish --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
.\tests\TestTrimPublish\bin\release\net8.0\win-x64\publish\TestTrimPublish.exe
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.UnitTests/ --framework net462 --configuration release --no-restore
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Database.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.AutoReloadConfig.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.RegEx.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.Mail.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.Network.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.WebService.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.WindowsRegistry.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet msbuild /t:Build /p:targetFramework=net462 /p:Configuration=Release /p:DebugType=Full /p:TestTargetFramework=net35 ./tests/NLog.UnitTests/
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet vstest ./tests/NLog.UnitTests/bin/release/net35/NLog.UnitTests.dll
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet msbuild /t:Build /p:targetFramework=net462 /p:Configuration=Release /p:DebugType=Full /p:TestTargetFramework=net45 ./tests/NLog.UnitTests/
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet vstest ./tests/NLog.UnitTests/bin/release/net45/NLog.UnitTests.dll
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet list ./src package --vulnerable --include-transitive | findstr /S /c:"has the following vulnerable packages"
if (-Not $LastExitCode -eq 1)
{
dotnet list ./src package --vulnerable --include-transitive
exit 1
}
}
else
{
dotnet test ./tests/NLog.Database.Tests/ --framework net6.0 --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.AutoReloadConfig.Tests/ --framework net6.0 --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.RegEx.Tests/ --framework net6.0 --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.Mail.Tests/ --framework net6.0 --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.Network.Tests/ --framework net6.0 --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.WebService.Tests/ --framework net6.0 --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
# Need help from MONO to run normal .NetFramework tests
dotnet msbuild /t:restore ./tests/NLog.UnitTests/ /p:RestoreForce=true /p:monobuild=1
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet build ./tests/NLog.UnitTests/ --framework net462 --configuration release --no-restore --no-incremental /p:monobuild=1
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet vstest ./tests/NLog.UnitTests/bin/release/net462/NLog.UnitTests.dll
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
}