appveyour next fix (#373)

This commit is contained in:
Oleg Moiseenko 2019-08-29 19:21:51 +03:00 committed by GitHub
commit 0a81a72758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,12 +73,13 @@ clone_script:
Write-Host "[ OK ]" -ForegroundColor Green Write-Host "[ OK ]" -ForegroundColor Green
Write-Host "Update msys2 packages..." -NoNewLine Write-Host "Update msys2 packages..."
$env:Path = "C:\ProxSpace\msys2\usr\bin;C:\ProxSpace\msys2\mingw32\bin;C:\ProxSpace\gcc-arm-none-eabi\bin;$env:Path" $env:Path = "C:\ProxSpace\msys2\usr\bin;C:\ProxSpace\msys2\mingw32\bin;C:\ProxSpace\gcc-arm-none-eabi\bin;$env:Path"
Function ExecUpdate($Name, $Cmd, $ErrorLine) { Function ExecUpdate($Name, $Cmd, $ErrorLine) {
Write-Host "Exec [$Name]... " -NoNewLine
#--- begin Job #--- begin Job
$Job = Start-Job -Name "$Name" -ScriptBlock { $Job = Start-Job -Name "$Name" -ScriptBlock {
@ -96,10 +97,16 @@ clone_script:
$JobTime=[System.Environment]::TickCount $JobTime=[System.Environment]::TickCount
while($true) { while($true) {
Receive-Job -Job $Job -Keep -OutVariable Res 2>&1 6>&1 | Out-Null Try {
$Res = Receive-Job -Job $Job -Keep 2>&1 6>&1
}
Catch {
$Res = ""
Write-host "error in Receive-Job"
}
if ($Res -is "String" -and $Res -like "*$ErrorLine*"){ if ($Res -is "String" -and $Res -like "*$ErrorLine*"){
Write-host "Exit by stop phrase" Write-host "Exit by stop phrase" -ForegroundColor Green
break break
} }
@ -107,7 +114,7 @@ clone_script:
[bool]$needexit = $false [bool]$needexit = $false
ForEach($line in $Res){ ForEach($line in $Res){
if ($line -like "*$ErrorLine*"){ if ($line -like "*$ErrorLine*"){
Write-host "Exit by stop phrase [obj]" Write-host "Exit by stop phrase [obj]" -ForegroundColor Green
$needexit = $true $needexit = $true
break break
} }
@ -118,12 +125,12 @@ clone_script:
} }
if(Wait-Job $Job -Timeout 5){ if(Wait-Job $Job -Timeout 5){
Write-host "Exit by end job" Write-host "Exit by end job" -ForegroundColor Green
break break
} }
if ([System.Environment]::TickCount-$JobTime -gt 600000) { if ([System.Environment]::TickCount-$JobTime -gt 1000000) {
Write-host "Exit by timeout" Write-host "Exit by timeout" -ForegroundColor Yellow
break break
} }
} }
@ -135,6 +142,7 @@ clone_script:
ExecUpdate "update2" "C:\ProxSpace\msys2\msys2_shell.cmd -mingw32 -defterm -no-start /dev/null" "terminate?MSYS2" ExecUpdate "update2" "C:\ProxSpace\msys2\msys2_shell.cmd -mingw32 -defterm -no-start /dev/null" "terminate?MSYS2"
Write-Host "Update " -NoNewLine
Write-Host "[ OK ]" -ForegroundColor Green Write-Host "[ OK ]" -ForegroundColor Green
install: install:
- ps: >- - ps: >-
@ -341,6 +349,7 @@ test_script:
Remove-Job -Force $Job Remove-Job -Force $Job
if(!$res){ if(!$res){
Write-host "--------------------- tests fail" -ForegroundColor Red
$global:TestsPassed=$false $global:TestsPassed=$false
} }
} }
@ -364,11 +373,11 @@ test_script:
#proxmark logic tests #proxmark logic tests
ExecTest "proxmark help" "proxmark3 -h" {bash -lc 'cd ~/client;./proxmark3 -h | grep -q wait && echo Passed || echo Failed'} ExecTest "proxmark help" "proxmark3 -h" {bash -lc 'cd ~/client;./proxmark3 -h | grep -q wait && echo passed || echo failed'}
ExecTest "proxmark help text ISO7816" "proxmark3 -t" {bash -lc 'cd ~/client;./proxmark3 -t 2>&1 | grep -q ISO7816 && echo Passed || echo Failed'} ExecTest "proxmark help text ISO7816" "proxmark3 -t" {bash -lc 'cd ~/client;./proxmark3 -t | grep -q ISO7816 && echo passed || echo failed'}
ExecTest "proxmark help text hardnested" "proxmark3 -t" {bash -lc 'cd ~/client;./proxmark3 -t 2>&1 | grep -q hardnested && echo Passed || echo Failed'} ExecTest "proxmark help text hardnested" "proxmark3 -t" {bash -lc 'cd ~/client;./proxmark3 -t | grep -q hardnested && echo passed || echo failed'}
ExecTest "hf mf offline text" "hf mf" {bash -lc "cd ~/client;./proxmark3 -c 'hf mf'"} "at_enc" ExecTest "hf mf offline text" "hf mf" {bash -lc "cd ~/client;./proxmark3 -c 'hf mf'"} "at_enc"