File size: 590 Bytes
7f9dfed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ErrorActionPreference = "Stop"

$python = ".venv\Scripts\python.exe"
if (-not (Test-Path $python)) {
    $python = "python"
    try {
        & $python --version | Out-Null
    } catch {
        $python = "$env:LOCALAPPDATA\Microsoft\WindowsApps\python3.11.exe"
    }
}
$coverageFile = "$env:TEMP\openbmb-workbench.coverage"

& $python -m coverage run --data-file $coverageFile -m unittest discover -s tests -p "test_*.py"
if ($LASTEXITCODE -ne 0) {
    throw "Tests failed"
}
& $python -m coverage report --data-file $coverageFile
if ($LASTEXITCODE -ne 0) {
    throw "Coverage failed"
}