Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/scripts/CompareHL.ps1 @ 17328

Last change on this file since 17328 was 16620, checked in by hmaislin, 6 years ago

#2929: Reorganized folder structure for make script, removed explicit marshalling, erased go-side logging

File size: 1.3 KB
Line 
1[cmdletbinding()]
2param(
3  [string]$bench = "Pagie_1"
4)
5
6$OrigLog = "..\tmplog\$($bench)_CGen.log"
7$HLLogPath = "..\tmplog\$($bench)_HL.log"
8
9if(-not $(Test-Path -Path $OrigLog)) {
10  Write-Error "Please create C-Log with multitest program first!"
11  exit 2
12}
13
14if(-not $(Test-Path -Path $HLLogPath)) {
15  Write-Error "HL log is missing, please paste output to $HLLogPath"
16  exit 1
17}
18
19$i = Get-ChildItem -Path $OrigLog -Filter *.log
20
21$C = @()
22$HL = @()
23
24$steps = Get-Content -Path $OrigLog | Select-String -Pattern "C: push/pop"
25
26foreach($stepres in $steps) {
27  [string]$stepres = $stepres.ToString().Trim()
28  $eqns = ($stepres.Substring($stepres.IndexOf(")") + 1 )).Trim()
29  $C += [string]$eqns.Replace(' ', '')
30}
31
32foreach($line in $(Get-Content -Path $HLLogPath)) {
33  [string]$line = $line.ToString().Trim()
34  $start = $line.IndexOf(")") + 1
35  $end = $line.IndexOf('coeff:') - $start
36  $eq = ($line.Substring($start, $end )).Trim()
37  $HL += [string]$eq.Replace(' ', '')
38}
39
40$Count = 0
41$Failed = 0
42for($i = 0; $i -lt $C.Count; $i++) {
43  if($HL[$i] -ne $null) {
44    if($C[$i] -eq $HL[$i]) {
45      Write-Host "Match"
46    } else {
47      echo "$($C[$i])`t`t:`t`t$($HL[$i])"
48      $Failed++
49      Write-Warning "No match"
50    }
51    $Count++
52  }
53}
54
55echo "`n***********************************************************"
56echo "$Failed / $Count Failed!"
Note: See TracBrowser for help on using the repository browser.