forked from cannatag/ldap3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-all.ps1
87 lines (81 loc) · 2.63 KB
/
test-all.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
$PythonVersions = @('3.9', '2.7')
$Strategies = @('SYNC', 'ASYNC', 'SAFE_SYNC', 'RESTARTABLE', 'SAFE_RESTARTABLE')
$Servers = @('EDIR')
$Decoders = @('INTERNAL', 'EXTERNAL')
$Booleans = @('TRUE', 'FALSE')
$OnlyTrue = @('TRUE')
$OnlyFalse = @('FALSE')
$env:VERBOSE="FALSE"
$env:PYTHONIOENCODING="utf-8"
#$env:PYTHONTRACEMALLOC=2
function RunTestSuite
{
param(
[string]$Python,
[string]$Strategy,
[string]$Server,
[string]$Lazy,
[string]$Logging,
[string]$CheckNames,
[string]$Decoder
)
$env:STRATEGY=$Strategy
$env:SERVER=$Server
$env:LAZY=$Lazy
$env:LOGGING=$Logging
$env:CHECK_NAMES=$CheckNames
$env:DECODER=$Decoder
if ($Python -eq "2.7") {
py -2.7 -m unittest discover -s test -c
}
elseif ($Python -eq "3.9") {
.\venv\Scripts\python -m unittest discover -s test -c
}
elseif ($Python -eq "2.6") {
$env:PYTHONIOENCODING="UTF8"
.\venv\Scripts\python -m unittest discover -s test -c
}
else {
Write-Host "Unknown Python version " + $Python
}
}
function RunAllSuites
{
param(
[bool]$DryRun
)
$counter=0
foreach ($Python in $PythonVersions)
{
foreach ($Strategy in $Strategies)
{
foreach ($Server in $Servers)
{
foreach ($Lazy in $Booleans)
{
foreach ($Logging in $Booleans)
{
foreach ($CheckName in $Booleans)
{
foreach ($Decoder in $Decoders)
{
$counter++
if (-not $DryRun)
{
Write-Host "RUNNING $counter -Python $Python -Strategy $Strategy -Server $Server -Lazy $Lazy -Logging $Logging -CheckNames $CheckName -Decoder $Decoder"
RunTestSuite -Python $Python -Strategy $Strategy -Server $Server -Lazy $Lazy -Logging $Logging -CheckNames $CheckName -Decoder $Decoder
Write-Host "Done."
}
else {
Write-Host "DRYRUN $counter -Python $Python -Strategy $Strategy -Server $Server -Lazy $Lazy -Logging $Logging -CheckNames $CheckName -Decoder $Decoder"
}
}
}
}
}
}
}
}
}
RunAllSuites -Dryrun $true
RunAllSuites -Dryrun $false