CoverageCore.FileCoverage
— TypeFileCoverage
Represents coverage info about a file, including the filename, the source code itself, and a Vector
of run counts for each line. If the line was expected to be run the count will be an Int
>= 0. Other lines such as comments will have a count of nothing
.
CoverageCore.amend_coverage_from_src!
— Methodamend_coverage_from_src!(coverage::Vector{CovCount}, srcname)
amend_coverage_from_src!(fc::FileCoverage)
The code coverage functionality in Julia only reports lines that have been compiled. Unused functions (or discarded lines) therefore may be incorrectly recorded as nothing
but should instead be 0. This function takes an existing result and updates the coverage vector in-place to mark source lines that may be inside a function.
CoverageCore.clean_file
— Methodclean_file(filename::AbstractString)
Cleans up all .cov
files associated with a given source file. This only looks in the directory of the given file, i.e. the .cov
files should be siblings of the source file.
CoverageCore.clean_folder
— Methodclean_folder(folder::AbstractString)
Cleans up all the .cov
files in the given directory and subdirectories. Unlike process_folder
this does not include a default value for the root folder, requiring the calling code to be more explicit about which files will be deleted.
CoverageCore.get_summary
— Functionget_summary(fcs)
Summarize results from a single FileCoverage
instance or a Vector
of them, returning a 2-tuple with the covered lines and total lines.
CoverageCore.merge_coverage_counts
— Methodmerge_coverage_counts(a1::Vector{CovCount}, a2::Vector{CovCount}) -> Vector{CovCount}
Given two vectors of line coverage counts, sum together the results, preseving null counts if both are null.
CoverageCore.merge_coverage_counts
— Methodmerge_coverage_counts(as::Vector{CovCount}...) -> Vector{CovCount}
Given vectors of line coverage counts, sum together the results, preseving null counts if both are null.
CoverageCore.process_cov
— Methodprocess_cov(filename, folder) -> Vector{CovCount}
Given a filename for a Julia source file, produce an array of line coverage counts by reading in all matching .{pid}.cov files.
CoverageCore.process_file
— Functionprocess_file(filename[, folder]) -> FileCoverage
Given a .jl file and its containing folder, produce a corresponding FileCoverage
instance from the source and matching coverage files. If the folder is not given it is extracted from the filename.
CoverageCore.process_folder
— Functionprocess_folder(folder="src") -> Vector{FileCoverage}
Process the contents of a folder of Julia source code to collect coverage statistics for all the files contained within. Will recursively traverse child folders. Default folder is "src", which is useful for the primary case where CoverageCore is called from the root directory of a package.
CoverageCore.analyze_malloc_files
— Methodanalyze_malloc_files(files) -> Vector{MallocInfo}
Iterates through the given list of filenames and return a Vector
of MallocInfo
s with allocation information.