-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
44 lines (39 loc) · 926 Bytes
/
main.go
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
package main
import (
"github.com/ed-fx/go-soft4fx/internal/path"
"github.com/ed-fx/go-soft4fx/internal/simulator"
"github.com/ed-fx/go-soft4fx/internal/simulator/analyze"
"github.com/ed-fx/go-soft4fx/internal/simulator/analyze/export"
"github.com/ed-fx/go-soft4fx/internal/simulator/parser"
"log"
)
func main() {
htmlFiles := path.ResultHtmlFiles()
if len(htmlFiles) == 0 {
log.Println("No soft4fx result files found")
return
}
sims := parse(htmlFiles)
results, err := analyze.Analyze(sims)
if err != nil {
log.Fatal(err)
}
err = export.AggregateResult(results)
if err != nil {
log.Fatal(err)
}
}
func parse(htmlFiles []string) (sims []*simulator.Simulator) {
sims = make([]*simulator.Simulator, len(htmlFiles))
var i = 0
for _, htmlFile := range htmlFiles {
if sim, err := parser.Parse(htmlFile); err != nil {
log.Fatal(err)
return
} else {
sims[i] = sim
i++
}
}
return
}