package testtrace
import "internal/trace/testtrace"
Index ¶
- func Dump(t *testing.T, testName string, traceBytes []byte, forceToFile bool)
- func HasSyscallEvents() bool
- func MustHaveSyscallEvents(t *testing.T)
- type Expectation
- func ExpectSuccess() *Expectation
- func ParseExpectation(data []byte) (*Expectation, error)
- func ParseFile(testPath string) (io.Reader, version.Version, *Expectation, error)
- func (e *Expectation) Check(err error) error
- type Validator
Functions ¶
func Dump ¶
Dump saves the trace to a file or the test log.
func HasSyscallEvents ¶
func HasSyscallEvents() bool
HasSyscallEvents returns true if the current platform has real syscall events available.
func MustHaveSyscallEvents ¶
MustHaveSyscallEvents skips the current test if the current platform does not support true system call events.
Types ¶
type Expectation ¶
type Expectation struct {
// contains filtered or unexported fields
}
Expectation represents the expected result of some operation.
func ExpectSuccess ¶
func ExpectSuccess() *Expectation
ExpectSuccess returns an Expectation that trivially expects success.
func ParseExpectation ¶
func ParseExpectation(data []byte) (*Expectation, error)
ParseExpectation parses the serialized form of an Expectation.
func ParseFile ¶
ParseFile parses a test file generated by the testgen package.
func (*Expectation) Check ¶
func (e *Expectation) Check(err error) error
Check validates whether err conforms to the expectation. Returns an error if it does not conform.
Conformance means that if failure is true, then err must be non-nil. If err is non-nil, then it must match errorMatcher.
type Validator ¶
Validator is a type used for validating a stream of trace.Events.
func NewValidator ¶
func NewValidator() *Validator
NewValidator creates a new Validator.
func (*Validator) Event ¶
Event validates ev as the next event in a stream of trace.Events.
Returns an error if validation fails.
func (*Validator) SkipClockSnapshotChecks ¶
func (v *Validator) SkipClockSnapshotChecks()
SkipClockSnapshotChecks causes the validator to skip checks on the clock snapshots.
Some platforms like Windows, with a small enough trace period, are unable to produce monotonically increasing timestamps due to very coarse clock granularity.
Source Files ¶
expectation.go format.go helpers.go platforms.go validation.go
- Version
- v1.26.0-rc.2
- Published
- Jan 8, 2026
- Platform
- js/wasm
- Imports
- 17 packages
- Last checked
- 4 seconds ago –
Tools for package owners.