(t *testing.T)
| 28 | ) |
| 29 | |
| 30 | func TestWebList(t *testing.T) { |
| 31 | if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" { |
| 32 | t.Skip("weblist only tested on x86-64 linux") |
| 33 | } |
| 34 | |
| 35 | cpu := readProfile(filepath.Join("testdata", "sample.cpu"), t) |
| 36 | rpt := New(cpu, &Options{ |
| 37 | OutputFormat: WebList, |
| 38 | Symbol: regexp.MustCompile("busyLoop"), |
| 39 | SampleValue: func(v []int64) int64 { return v[1] }, |
| 40 | SampleUnit: cpu.SampleType[1].Unit, |
| 41 | }) |
| 42 | result, err := MakeWebList(rpt, &binutils.Binutils{}, -1) |
| 43 | if err != nil { |
| 44 | t.Fatalf("could not generate weblist: %v", err) |
| 45 | } |
| 46 | output := fmt.Sprint(result) |
| 47 | |
| 48 | for _, expect := range []string{"func busyLoop", "call.*mapassign"} { |
| 49 | if match, _ := regexp.MatchString(expect, output); !match { |
| 50 | t.Errorf("weblist output does not contain '%s':\n%s", expect, output) |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | func TestSourceSyntheticAddress(t *testing.T) { |
| 56 | testSourceMapping(t, true) |
nothing calls this directly
no test coverage detected
searching dependent graphs…