tests/testthat/test-compiled-code.R

context("compiled code")

test_that("compiled code avoids deprecated variable lookup entry points", {
  skip_if(getRversion() < "4.5.0")
  skip_if(.Platform$OS.type == "windows")

  nm <- Sys.which("nm")
  skip_if(nm == "")

  dylib <- getLoadedDLLs()[["reticulate"]][["path"]]
  symbols <- system2(nm, c("-u", dylib), stdout = TRUE, stderr = TRUE)

  expect_false(any(grepl("\\b_?Rf_findVar(InFrame)?$", symbols)))
  expect_false(any(grepl("\\b_?R_NamespaceRegistry$", symbols)))
  expect_false(any(grepl("\\b_?R_UnboundValue$", symbols)))
})

Try the reticulate package in your browser

Any scripts or data that you put into this service are public.

reticulate documentation built on April 9, 2026, 5:08 p.m.