[cmdletbinding()] param( [string]$bench = "Pagie_1" ) $OrigLog = "..\tmplog\$($bench)_CGen.log" $HLLogPath = "..\tmplog\$($bench)_HL.log" if(-not $(Test-Path -Path $OrigLog)) { Write-Error "Please create C-Log with multitest program first!" exit 2 } if(-not $(Test-Path -Path $HLLogPath)) { Write-Error "HL log is missing, please paste output to $HLLogPath" exit 1 } $i = Get-ChildItem -Path $OrigLog -Filter *.log $C = @() $HL = @() $steps = Get-Content -Path $OrigLog | Select-String -Pattern "C: push/pop" foreach($stepres in $steps) { [string]$stepres = $stepres.ToString().Trim() $eqns = ($stepres.Substring($stepres.IndexOf(")") + 1 )).Trim() $C += [string]$eqns.Replace(' ', '') } foreach($line in $(Get-Content -Path $HLLogPath)) { [string]$line = $line.ToString().Trim() $start = $line.IndexOf(")") + 1 $end = $line.IndexOf('coeff:') - $start $eq = ($line.Substring($start, $end )).Trim() $HL += [string]$eq.Replace(' ', '') } $Count = 0 $Failed = 0 for($i = 0; $i -lt $C.Count; $i++) { if($HL[$i] -ne $null) { if($C[$i] -eq $HL[$i]) { Write-Host "Match" } else { echo "$($C[$i])`t`t:`t`t$($HL[$i])" $Failed++ Write-Warning "No match" } $Count++ } } echo "`n***********************************************************" echo "$Failed / $Count Failed!"