forked from NLog/NLog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.ps1
61 lines (52 loc) · 2.21 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
dotnet restore ./tests/NLog.UnitTests/
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet test ./tests/NLog.UnitTests/ --framework netcoreapp3.1 --configuration release --no-restore
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
if ($isWindows -or $Env:WinDir)
{
dotnet test ./tests/NLog.UnitTests/ --framework net461 --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=net461 /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=net461 /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 netcoreapp3.1 --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 net461 --configuration release --no-restore --no-incremental /p:monobuild=1
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
dotnet vstest ./tests/NLog.UnitTests/bin/release/net461/NLog.UnitTests.dll
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
}