blob: 937a2dcc84190331dcb411431192a97c7d6d43f5 [file] [log] [blame]
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package testtrace
import (
"runtime"
"testing"
)
// MustHaveSyscallEvents skips the current test if the current
// platform does not support true system call events.
func MustHaveSyscallEvents(t *testing.T) {
if HasSyscallEvents() {
return
}
t.Skip("current platform has no true syscall events")
}
// HasSyscallEvents returns true if the current platform
// has real syscall events available.
func HasSyscallEvents() bool {
switch runtime.GOOS {
case "js", "wasip1":
// js and wasip1 emulate system calls by blocking on channels
// while yielding back to the environment. They never actually
// call entersyscall/exitsyscall.
return false
}
return true
}