summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-03-21 15:54:08 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-03-21 15:51:25 +0000
commit7c7310a7e6b35591e64e6c978a179b5846296ee8 (patch)
tree57b6ccf45c719022b3662c770a29084e93741ffb /src
parent81361d72d69c64e625e68509b36df6a4018207af (diff)
Fix tag handling in benchmark results
If we don't respect the tags, we may end up mixing results from different tags. Change-Id: I0bfb9b7d685372e1c2ffbb694c4aae08612705e4 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src')
-rw-r--r--src/qtestcompare/main.go20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/qtestcompare/main.go b/src/qtestcompare/main.go
index 27d5b08c..b1e9a17d 100644
--- a/src/qtestcompare/main.go
+++ b/src/qtestcompare/main.go
@@ -101,14 +101,18 @@ func (results *MergedTestResults) addOldTestCase(prefix string, testCase *goqtes
for _, fn := range testCase.Functions {
qualifiedName := prefix + fn.Name
for _, br := range fn.BenchmarkResults {
- res := (*results)[qualifiedName]
- res.Name = qualifiedName
+ nameWithTag := qualifiedName
+ if br.Tag != "" {
+ nameWithTag += ":" + br.Tag
+ }
+ res := (*results)[nameWithTag]
+ res.Name = nameWithTag
if br.Metric == "WalltimeMilliseconds" {
res.OldDuration = &(br.Value)
} else if br.Metric == "InstructionReads" {
res.OldInstructionReads = &(br.Value)
}
- (*results)[qualifiedName] = res
+ (*results)[nameWithTag] = res
}
}
}
@@ -117,14 +121,18 @@ func (results *MergedTestResults) addNewTestCase(prefix string, testCase *goqtes
for _, fn := range testCase.Functions {
qualifiedName := prefix + fn.Name
for _, br := range fn.BenchmarkResults {
- res := (*results)[qualifiedName]
- res.Name = qualifiedName
+ nameWithTag := qualifiedName
+ if br.Tag != "" {
+ nameWithTag += ":" + br.Tag
+ }
+ res := (*results)[nameWithTag]
+ res.Name = nameWithTag
if br.Metric == "WalltimeMilliseconds" {
res.NewDuration = &(br.Value)
} else if br.Metric == "InstructionReads" {
res.NewInstructionReads = &(br.Value)
}
- (*results)[qualifiedName] = res
+ (*results)[nameWithTag] = res
}
}
}