forked from Stellar-Teye/Teye-Contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_all_tests.ps1
More file actions
92 lines (79 loc) · 2.56 KB
/
Copy pathverify_all_tests.ps1
File metadata and controls
92 lines (79 loc) · 2.56 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Comprehensive Test Verification Script (PowerShell)
# Verifies all packages affected by zk_verifier export fixes
$ErrorActionPreference = "Continue"
function Print-Success {
param($Message)
Write-Host "✓ $Message" -ForegroundColor Green
}
function Print-Error {
param($Message)
Write-Host "✗ $Message" -ForegroundColor Red
}
function Print-Info {
param($Message)
Write-Host "ℹ $Message" -ForegroundColor Yellow
}
function Print-Header {
param($Message)
Write-Host "========================================" -ForegroundColor Cyan
Write-Host $Message -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
}
$packages = @("zk_verifier", "zk_voting", "zk_prover", "identity")
$failed = 0
Print-Header "Verifying All Test Compilations"
Write-Host ""
foreach ($package in $packages) {
Print-Info "Checking package: $package"
# Check compilation
try {
$output = cargo check -p $package --all-targets 2>&1 | Out-String
$output | Out-File -FilePath "$env:TEMP\${package}_check.log"
if ($LASTEXITCODE -eq 0) {
Print-Success "$package`: Compilation successful"
} else {
throw "Compilation failed"
}
} catch {
Print-Error "$package`: Compilation failed"
Write-Host "See $env:TEMP\${package}_check.log for details"
$failed++
}
# Run clippy
try {
$output = cargo clippy -p $package --all-targets -- -D warnings 2>&1 | Out-String
$output | Out-File -FilePath "$env:TEMP\${package}_clippy.log"
if ($LASTEXITCODE -eq 0) {
Print-Success "$package`: Clippy checks passed"
} else {
throw "Clippy failed"
}
} catch {
Print-Error "$package`: Clippy checks failed"
Write-Host "See $env:TEMP\${package}_clippy.log for details"
$failed++
}
Write-Host ""
}
Print-Header "Summary"
Write-Host ""
if ($failed -eq 0) {
Print-Success "All packages verified successfully!"
Write-Host ""
Write-Host "Packages checked:"
foreach ($package in $packages) {
Write-Host " ✓ $package"
}
Write-Host ""
Write-Host "You can now run tests with:"
Write-Host " cargo test -p zk_verifier"
Write-Host " cargo test -p zk_voting"
Write-Host " cargo test -p zk_prover"
Write-Host " cargo test -p identity"
exit 0
} else {
Print-Error "$failed package(s) failed verification"
Write-Host ""
Write-Host "Check the log files in $env:TEMP for details"
exit 1
}