% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/run_covr_skip_nstf.R
\name{get_nstf_test_path}
\alias{get_nstf_test_path}
\title{Collect all applicable nonstandard test paths for a package (internal)}
\usage{
get_nstf_test_path(test_pkg_data, testdir)
}
\arguments{
\item{test_pkg_data}{\code{list}. A list of booleans/fields describing detected
test frameworks and layouts. All fields are optional and default to \code{FALSE}
or \code{NULL} if missing:
\itemize{
  \item \code{has_testthat}: logical; whether \code{tests/testthat/} is present.
  \item \code{has_tinytest} (or \code{has_tiny_test}): logical; whether
        tinytest is present. If true, the function will look for
        \code{inst/tinytest/} (or use \code{tinytest_dir} if provided).
  \item \code{tinytest_dir}: character; optional explicit path to the tinytest
        directory. May be absolute or relative to the package root; when
        missing, defaults to \code{inst/tinytest/}.
  \item \code{has_testit}: logical; whether \code{tests/testit/} or the
        nonstandard \code{tests/test-ci/ + tests/test-cran/} layout is present.
  \item \code{has_tests_base}: logical; whether \code{*.R} test files exist
        directly under \code{tests/}.
  \item \code{has_bioc_unit_tests}: logical; whether \code{inst/unitTests/}
        exists (Bioconductor layout).
}}

\item{testdir}{\code{character}. Path to the package \code{tests/} directory. The function
also derives the package root as \code{dirname(testdir)} to locate paths such as
\code{inst/unitTests/} and \code{inst/tinytest/}.}
}
\value{
\code{list}. A named list of character paths to all applicable test directories found.
  Possible names include:
  \itemize{
    \item \code{tinytest} — \code{inst/tinytest/}
    \item \code{testthat} — \code{tests/testthat/}
    \item \code{testit} — \code{tests/testit/}
    \item \code{nonstandard_testit_root} — \code{tests/} (when both \code{test-ci} and \code{test-cran} exist)
    \item \code{base_tests_root} — \code{tests/} (when base \code{*.R} files exist in \code{tests/} root)
    \item \code{bioc_unitTests} — \code{inst/unitTests/}
    \item \code{default_tests_root} — \code{tests/} (returned only if no other paths are detected)
  }
}
\description{
Detects and returns all relevant testing directories used by an R package,
combining framework-specific and filesystem-based checks. Supported layouts:
\itemize{
  \item \strong{testthat}: \code{tests/testthat/}
  \item \strong{tinytest}: \code{inst/tinytest/} (primary location).
        Some packages also include a small runner under \code{tests/}
        (e.g., \code{tests/tinytest.R}) which this function does not return
        as a path, but it will still detect \code{inst/tinytest/}.
  \item \strong{testit} (standard): \code{tests/testit/}
  \item \strong{testit} (nonstandard): both \code{tests/test-ci/} and
        \code{tests/test-cran/} present, using \code{tests/} as the root
  \item \strong{base R tests}: \code{*.R} files directly under \code{tests/}
  \item \strong{Bioconductor unit tests}: \code{inst/unitTests/}
}
}
\details{
The function returns a named list of paths for all detected testing setups.
It uses both the flags contained in \code{test_pkg_data} and direct filesystem
checks for robustness. If no paths are detected, the returned list contains
a single entry \code{default_tests_root = tests/}.


Identical paths arising from multiple detection routes (e.g., \code{tests/} playing
multiple roles) are de-duplicated while preserving the first descriptive label.
If \code{tinytest_dir} is provided and relative, it is resolved against the
package root (i.e., \code{dirname(testdir)}).
}
\seealso{
Other nstf_utility: 
\code{\link{check_covr_skip_testit}()},
\code{\link{create_base_tests_coverage}()},
\code{\link{create_nstf_covr_list}()},
\code{\link{create_tinytest_coverage}()},
\code{\link{get_source_test_mapping_nstf}()},
\code{\link{restrict_test_paths_to_framework}()},
\code{\link{run_covr_skip_nstf}()}
}
\concept{nstf_utility}
\keyword{internal}
