File size: 837 Bytes
13c2bf6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | // 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
}
|