Skip to content

Commit 0db262d

Browse files
committed
[Windows] Run native unit tests in CI
1 parent 18263c2 commit 0db262d

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.ci/scripts/unittest-windows.ps1

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,31 @@ Set-PSDebug -Trace 1
66
$ErrorActionPreference = 'Stop'
77
$PSNativeCommandUseErrorActionPreference = $true
88

9-
# Run pytest with coverage
10-
# pytest -n auto --cov=./ --cov-report=xml
11-
pytest -v --full-trace -c pytest-windows.ini
9+
# Run pytest
10+
pytest -v pytest-windows.ini
1211
if ($LASTEXITCODE -ne 0) {
1312
Write-Host "Pytest invocation was unsuccessful. Exit code: $LASTEXITCODE."
1413
exit $LASTEXITCODE
1514
}
15+
16+
# Run native unit tests (via ctest)
17+
New-Item -Path "test-build" -ItemType Directory
18+
cd "test-build"
19+
20+
cmake .. --preset Windows -DCMAKE_BUILD_TESTS=ON
21+
if ($LASTEXITCODE -ne 0) {
22+
Write-Host "CMake configuration was unsuccessful. Exit code: $LASTEXITCODE."
23+
exit $LASTEXITCODE
24+
}
25+
26+
cmake --build . -j8 --config Release
27+
if ($LASTEXITCODE -ne 0) {
28+
Write-Host "CMake build was unsuccessful. Exit code: $LASTEXITCODE."
29+
exit $LASTEXITCODE
30+
}
31+
32+
ctest -j8
33+
if ($LASTEXITCODE -ne 0) {
34+
Write-Host "CTest run was unsuccessful. Exit code: $LASTEXITCODE."
35+
exit $LASTEXITCODE
36+
}

0 commit comments

Comments
 (0)