Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ help: ## Display this help screen
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort

testall: ## tinytest::build_install_test()
Rscript -e "pkgload::load_all();tinytest::run_test_dir()"
NOT_CRAN=true Rscript -e "pkgload::load_all();tinytest::run_test_dir()"

testall-docker: ## run full test suite in a Linux container (native arch)
.devcontainer/run-tests.sh
Expand All @@ -14,7 +14,7 @@ testall-ci: ## as testall-docker, under amd64 to match CI (needed on Apple Silic
PLATFORM=linux/amd64 .devcontainer/run-tests.sh

testone: install ## make testone testfile="inst/tinytest/test-aaa-warn_once.R"
Rscript -e "pkgload::load_all();tinytest::run_test_file('$(testfile)')"
NOT_CRAN=true Rscript -e "pkgload::load_all();tinytest::run_test_file('$(testfile)')"

document: ## devtools::document()
Rscript -e "devtools::document()"
Expand Down
10 changes: 10 additions & 0 deletions inst/tinytest/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,15 @@ options("tinysnapshot_device_args" = list(
system_fonts = list(symbol = "DejaVu Sans")
))

# Mirror the gate that tinysnapshot uses to decide whether plot snapshots run
snapshots_run = local({
os = getOption("tinysnapshot_os", default = Sys.info()[["sysname"]])
skip = getOption(
"tinysnapshot_plot_skip",
default = !interactive() && !identical(Sys.getenv("NOT_CRAN"), "true")
)
Sys.info()[["sysname"]] %in% os && !skip
})

# reset theme in every file
tinytheme()
5 changes: 4 additions & 1 deletion inst/tinytest/test-legend.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ f = function() tinyplot(
Temp ~ Day | Month, data = aq,
legend = legend(legend = month.abb[5:10])
)
expect_warning(expect_snapshot_plot(f, label = "legend_user_labs_override"))
# the mismatch warning is only emitted when the plot is actually drawn
if (snapshots_run) {
expect_warning(expect_snapshot_plot(f, label = "legend_user_labs_override"))
}


# override default legend margins with tpar("lmar")
Expand Down