% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/source.R
\name{source_file}
\alias{source_file}
\alias{source_dir}
\alias{source_test_helpers}
\alias{source_test_setup}
\alias{source_test_teardown}
\title{Source a file, directory of files, or various important subsets}
\usage{
source_file(
  path,
  env = test_env(),
  chdir = TRUE,
  desc = NULL,
  wrap = TRUE,
  shuffle = FALSE,
  error_call = caller_env()
)

source_dir(
  path,
  pattern = "\\\\.[rR]$",
  env = test_env(),
  chdir = TRUE,
  wrap = TRUE,
  shuffle = FALSE
)

source_test_helpers(path = "tests/testthat", env = test_env())

source_test_setup(path = "tests/testthat", env = test_env())

source_test_teardown(path = "tests/testthat", env = test_env())
}
\arguments{
\item{path}{Path to files.}

\item{env}{Environment in which to evaluate code.}

\item{chdir}{Change working directory to \code{dirname(path)}?}

\item{desc}{A character vector used to filter tests. This is used to
(recursively) filter the content of the file, so that only the non-test
code up to and including the matching test is run.}

\item{wrap}{Automatically wrap all code within \code{\link[=test_that]{test_that()}}? This ensures
that all expectations are reported, even if outside a test block.}

\item{shuffle}{If \code{TRUE}, randomly reorder the top-level expressions
in the file.}

\item{pattern}{Regular expression used to filter files.}
}
\description{
These are used by \code{\link[=test_dir]{test_dir()}} and friends
}
\keyword{internal}
