Skip to content

Commit

Permalink
Mention name of current script in debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
hsonne committed Apr 18, 2024
1 parent 6bcf363 commit b349c8b
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions R/create_test_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#' @importFrom kwb.utils createDirectory
#'
create_test_files <- function(
package_dir = getwd(),
target_dir = NULL,
file_per_function = TRUE,
full = FALSE,
dbg = TRUE
package_dir = getwd(),
target_dir = NULL,
file_per_function = TRUE,
full = FALSE,
dbg = TRUE
)
{
#package_dir = getwd(); file_per_function = TRUE; full = FALSE; dbg = TRUE
Expand All @@ -52,26 +52,33 @@ create_test_files <- function(

#script <- scripts[1L]

create_tests_for_file(
script = script,
test_dir = target_dir,
pkg_name = pkg_name,
file_per_function = file_per_function,
full = full,
dbg = dbg
kwb.utils::catAndRun(
paste("Creating tests for functions in", script),
dbg = dbg,
newLine = 3L,
expr = {
create_tests_for_file(
script = script,
test_dir = target_dir,
pkg_name = pkg_name,
file_per_function = file_per_function,
full = full,
dbg = dbg
)
}
)
}
}

# create_tests_for_file --------------------------------------------------------
#' @importFrom kwb.utils resolve user
create_tests_for_file <- function(
script,
test_dir,
pkg_name,
file_per_function = TRUE,
full = FALSE,
dbg = TRUE
script,
test_dir,
pkg_name,
file_per_function = TRUE,
full = FALSE,
dbg = TRUE
)
{
# One test file per source file?
Expand Down

0 comments on commit b349c8b

Please sign in to comment.