diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2016-03-18 00:30:39 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2016-03-18 14:16:04 +0000 |
commit | 4f7931b473ecbb96dc6724992c62518a3152265b (patch) | |
tree | a74a60f0826866d6a1a36df2f79ca78ea95c9b1c /src | |
parent | c39a230969dc79bbd20eec5e19642eb8886ef9c0 (diff) | |
download | qtqa-4f7931b473ecbb96dc6724992c62518a3152265b.tar.gz |
qtestcompare: Move individual test comparisons into a function.
In preparation for handling zips from benchmarkrunner.
Change-Id: I9916c9cf87d85675074b25fb0b88c75538558f0b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qtestcompare/main.go | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/qtestcompare/main.go b/src/qtestcompare/main.go index 7531d5a..cb49330 100644 --- a/src/qtestcompare/main.go +++ b/src/qtestcompare/main.go @@ -90,24 +90,7 @@ func describeChange(pChange float64) string { } } -func main() { - var nf = flag.String("new", "", "the changed XML result to compare against") - var of = flag.String("old", "", "the baseline XML result to compare against") - flag.Parse() - - nxml := *nf - oxml := *of - - if len(nxml) == 0 { - log.Fatalf("no new provided - nothing to compare") - return - } - - if len(oxml) == 0 { - log.Fatalf("no old provided - nothing to compare against") - return - } - +func compareSingleTestRuns(oxml string, nxml string) { oldTest := loadTestResult(oxml) newTest := loadTestResult(nxml) @@ -219,5 +202,25 @@ func main() { table.SetFooter([]string{newTest.Name, "", "", verdict}) table.Render() +} + +func main() { + var nf = flag.String("new", "", "the changed XML result to compare against") + var of = flag.String("old", "", "the baseline XML result to compare against") + flag.Parse() + + nxml := *nf + oxml := *of + + if len(nxml) == 0 { + log.Fatalf("no new provided - nothing to compare") + return + } + + if len(oxml) == 0 { + log.Fatalf("no old provided - nothing to compare against") + return + } + compareSingleTestRuns(oxml, nxml) } |