% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/run_covr_modes.R
\name{run_covr_modes}
\alias{run_covr_modes}
\title{Run Coverage Analysis with Test Detection}
\usage{
run_covr_modes(pkg_source_path, covr_timeout = 60)
}
\arguments{
\item{pkg_source_path}{Character. Path to the root directory of the R package source.}

\item{covr_timeout}{Numeric. Timeout in seconds for running coverage analysis. Default is 60.}
}
\value{
A list with two elements:
\describe{
  \item{covr_list}{A list containing coverage results. If no supported tests are found, returns a default structure with zero coverage.}
  \item{test_pkg_data}{A list summarizing the test configuration, including presence of `testthat`, `testit`, snapshots, and base R test scripts.}
}
}
\description{
This function checks the test configuration of an R package and runs code coverage analysis
using `testthat`, `testit` or `test base` frameworks if available. If no supported test framework is found,
it returns a default coverage result indicating no functions were tested.
}
\examples{
\dontrun{
r = getOption("repos")
r["CRAN"] = "http://cran.us.r-project.org"
old <- options(repos = r)

dp <- system.file("test-data", 
  "test.package.0001_0.1.0.tar.gz", 
  package = "risk.assessr")

# set up package
install_list <- set_up_pkg(dp)

build_vignettes <- install_list$build_vignettes
package_installed <- install_list$package_installed
pkg_source_path <- install_list$pkg_source_path
rcmdcheck_args <- install_list$rcmdcheck_args

# install package locally to ensure test works
package_installed <- install_package_local(pkg_source_path)
package_installed <- TRUE

rcmdcheck_args$path <- pkg_source_path
covr_mode_list <- run_covr_modes(pkg_source_path)
}

}
