Skip to contents

Identify ordering of validation or user-designated child files

Usage

vt_get_child_files(
  loc = c("folder", "yml"),
  validation_order = c("requirements", "test_cases", "test_code")
)

Arguments

loc

location to explore. Either "folder" for naive inclusion of validation folder contents, or "yml" to use validation_folder field of validation.yml

validation_order

optional ordering of validation folders to search

Value

vector of child file names to include in validation report

Examples

withr::with_tempdir({
  vt_use_validation()
  vt_use_test_case("testcase1", username = "a user", open = FALSE)
  vt_use_req("req1", username = "a user", open = FALSE)
  vt_use_test_code("testcode1", username = "another user", open = FALSE)

  # as listed in validation.yml validation_files
  vt_get_child_files(loc = "yml")

  # as ordered in validation subfolders
  vt_get_child_files(loc = "folder",
    validation_order = c("requirements", "test_cases", "test_code"))

})
#>  Adding "!*" to ././validation/.gitignore.
#> Created ./validation  in package structure
#> validation config file created. Add user information through `vt_add_user_to_config()`
#> Item created:test_cases/testcase1.md 
#> Filename(s): testcase1.md added to validation config file.
#> Item created:requirements/req1.md 
#> Filename(s): req1.md added to validation config file.
#> Item created:test_code/testcode1.R 
#> Filename(s): testcode1.R added to validation config file.
#> [1] "requirements/req1.md"    "test_cases/testcase1.md"
#> [3] "test_code/testcode1.R"