coverage

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CoverageFlags = []cli.Flag{
	&cli.StringFlag{
		Name:     "coverageTrapDir",
		Category: "coverage",
		Usage:    "Will write cover information to the dir whenever the program receives SIGUSR1. Use -cover -covermode=atomic to compile the program.",
		Action: func(context *cli.Context, s string) error {
			if s != "" {

				err := coverage.ClearCounters()
				if err != nil {
					return eh.Errorf("program does not seem to be to be built with -cover -covermode=count flags (no cover support)")
				}
				sig := syscall.SIGUSR1
				collector := NewCollector()
				err = collector.SetupSignalTrap(path.Join(s, "counters"), path.Join(s, "meta"), sig)
				if err != nil {
					return eh.Errorf("unable to setup signal trap: %w", err)
				}
				log.Info().Str("directory", s).Stringer("signal", sig).Msg("successfully setup signal trap for writing cover information")
			}
			return nil
		},
	},
}
View Source
var PackageProps = packageprops.Props{
	WASMWASI:         packageprops.WASMBlocked,
	WASMJS:           packageprops.WASMBlocked,
	WASMFreestanding: packageprops.WASMBlocked,
}

PackageProps records this package's curated properties (ADR-0080). Seeded by `wasmsurvey props generate`; curate by hand, then `wasmsurvey props verify`.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector() *Collector

func (*Collector) SetupSignalTrap

func (inst *Collector) SetupSignalTrap(countersDir string, metaDir string, sig os.Signal) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL