-
Notifications
You must be signed in to change notification settings - Fork 125
/
TEST.ps1
95 lines (82 loc) · 4.45 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Write-Host "[Test Execution Options]"
Write-Host "0. All Tests"
Write-Host "1. RepoDb.Core"
Write-Host "2. RepoDb.SqlServer"
Write-Host "3. RepoDb.SqlServer.BulkOperations"
Write-Host "4. RepoDb.Sqlite.Microsoft"
Write-Host "5. RepoDb.SQLite.System"
Write-Host "6. RepoDb.PostgreSql"
Write-Host "7. RepoDb.PostgreSql.BulkOperations"
Write-Host "8. RepoDb.MySql"
Write-Host "9. RepoDb.MySqlConnector"
Function Ensure-Argument ($value, $prompt_message) {
if ([string]::IsNullOrEmpty($value)) {
$value = Read-Host -Prompt $prompt_message
} else {
Write-Host ($prompt_message + ": " + "$value")
}
return $value
}
$option = Ensure-Argument $args[0] 'Option'
$current_location = (Get-Location).Path
# RepoDb.Core
if ($option -eq 1 -or $option -eq 0)
{
Write-Host "Executing the tests for '1. RepoDb.Core'"
dotnet test ($current_location + "\RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj") -c Release -f net6.0 # -t
dotnet test ($current_location + "\RepoDb.Core\RepoDb.Tests\RepoDb.IntegrationTests\RepoDb.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.SqlServer
if ($option -eq 2 -or $option -eq 0)
{
Write-Host "Executing the tests for '2. RepoDb.SqlServer'"
dotnet test ($current_location + "\RepoDb.SqlServer\RepoDb.SqlServer.UnitTests\RepoDb.SqlServer.UnitTests.csproj") -c Release -f net6.0 # -t
dotnet test ($current_location + "\RepoDb.SqlServer\RepoDb.SqlServer.IntegrationTests\RepoDb.SqlServer.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.SqlServer.BulkOperations
if ($option -eq 3 -or $option -eq 0)
{
Write-Host "Executing the tests for '3. RepoDb.SqlServer.BulkOperations'"
dotnet test ($current_location + "\RepoDb.Extensions\RepoDb.SqlServer.BulkOperations\RepoDb.SqlServer.BulkOperations.IntegrationTests\RepoDb.SqlServer.BulkOperations.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.Sqlite.Microsoft
if ($option -eq 4 -or $option -eq 0)
{
Write-Host "Executing the tests for '4. RepoDb.Sqlite.Microsoft'"
dotnet test ($current_location + "\RepoDb.Sqlite.Microsoft\RepoDb.Sqlite.Microsoft.UnitTests\RepoDb.Sqlite.Microsoft.UnitTests.csproj") -c Release -f net6.0 # -t
dotnet test ($current_location + "\RepoDb.Sqlite.Microsoft\RepoDb.Sqlite.Microsoft.IntegrationTests\RepoDb.Sqlite.Microsoft.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.SQLite.System
if ($option -eq 5 -or $option -eq 0)
{
Write-Host "Executing the tests for '5. RepoDb.SQLite.System'"
dotnet test ($current_location + "\RepoDb.SQLite.System\RepoDb.SQLite.System.UnitTests\RepoDb.SQLite.System.UnitTests.csproj") -c Release -f net6.0 # -t
dotnet test ($current_location + "\RepoDb.SQLite.System\RepoDb.SQLite.System.IntegrationTests\RepoDb.SQLite.System.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.PostgreSql
if ($option -eq 6 -or $option -eq 0)
{
Write-Host "Executing the tests for '6. RepoDb.PostgreSql'"
dotnet test ($current_location + "\RepoDb.PostgreSql\RepoDb.PostgreSql.UnitTests\RepoDb.PostgreSql.UnitTests.csproj") -c Release -f net6.0 # -t
dotnet test ($current_location + "\RepoDb.PostgreSql\RepoDb.PostgreSql.IntegrationTests\RepoDb.PostgreSql.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.PostgreSql.BulkOperations
if ($option -eq 7 -or $option -eq 0)
{
Write-Host "Executing the tests for '7. RepoDb.PostgreSql.BulkOperations'"
dotnet test ($current_location + "\RepoDb.Extensions\RepoDb.PostgreSql.BulkOperations\RepoDb.PostgreSql.BulkOperations.IntegrationTests\RepoDb.PostgreSql.BulkOperations.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.MySql
if ($option -eq 8 -or $option -eq 0)
{
Write-Host "Executing the tests for '8. RepoDb.MySql'"
dotnet test ($current_location + "\RepoDb.MySql\RepoDb.MySql.UnitTests\RepoDb.MySql.UnitTests.csproj") -c Release -f net6.0 # -t
dotnet test ($current_location + "\RepoDb.MySql\RepoDb.MySql.IntegrationTests\RepoDb.MySql.IntegrationTests.csproj") -c Release -f net6.0 # -t
}
# RepoDb.MySqlConnector
if ($option -eq 9 -or $option -eq 0)
{
Write-Host "Executing the tests for '9. RepoDb.MySqlConnector'"
dotnet test ($current_location + "\RepoDb.MySqlConnector\RepoDb.MySqlConnector.UnitTests\RepoDb.MySqlConnector.UnitTests.csproj") -c Release -f net6.0 # -t
dotnet test ($current_location + "\RepoDb.MySqlConnector\RepoDb.MySqlConnector.IntegrationTests\RepoDb.MySqlConnector.IntegrationTests.csproj") -c Release -f net6.0 # -t
}