workdir

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package workdir manages temporary working directories for isolated mutation testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedDealer

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

CachedDealer is the implementation of the Dealer interface, responsible for creating a working directory of a source directory. It allows Gremlins not to work in the actual source directory messing up with the source code files.

func NewCachedDealer

func NewCachedDealer(workDir, srcDir string) *CachedDealer

NewCachedDealer instantiates a new Dealer that keeps a cache of the instantiated folders. Every time a new working directory is requested with the same identifier, the same folder reference is returned.

func (*CachedDealer) Clean

func (cd *CachedDealer) Clean()

Clean frees all the cached folders and removes all of them from disk.

func (*CachedDealer) Get

func (cd *CachedDealer) Get(idf string) (string, error)

Get provides a working directory where all the files are full copies to the original files in the source directory.

func (*CachedDealer) WorkDir added in v0.5.0

func (cd *CachedDealer) WorkDir() string

WorkDir provides the root working directory.

type Dealer

type Dealer interface {
	Get(idf string) (string, error)
	Clean()
	WorkDir() string
}

Dealer is the responsible for creating and returning the reference to a workdir to use during mutation testing instead of the actual source code.

It has two methods:

	Get that returns a folder name that will be used by Gremlins as workdir.
    Clean that must be called to remove all the created folders.

Jump to

Keyboard shortcuts

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