Database

Database wrapper with minimal dependencies.

struct Database {}

Alias This

db

Members

Aliases

aliveNoMutSrcMutants
alias aliveNoMutSrcMutants = countNoMutMutants!([Mutation.Status.alive], true)

Count the mutants with the nomut metadata.

aliveSrcMutants
alias aliveSrcMutants = countMutants!([Mutation.Status.alive, Mutation.Status.noCoverage])
Undocumented in source.
equivalentMutants
alias equivalentMutants = countMutants!([Mutation.Status.equivalent])
Undocumented in source.
killedByCompilerSrcMutants
alias killedByCompilerSrcMutants = countMutants!([Mutation.Status.killedByCompiler])
Undocumented in source.
killedSrcMutants
alias killedSrcMutants = countMutants!([Mutation.Status.killed])
Undocumented in source.
noCovSrcMutants
alias noCovSrcMutants = countMutants!([Mutation.Status.noCoverage])
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])
timeoutSrcMutants
alias timeoutSrcMutants = countMutants!([Mutation.Status.timeout])
Undocumented in source.
totalSrcMutants
alias totalSrcMutants = countMutants!([Mutation.Status.alive, Mutation.Status.killed, Mutation.Status.timeout, Mutation.Status.noCoverage])
unknownSrcMutants
alias unknownSrcMutants = countMutants!([Mutation.Status.unknown])
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.

addToWorklist
void addToWorklist(MutationStatusId id, long basePrio, MutationOrder userOrder)

Add a mutant to the worklist.

clearCoverageMap
void clearCoverageMap(FileId id)
Undocumented in source. Be warned that the author may not have intended to support it.
clearMetadata
void clearMetadata()

Remove all metadata.

clearMutantTimeoutWorklist
void clearMutantTimeoutWorklist()

Remove all mutants from the worklist.

clearWorklist
void clearWorklist()
Undocumented in source. Be warned that the author may not have intended to support it.
copyMutantTimeoutWorklist
void copyMutantTimeoutWorklist(long prio)

Copy the timeout mutants to the worklist of mutants to test.

countMutantTimeoutWorklist
long countMutantTimeoutWorklist()
deleteAllSchemas
void deleteAllSchemas()

Prunes the database of schemas that where created by an older version.

dependencyApi
DbDependency dependencyApi()
Undocumented in source. Be warned that the author may not have intended to support it.
exists
bool exists(MutationStatusId 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)
getChecksum
Nullable!Checksum getChecksum(MutationStatusId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getCoverageMap
CovRegion[][FileId] getCoverageMap()
Undocumented in source. Be warned that the author may not have intended to support it.
getCoverageMapCount
long getCoverageMapCount()
Undocumented in source. Be warned that the author may not have intended to support it.
getCoverageTimeStamp
Optional!SysTime getCoverageTimeStamp()
Undocumented in source. Be warned that the author may not have intended to support it.
getDetectedTestCaseIds
TestCaseId[] getDetectedTestCaseIds()
getDetectedTestCases
TestCase[] getDetectedTestCases()
getFile
Nullable!Path getFile(FileId id)
getFileChecksum
Nullable!Checksum getFileChecksum(Path p)
Undocumented in source. Be warned that the author may not have intended to support it.
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)
getFileIdLanguage
Optional!Language getFileIdLanguage(FileId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getFiles
Path[] getFiles()
getHighestPrioMutant
MutationStatus[] getHighestPrioMutant(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.
getLatestMutants
MutationStatusTime[] getLatestMutants(const(Mutation.Kind)[] kinds, long nr)
getLatestTimeStampOfTestOrSut
Optional!SysTime getLatestTimeStampOfTestOrSut()
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()

All marked mutants whom have a mutation status checksum that has been removed from the database.

getMarkedMutants
MarkedMutant[] getMarkedMutants()
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.
getMutationId
Nullable!MutationId getMutationId(MutationStatusId 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)
getMutationScoreHistory
MutationScore[] getMutationScoreHistory()
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.
getMutationStatusId
Nullable!MutationStatusId getMutationStatusId(Checksum cs)
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)
getNewestFile
Optional!SysTime getNewestFile()
getNewestTestFile
Optional!TestFile getNewestTestFile()
getNotCoveredMutants
MutationStatusId[] getNotCoveredMutants()
Undocumented in source. Be warned that the author may not have intended to support it.
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.
getRootFiles
FileId[] getRootFiles()
getSchemata
Nullable!Schemata getSchemata(SchemataId id)
Undocumented in source. Be warned that the author may not have intended to support it.
getSchemataKinds
Mutation.Kind[] getSchemataKinds(SchemataId id)
getSchemataMutants
MutationStatusId[] getSchemataMutants(SchemataId id, Mutation.Kind[] kinds)
Undocumented in source. Be warned that the author may not have intended to support it.
getSchematas
SchemataId[] getSchematas()
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()
getTestCmdRuntimes
TestCmdRuntime[] getTestCmdRuntimes()
getTestFiles
TestFile[] getTestFiles()
Undocumented in source. Be warned that the author may not have intended to support it.
getWorklistCount
long getWorklistCount()
Undocumented in source. Be warned that the author may not have intended to support it.
hasTestCases
bool hasTestCases(MutationStatusId id)
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.
isToolVersionDifferent
bool isToolVersionDifferent(ToolVersion compareTo)
Undocumented in source. Be warned that the author may not have intended to support it.
markMutant
void markMutant(MutationId id, Path file, SourceLoc sloc, MutationStatusId statusId, Checksum cs, Mutation.Status s, Rationale r, string mutationTxt)

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

markUsed
void markUsed(SchemataId id)

Mark a schemata as used.

pruneSchemas
void pruneSchemas()

Prunes the database of schemas that are unusable.

pruneUsedSchemas
long pruneUsedSchemas()

Removes all schemas that either do not compile or have zero mutants.

put
void put(Path p, Checksum cs, Language lang, bool isRoot)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(TestFile tfile)
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 root)

Store all found mutants.

putCoverageInfo
void putCoverageInfo(CoverageRegionId regionId, bool status)
Undocumented in source. Be warned that the author may not have intended to support it.
putCoverageMap
void putCoverageMap(FileId id, Offset[] region)

Add coverage regions.

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.
putMutationScore
void putMutationScore(MutationScore score)

Add a mutation score to the history table.

putSchemata
Nullable!SchemataId putSchemata(SchemataChecksum cs, SchemataFragment[] fragments, MutationStatusId[] mutants)

Create a schemata from a bundle of fragments.

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.

removeFile
void removeFile(TestFilePath p)

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

removeFromWorklist
void removeFromWorklist(MutationStatusId id)

Remove a mutant from the worklist.

removeMarkedMutant
void removeMarkedMutant(Checksum cs)
Undocumented in source. Be warned that the author may not have intended to support it.
removeMarkedMutant
void removeMarkedMutant(MutationStatusId 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, orphaned mutants.

removeTestCase
void removeTestCase(TestCaseId id)
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(Mutation.Status toStatus)

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

resetTestCaseId
void resetTestCaseId(TestCaseId id)

Change the status of all mutants that the test case has killed to unknown.

schemataMutantsCount
long schemataMutantsCount(SchemataId id, Mutation.Kind[] kinds)
setDetectedTestCases
MutationStatusId[] setDetectedTestCases(const(TestCase)[] tcs)

Set detected test cases.

setTestCmdRuntimes
void setTestCmdRuntimes(TestCmdRuntime[] runtimes)

Drop all currently stored runtimes and replaces with runtime.

testCaseKilledSrcMutants
MutationStatusId[] testCaseKilledSrcMutants(Mutation.Kind[] kinds, TestCase tc)
testCmdApi
DbTestCmd testCmdApi()
Undocumented in source. Be warned that the author may not have intended to support it.
trimMutationScore
void trimMutationScore(long keep)

Trim the mutation score history table to only contain the last keep scores.

updateCoverageTimeStamp
void updateCoverageTimeStamp()

Set the timestamp to the current UTC time.

updateMetadata
void updateMetadata()

Update the content of metadata tables with what has been added to the raw table data.

updateMutation
void updateMutation(MutationStatusId id, MutantTimeProfile p)

Update the time used to test the mutant.

updateMutation
void updateMutation(MutationStatusId id, Mutation.Status st, ExitStatus ecode, MutantTimeProfile p)

Update the status of a mutant.

updateMutation
void updateMutation(MutationId id, Mutation.Status st, ExitStatus ecode, MutantTimeProfile p, const(TestCase)[] tcs)

Update the status of a mutant.

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

Update the status of a mutant.

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

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

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

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

updateToolVersion
void updateToolVersion(ToolVersion tv)

Update the version of the tool.

updateWorklist
void updateWorklist(Mutation.Kind[] kinds, Mutation.Status status, long basePrio, MutationOrder userOrder)

Add all mutants with the specific status to the worklist.

vacuum
void vacuum()

Compact the database by running a VACUUM operation

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