(t *testing.T)
| 247 | } |
| 248 | |
| 249 | func TestFetchWithBase(t *testing.T) { |
| 250 | baseConfig := currentConfig() |
| 251 | defer setCurrentConfig(baseConfig) |
| 252 | |
| 253 | type WantSample struct { |
| 254 | values []int64 |
| 255 | labels map[string][]string |
| 256 | } |
| 257 | |
| 258 | const path = "testdata/" |
| 259 | type testcase struct { |
| 260 | desc string |
| 261 | sources []string |
| 262 | bases []string |
| 263 | diffBases []string |
| 264 | normalize bool |
| 265 | wantSamples []WantSample |
| 266 | wantParseErrorMsg string |
| 267 | wantFetchErrorMsg string |
| 268 | } |
| 269 | |
| 270 | testcases := []testcase{ |
| 271 | { |
| 272 | "not normalized base is same as source", |
| 273 | []string{path + "cppbench.contention"}, |
| 274 | []string{path + "cppbench.contention"}, |
| 275 | nil, |
| 276 | false, |
| 277 | nil, |
| 278 | "", |
| 279 | "", |
| 280 | }, |
| 281 | { |
| 282 | "not normalized base is same as source", |
| 283 | []string{path + "cppbench.contention"}, |
| 284 | []string{path + "cppbench.contention"}, |
| 285 | nil, |
| 286 | false, |
| 287 | nil, |
| 288 | "", |
| 289 | "", |
| 290 | }, |
| 291 | { |
| 292 | "not normalized single source, multiple base (all profiles same)", |
| 293 | []string{path + "cppbench.contention"}, |
| 294 | []string{path + "cppbench.contention", path + "cppbench.contention"}, |
| 295 | nil, |
| 296 | false, |
| 297 | []WantSample{ |
| 298 | { |
| 299 | values: []int64{-2700, -608881724}, |
| 300 | labels: map[string][]string{}, |
| 301 | }, |
| 302 | { |
| 303 | values: []int64{-100, -23992}, |
| 304 | labels: map[string][]string{}, |
| 305 | }, |
| 306 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…