testutil

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FossilArtifactByPath

func FossilArtifactByPath(repoPath, uuid string) ([]byte, error)

func FossilBinary

func FossilBinary() string

FossilBinary resolves the canonical fossil binary: the FOSSIL_BIN override first, then PATH. An override that does not resolve to an executable is treated as no binary at all, so the caller reports "fossil not found" rather than letting a stale path surface later as a raw fork/exec error.

func FossilRebuild

func FossilRebuild(repoPath string) error

func FossilTimeline

func FossilTimeline(repoPath string) ([]byte, error)

func RequireFossilBin

func RequireFossilBin(t *testing.T) string

RequireFossilBin resolves the fossil binary for tests that need canonical Fossil to run. It resolves the same way FossilBinary does (the FOSSIL_BIN override, then PATH). When no binary is found it skips the test, unless REQUIRE_FOSSIL_BIN=1 is set -- then it fails. That makes CI turn a missing binary into a loud failure (verifying real Fossil reads what we write is the one thing our own tests cannot substitute for) while local runs without fossil installed stay an opt-in skip.

Types

type TestRepo

type TestRepo struct {
	Path string
	Dir  string
}

func NewTestRepo

func NewTestRepo(t *testing.T) *TestRepo

func NewTestRepoFromPath

func NewTestRepoFromPath(t *testing.T, path string) *TestRepo

func (*TestRepo) FossilArtifact

func (r *TestRepo) FossilArtifact(t *testing.T, uuid string) []byte

func (*TestRepo) FossilRebuild

func (r *TestRepo) FossilRebuild(t *testing.T)

func (*TestRepo) FossilSQL

func (r *TestRepo) FossilSQL(t *testing.T, sql string) string

Jump to

Keyboard shortcuts

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