-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ps1
More file actions
69 lines (57 loc) · 1.73 KB
/
test.ps1
File metadata and controls
69 lines (57 loc) · 1.73 KB
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
# ===== test.ps1 =====
# Simple test runner for Meowstro
Write-Host "Running Meowstro Tests..." -ForegroundColor Cyan
# Build the project first (including tests)
Write-Host "Building project..." -ForegroundColor Yellow
cmake --build build --config Debug
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed! Cannot run tests." -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "Running tests with detailed output..." -ForegroundColor Green
# Find and run the test executable
$testExecutablePaths = @(
".\build\bin\Debug\meowstro_tests.exe",
".\build\bin\Debug\meowstro_tests",
".\build\bin\meowstro_tests.exe",
".\build\bin\meowstro_tests"
)
$testExecutable = $null
foreach ($path in $testExecutablePaths) {
if (Test-Path $path) {
$testExecutable = $path
break
}
}
if (-not $testExecutable) {
Write-Host "Test executable not found!" -ForegroundColor Red
Write-Host "Searched for:" -ForegroundColor Red
foreach ($path in $testExecutablePaths) {
Write-Host " - $path" -ForegroundColor Red
}
exit 1
}
Write-Host "Running: $testExecutable" -ForegroundColor Green
& $testExecutable
$testResult = $LASTEXITCODE
Write-Host ""
if ($testResult -eq 0) {
Write-Host "All tests passed!" -ForegroundColor Green
# Also show CTest summary
Write-Host ""
Write-Host "CTest Summary:" -ForegroundColor Cyan
Push-Location build
ctest --output-on-failure -C Debug
$ctestResult = $LASTEXITCODE
Pop-Location
if ($ctestResult -ne 0) {
Write-Host "CTest failed!" -ForegroundColor Red
exit 1
}
} else {
Write-Host "Some tests failed!" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "Testing complete!" -ForegroundColor Magenta