Skip to content

Commit

Permalink
fix stub tests
Browse files Browse the repository at this point in the history
  • Loading branch information
korniltsev committed Nov 24, 2023
1 parent b69068b commit 452f5aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 0 additions & 2 deletions godeltaprof/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func NewMutexProfiler() *BlockProfiler {
}
}

// todo document
func NewMutexProfilerWithOptions(options ProfileOptions) *BlockProfiler {
return &BlockProfiler{
runtimeProfile: runtime.MutexProfile,
Expand Down Expand Up @@ -83,7 +82,6 @@ func NewBlockProfiler() *BlockProfiler {
}
}

// todo document
func NewBlockProfilerWithOptions(options ProfileOptions) *BlockProfiler {
return &BlockProfiler{
runtimeProfile: runtime.BlockProfile,
Expand Down
12 changes: 2 additions & 10 deletions godeltaprof/compat/stub_go20_test.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
//go:build go1.20
//go:build go1.16 && !go1.21

package compat

import (
"testing"
)
import "testing"

func TestRuntimeFrameSymbolName(t *testing.T) {
checkSignature(t, "runtime/pprof",
"runtime_FrameSymbolName",
"func runtime/pprof.runtime_FrameSymbolName(f *runtime.Frame) string")
checkSignature(t, "github.com/grafana/pyroscope-go/godeltaprof/internal/pprof",
"runtime_FrameSymbolName",
"func github.com/grafana/pyroscope-go/godeltaprof/internal/pprof.runtime_FrameSymbolName(f *runtime.Frame) string")
}

func TestRuntimeFrameStartLine(t *testing.T) {
checkSignature(t, "runtime/pprof",
"runtime_FrameStartLine",
"func runtime/pprof.runtime_FrameStartLine(f *runtime.Frame) int")
checkSignature(t, "github.com/grafana/pyroscope-go/godeltaprof/internal/pprof",
"runtime_FrameStartLine",
"func github.com/grafana/pyroscope-go/godeltaprof/internal/pprof.runtime_FrameStartLine(f *runtime.Frame) int")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
//go:build go1.16 && !go1.20
//go:build go1.21

package compat

import "testing"
import (
"testing"
)

func TestRuntimeFrameSymbolName(t *testing.T) {
checkSignature(t, "runtime/pprof",
"runtime_FrameSymbolName",
"func runtime/pprof.runtime_FrameSymbolName(f *runtime.Frame) string")
checkSignature(t, "github.com/grafana/pyroscope-go/godeltaprof/internal/pprof",
"runtime_FrameSymbolName",
"func github.com/grafana/pyroscope-go/godeltaprof/internal/pprof.runtime_FrameSymbolName(f *runtime.Frame) string")
}

func TestRuntimeFrameStartLine(t *testing.T) {
checkSignature(t, "runtime/pprof",
"runtime_FrameStartLine",
"func runtime/pprof.runtime_FrameStartLine(f *runtime.Frame) int")
checkSignature(t, "github.com/grafana/pyroscope-go/godeltaprof/internal/pprof",
"runtime_FrameStartLine",
"func github.com/grafana/pyroscope-go/godeltaprof/internal/pprof.runtime_FrameStartLine(f *runtime.Frame) int")
Expand Down
1 change: 0 additions & 1 deletion godeltaprof/heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func NewHeapProfiler() *HeapProfiler {
}}
}

// todo document
func NewHeapProfilerWithOptions(options ProfileOptions) *HeapProfiler {
return &HeapProfiler{
impl: pprof.DeltaHeapProfiler{
Expand Down

0 comments on commit 452f5aa

Please sign in to comment.