Skip to content

Commit 216bc5d

Browse files
committed
Added the TEST automation script.
1 parent 3d1dddb commit 216bc5d

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

TEST.ps1

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
Write-Host "[Test Execution Options]"
2+
Write-Host "0. All Tests"
3+
Write-Host "1. RepoDb.Core"
4+
Write-Host "2. RepoDb.SqlServer"
5+
Write-Host "3. RepoDb.SqlServer.BulkOperations"
6+
Write-Host "4. RepoDb.Sqlite.Microsoft"
7+
Write-Host "5. RepoDb.SQLite.System"
8+
Write-Host "6. RepoDb.PostgreSql"
9+
Write-Host "7. RepoDb.PostgreSql.BulkOperations"
10+
Write-Host "8. RepoDb.MySql"
11+
Write-Host "9. RepoDb.MySqlConnector"
12+
13+
Function Ensure-Argument ($value, $prompt_message) {
14+
15+
if ([string]::IsNullOrEmpty($value)) {
16+
$value = Read-Host -Prompt $prompt_message
17+
} else {
18+
Write-Host ($prompt_message + ": " + "$value")
19+
}
20+
21+
return $value
22+
}
23+
24+
$option = Ensure-Argument $args[0] 'Option'
25+
$current_location = (Get-Location).Path
26+
27+
# RepoDb.Core
28+
if ($option -eq 1 -or $option -eq 0)
29+
{
30+
Write-Host "Executing the tests for '1. RepoDb.Core'"
31+
dotnet test ($current_location + "\RepoDb.Core\RepoDb.Tests\RepoDb.UnitTests\RepoDb.UnitTests.csproj") -c Release -f net6.0 # -t
32+
dotnet test ($current_location + "\RepoDb.Core\RepoDb.Tests\RepoDb.IntegrationTests\RepoDb.IntegrationTests.csproj") -c Release -f net6.0 # -t
33+
}
34+
35+
# RepoDb.SqlServer
36+
if ($option -eq 2 -or $option -eq 0)
37+
{
38+
Write-Host "Executing the tests for '2. RepoDb.SqlServer'"
39+
dotnet test ($current_location + "\RepoDb.SqlServer\RepoDb.SqlServer.UnitTests\RepoDb.SqlServer.UnitTests.csproj") -c Release -f net6.0 # -t
40+
dotnet test ($current_location + "\RepoDb.SqlServer\RepoDb.SqlServer.IntegrationTests\RepoDb.SqlServer.IntegrationTests.csproj") -c Release -f net6.0 # -t
41+
}
42+
43+
# RepoDb.SqlServer.BulkOperations
44+
if ($option -eq 3 -or $option -eq 0)
45+
{
46+
Write-Host "Executing the tests for '3. RepoDb.SqlServer.BulkOperations'"
47+
dotnet test ($current_location + "\RepoDb.Extensions\RepoDb.SqlServer.BulkOperations\RepoDb.SqlServer.BulkOperations.IntegrationTests\RepoDb.SqlServer.BulkOperations.IntegrationTests.csproj") -c Release -f net6.0 # -t
48+
}
49+
50+
# RepoDb.Sqlite.Microsoft
51+
if ($option -eq 4 -or $option -eq 0)
52+
{
53+
Write-Host "Executing the tests for '4. RepoDb.Sqlite.Microsoft'"
54+
dotnet test ($current_location + "\RepoDb.Sqlite.Microsoft\RepoDb.Sqlite.Microsoft.UnitTests\RepoDb.Sqlite.Microsoft.UnitTests.csproj") -c Release -f net6.0 # -t
55+
dotnet test ($current_location + "\RepoDb.Sqlite.Microsoft\RepoDb.Sqlite.Microsoft.IntegrationTests\RepoDb.Sqlite.Microsoft.IntegrationTests.csproj") -c Release -f net6.0 # -t
56+
}
57+
58+
# RepoDb.SQLite.System
59+
if ($option -eq 5 -or $option -eq 0)
60+
{
61+
Write-Host "Executing the tests for '5. RepoDb.SQLite.System'"
62+
dotnet test ($current_location + "\RepoDb.SQLite.System\RepoDb.SQLite.System.UnitTests\RepoDb.SQLite.System.UnitTests.csproj") -c Release -f net6.0 # -t
63+
dotnet test ($current_location + "\RepoDb.SQLite.System\RepoDb.SQLite.System.IntegrationTests\RepoDb.SQLite.System.IntegrationTests.csproj") -c Release -f net6.0 # -t
64+
}
65+
66+
# RepoDb.PostgreSql
67+
if ($option -eq 6 -or $option -eq 0)
68+
{
69+
Write-Host "Executing the tests for '6. RepoDb.PostgreSql'"
70+
dotnet test ($current_location + "\RepoDb.PostgreSql\RepoDb.PostgreSql.UnitTests\RepoDb.PostgreSql.UnitTests.csproj") -c Release -f net6.0 # -t
71+
dotnet test ($current_location + "\RepoDb.PostgreSql\RepoDb.PostgreSql.IntegrationTests\RepoDb.PostgreSql.IntegrationTests.csproj") -c Release -f net6.0 # -t
72+
}
73+
74+
# RepoDb.PostgreSql.BulkOperations
75+
if ($option -eq 7 -or $option -eq 0)
76+
{
77+
Write-Host "Executing the tests for '7. RepoDb.PostgreSql.BulkOperations'"
78+
dotnet test ($current_location + "\RepoDb.Extensions\RepoDb.PostgreSql.BulkOperations\RepoDb.PostgreSql.BulkOperations.IntegrationTests\RepoDb.PostgreSql.BulkOperations.IntegrationTests.csproj") -c Release -f net6.0 # -t
79+
}
80+
81+
# RepoDb.MySql
82+
if ($option -eq 8 -or $option -eq 0)
83+
{
84+
Write-Host "Executing the tests for '8. RepoDb.MySql'"
85+
dotnet test ($current_location + "\RepoDb.MySql\RepoDb.MySql.UnitTests\RepoDb.MySql.UnitTests.csproj") -c Release -f net6.0 # -t
86+
dotnet test ($current_location + "\RepoDb.MySql\RepoDb.MySql.IntegrationTests\RepoDb.MySql.IntegrationTests.csproj") -c Release -f net6.0 # -t
87+
}
88+
89+
# RepoDb.MySqlConnector
90+
if ($option -eq 9 -or $option -eq 0)
91+
{
92+
Write-Host "Executing the tests for '9. RepoDb.MySqlConnector'"
93+
dotnet test ($current_location + "\RepoDb.MySqlConnector\RepoDb.MySqlConnector.UnitTests\RepoDb.MySqlConnector.UnitTests.csproj") -c Release -f net6.0 # -t
94+
dotnet test ($current_location + "\RepoDb.MySqlConnector\RepoDb.MySqlConnector.IntegrationTests\RepoDb.MySqlConnector.IntegrationTests.csproj") -c Release -f net6.0 # -t
95+
}

0 commit comments

Comments
 (0)