forked from NLog/NLog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.ps1
69 lines (58 loc) · 2.45 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
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\net6.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.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 }
# 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 }
}