-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Run DBItest for SQLite as part of the checks here
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
^CRAN-SUBMISSION$ | ||
^\.vscode$ | ||
^\.aviator/config\.yml$ | ||
^tests/testthat/helper-dev\.R$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
if (dir.exists("../../../RSQLite")) { | ||
writeLines( | ||
c( | ||
"# Generated by helper-dev.R, do not edit by hand", | ||
"", | ||
"skip_if_not_installed(\"RSQLite\")", | ||
"", | ||
"# helper-DBItest.R", | ||
readLines("../../../RSQLite/tests/testthat/helper-DBItest.R"), | ||
"", | ||
"# test-DBItest.R", | ||
readLines("../../../RSQLite/tests/testthat/test-DBItest.R") | ||
), | ||
"test-DBItest.R" | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Generated by helper-dev.R, do not edit by hand | ||
|
||
skip_if_not_installed("RSQLite") | ||
|
||
# helper-DBItest.R | ||
# Also copied into DBI | ||
tryCatch(skip = function(e) message(conditionMessage(e)), { | ||
skip_on_cran() | ||
skip_if_not_installed("DBItest") | ||
|
||
DBItest::make_context( | ||
RSQLite::SQLite(), | ||
list(dbname = tempfile("DBItest", fileext = ".sqlite")), | ||
tweaks = DBItest::tweaks( | ||
dbitest_version = "1.7.2", | ||
constructor_relax_args = TRUE, | ||
placeholder_pattern = c("?", "$1", "$name", ":name"), | ||
date_cast = function(x) paste0("'", x, "'"), | ||
time_cast = function(x) paste0("'", x, "'"), | ||
timestamp_cast = function(x) paste0("'", x, "'"), | ||
logical_return = function(x) as.integer(x), | ||
date_typed = FALSE, | ||
time_typed = FALSE, | ||
timestamp_typed = FALSE | ||
), | ||
name = "RSQLite" | ||
) | ||
}) | ||
|
||
# test-DBItest.R | ||
# Also copied into DBI | ||
skip_on_cran() | ||
skip_if_not_installed("DBItest") | ||
|
||
DBItest::test_all() |