-- ps: >-
- $env:Path = "C:\ProxSpace\msys\bin;$env:Path"
-
- cd c:\ProxSpace\pm3
-
-
- $global:TestsPassed=$true
-
- $global:TestTime=[System.Environment]::TickCount
-
-
- Function ExecTest($Name, $File, $Cond) {
- [bool]$res=$false;
- if ($Cond -eq $null){
- } Else {
- If (!($Cond -is [bool] -or $Cond -is [byte] -or $Cond -is [int16] -or $Cond -is [int32] -or $Cond -is [int64] -or $Cond -is [float])){
- if ($Cond -is "String" -and $Cond -like "*passed*"){
- $res= $true
- }
- if ($Cond -is "String" -and $Cond -like "*true*"){
- $res= $true
- }
- } Else {
- $res=$Cond;
- }
- }
-
- If ($res) {
- Add-AppveyorTest -Name "$Name" -Framework NUnit -Filename "$File" -Outcome Passed -Duration "$([System.Environment]::TickCount-$global:TestTime)"
- }Else {
- Add-AppveyorTest -Name "$Name" -Framework NUnit -Filename "$File" -Outcome Failed -Duration "$([System.Environment]::TickCount-$global:TestTime)"
- $global:TestsPassed=$false
- }
- $global:TestTime=[System.Environment]::TickCount
- }
-
-
- Write-Host "Running tests..." -ForegroundColor Yellow
-
-
- #file test
-
- ExecTest "proxmark3 exists" "proxmark3.exe" $(Test-Path C:\ProxSpace\Release\proxmark3.exe)
-
- ExecTest "arm image exists" "\arm\fullimage1.elf" $(Test-Path C:\ProxSpace\Release\arm\fullimage.elf)
-
- ExecTest "bootrom exists" "bootrom.elf" $(Test-Path C:\ProxSpace\Release\arm\bootrom.elf)
-
- ExecTest "hardnested tables exists" "hardnested" $(Test-Path C:\ProxSpace\Release\hardnested\tables\*.z)
-
- ExecTest "release exists" "release.zip" $(Test-Path C:\ProxSpace\release.zip)
-
-
- #proxmark logic tests
-
- ExecTest "proxmark help" "proxmark3 -h" $(bash -lc 'cd ~/client;proxmark3 -h | grep -q Execute && echo Passed || echo Failed')
-
- ExecTest "proxmark help hardnested" "proxmark3 -h" $(bash -lc 'cd ~/client;proxmark3 -h | grep -q hardnested && echo Passed || echo Failed')
-
-
- ExecTest "hf mf offline text" "hf mf" $(bash -lc "cd ~/client;proxmark3 comx -c 'hf mf' | grep -q at_enc && echo Passed || echo Failed")
-
- ExecTest "hf mf hardnested" "hf mf hardnested" $(bash -lc "cd ~/client;proxmark3 comx -c 'hf mf hardnested t 1 000000000000' | grep -q 'found:' && echo Passed || echo Failed")
-
-
- if ($global:TestsPassed) {
- Write-Host "Tests [ OK ]" -ForegroundColor Green
- } else {
- Write-Host "Tests [ ERROR ]" -ForegroundColor Red
- throw "Tests error."
- }