Database

Database wrapper with minimal dependencies.

struct Database {}

Alias This

db

Members

Aliases

aliveMutants
alias aliveMutants = countMutants!([Mutation.Status.alive], false)
Undocumented in source.
aliveNoMutSrcMutants
alias aliveNoMutSrcMutants = countNoMutMutants!([Mutation.Status.alive], true)

Count the mutants with the nomut metadata.

aliveSrcMutants
alias aliveSrcMutants = countMutants!([Mutation.Status.alive], true)
Undocumented in source.
killedByCompilerMutants
alias killedByCompilerMutants = countMutants!([Mutation.Status.killedByCompiler], false)
Undocumented in source.
killedByCompilerSrcMutants
alias killedByCompilerSrcMutants = countMutants!([Mutation.Status.killedByCompiler], true)
Undocumented in source.
killedMutants
alias killedMutants = countMutants!([Mutation.Status.killed], false)
Undocumented in source.
killedSrcMutants
alias killedSrcMutants = countMutants!([Mutation.Status.killed], true)
Undocumented in source.
testCaseMutationPointAliveSrcMutants
alias testCaseMutationPointAliveSrcMutants = testCaseCountSrcMutants!([Mutation.Status.alive])
testCaseMutationPointKilledByCompilerSrcMutants
alias testCaseMutationPointKilledByCompilerSrcMutants = testCaseCountSrcMutants!([Mutation.Status.killedByCompiler])
testCaseMutationPointKilledSrcMutants
alias testCaseMutationPointKilledSrcMutants = testCaseCountSrcMutants!([Mutation.Status.killed])
testCaseMutationPointTimeoutSrcMutants
alias testCaseMutationPointTimeoutSrcMutants = testCaseCountSrcMutants!([Mutation.Status.timeout])
testCaseMutationPointTotalSrcMutants
alias testCaseMutationPointTotalSrcMutants = testCaseCountSrcMutants!([Mutation.Status.alive, Mutation.Status.killed, Mutation.Status.timeout])
testCaseMutationPointUnknownSrcMutants
alias testCaseMutationPointUnknownSrcMutants = testCaseCountSrcMutants!([Mutation.Status.unknown])
timeoutMutants
alias timeoutMutants = countMutants!([Mutation.Status.timeout], false)
Undocumented in source.
timeoutSrcMutants
alias timeoutSrcMutants = countMutants!([Mutation.Status.timeout], true)
Undocumented in source.
totalMutants
alias totalMutants = countMutants!([Mutation.Status.alive, Mutation.Status.killed, Mutation.Status.timeout], false)
totalSrcMutants
alias totalSrcMutants = countMutants!([Mutation.Status.alive, Mutation.Status.killed, Mutation.Status.timeout], true)
unknownMutants
alias unknownMutants = countMutants!([Mutation.Status.unknown], false)
Undocumented in source.
unknownSrcMutants
alias unknownSrcMutants = countMutants!([Mutation.Status.unknown], true)
Undocumented in source.

Enums

CntAction
enum CntAction
Undocumented in source.

Functions

addDetectedTestCases
void addDetectedTestCases(const(TestCase)[] tcs)

Add test cases to those that have been detected.

clearMutantTimeoutWorklist
void clearMutantTimeoutWorklist()

Remove all mutants from the worklist.

countMutantTimeoutWorklist
long countMutantTimeoutWorklist()
exists
bool exists(MutationStatusId status_id)
Undocumented in source. Be warned that the author may not have intended to support it.
getAllMutationStatus
MutationStatusId[] getAllMutationStatus()
getAllTestCaseInfo2
TestCaseInfo2[] getAllTestCaseInfo2(FileId file, Mutation.Kind[] kinds)
getDetectedTestCaseIds
TestCaseId[] getDetectedTestCaseIds()
getDetectedTestCases
TestCase[] getDetectedTestCases()
getFile
Nullable!Path getFile(FileId id)
getFileId
Nullable!FileId getFileId(Path p)
Undocumented in source. Be warned that the author may not have intended to support it.
getFileId
Nullable!FileId getFileId(MutationId id)
getFiles
Path[] getFiles()
getHardestToKillMutant
MutationStatus[] getHardestToKillMutant(const(Mutation.Kind)[] kinds, Mutation.Status status, long nr)
getKind
Mutation.Kind getKind(MutationId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getLineMetadata
LineMetadata getLineMetadata(FileId fid, SourceLoc sloc)
Undocumented in source. Be warned that the author may not have intended to support it.
getLostMarkings
MarkedMutant[] getLostMarkings()
Undocumented in source. Be warned that the author may not have intended to support it.
getMarkedMutants
MarkedMutant[] getMarkedMutants()
Undocumented in source. Be warned that the author may not have intended to support it.
getMutantTimeoutCtx
MutantTimeoutCtx getMutantTimeoutCtx()
getMutantationMetaData
MutantMetaData getMutantationMetaData(MutationId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getMutantationMetaData
MutantMetaData[] getMutantationMetaData(Mutation.Kind[] kinds, Mutation.Status status)
Undocumented in source. Be warned that the author may not have intended to support it.
getMutantsInfo
MutantInfo[] getMutantsInfo(Mutation.Kind[] kinds, const(MutationStatusId)[] id)
getMutation
Nullable!MutationEntry getMutation(MutationId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getMutationIds
MutationId[] getMutationIds(const(Mutation.Kind)[] kinds, const(MutationStatusId)[] id)
getMutationStatus
Nullable!(Mutation.Status) getMutationStatus(MutationStatusId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getMutationStatus
Nullable!Mutation.Status getMutationStatus(MutationId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getMutationStatusId
Nullable!MutationStatusId getMutationStatusId(MutationId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getMutationsOnLine
MutationStatusId[] getMutationsOnLine(const(Mutation.Kind)[] kinds, FileId fid, SourceLoc sloc)
getNumOfTestCases
long getNumOfTestCases()
getOldestMutants
MutationStatusTime[] getOldestMutants(const(Mutation.Kind)[] kinds, long nr)
getPath
Nullable!Path getPath(MutationId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getSourceLocation
Nullable!SourceLoc getSourceLocation(MutationId id)

Get SourceLoc for a specific mutation id.

getSurroundingTestCases
TestCase[] getSurroundingTestCases(MutationId id)
getTestCase
Nullable!TestCase getTestCase(TestCaseId id)
getTestCaseId
Nullable!TestCaseId getTestCaseId(TestCase tc)
getTestCaseInfo
Nullable!TestCaseInfo getTestCaseInfo(TestCase tc, Mutation.Kind[] kinds)
getTestCaseMutantKills
MutationId[] getTestCaseMutantKills(TestCaseId id, Mutation.Kind[] kinds)

The mutation ids are guaranteed to be sorted.

getTestCaseName
string getTestCaseName(TestCaseId id)
getTestCases
TestCase[] getTestCases(MutationId id)
getTestCasesWithAtLeastOneKill
TestCaseId[] getTestCasesWithAtLeastOneKill(Mutation.Kind[] kinds)

Guarantees that the there are no duplications of TestCaseId.

getTestCasesWithZeroKills
TestCase[] getTestCasesWithZeroKills()
isAnalyzed
bool isAnalyzed(Path p)

If the file has already been analyzed.

isAnalyzed
bool isAnalyzed(Path p, Checksum cs)

If the file has already been analyzed.

isMarked
bool isMarked(MutationId id)
Undocumented in source. Be warned that the author may not have intended to support it.
markMutant
void markMutant(MutationEntry m, MutationStatusId st_id, Mutation.Status s, string r, string txt)

Mark a mutant with status and rationale (also adds metadata).

put
void put(Path p, Checksum cs, Language lang)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(LineMetadata[] mdata)

Save line metadata to the database which is used to associate line metadata with mutants.

put
void put(MutationPointEntry2[] mps, AbsolutePath rel_dir)

Store all found mutants.

putMutantInTimeoutWorklist
void putMutantInTimeoutWorklist(MutationStatusId id)
Undocumented in source. Be warned that the author may not have intended to support it.
putMutantTimeoutCtx
void putMutantTimeoutCtx(MutantTimeoutCtx ctx)
Undocumented in source. Be warned that the author may not have intended to support it.
reduceMutantTimeoutWorklist
void reduceMutantTimeoutWorklist()

Remove all mutants that are in the worklist that do NOT have the mutation status timeout.

removeAllFiles
void removeAllFiles()

Remove all mutants points from the database.

removeAllMutationPoints
void removeAllMutationPoints()

Remove all mutants points from the database.

removeFile
void removeFile(Path p)

Remove the file with all mutations that are coupled to it.

removeMarkedMutant
void removeMarkedMutant(MutationStatusId st_id)
Undocumented in source. Be warned that the author may not have intended to support it.
removeMutant
void removeMutant(Mutation.Kind[] kinds)

Remove all mutations of kinds.

removeOrphanedMutants
void removeOrphanedMutants()

Remove mutants that have no connection to a mutation point, orphened mutants.

removeTestCase
void removeTestCase(Regex!char rex, const(Mutation.Kind)[] kinds)
Undocumented in source. Be warned that the author may not have intended to support it.
resetMutant
void resetMutant(Mutation.Kind[] kinds, Mutation.Status st, Mutation.Status to_st)

Reset all mutations of kinds with the status st to unknown.

resetMutantTimeoutWorklist
void resetMutantTimeoutWorklist()

Changes the status of mutants in the timeout worklist to unknown.

setDetectedTestCases
MutationStatusId[] setDetectedTestCases(const(TestCase)[] tcs)

Set detected test cases.

testCaseKilledSrcMutants
MutationStatusId[] testCaseKilledSrcMutants(Mutation.Kind[] kinds, TestCase tc)
updateMutation
void updateMutation(MutationId id, Mutation.Status st, Duration d, const(TestCase)[] tcs, CntAction counter)

Update the status of a mutant.

updateMutation
void updateMutation(MutationStatusId id, CntAction counter)

Update the counter of how many times the mutants has been alive.

updateMutation
void updateMutation(MutationStatusId id, Duration testTime)

Update the time used to test the mutant.

updateMutationStatus
void updateMutationStatus(MutationStatusId id, Mutation.Status st, Flag!"updateTs" update_ts)

Update the status of a mutant.

updateMutationTestCases
void updateMutationTestCases(MutationId id, const(TestCase)[] tcs)

Add a link between the mutation and what test case killed it.

updateMutationTestCases
void updateMutationTestCases(MutationStatusId st_id, const(TestCase)[] tcs)

Add a link between the mutation and what test case killed it.

Static functions

make
auto make(string db)

Create a database by either opening an existing or initializing a new.

Variables

db
Miniorm db;
Undocumented in source.

Meta