-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-tests.ps1
More file actions
85 lines (70 loc) · 3.09 KB
/
run-tests.ps1
File metadata and controls
85 lines (70 loc) · 3.09 KB
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
dotnet restore ./tests/NLog.UnitTests/
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.UnitTests/ --framework net8.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.Targets.AtomicFile.Tests/ --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.AtomicFile.Tests/ --configuration release /p:TestTargetFramework=netstandard2.0
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.GZipFile.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.Targets.AtomicFile.Tests/NLog.Targets.AtomicFile.Tests.csproj --framework net8.0 --configuration release --runtime linux-x64
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.RegEx.Tests/ --framework net8.0 --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.Targets.GZipFile.Tests/ --framework net8.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 }
}