library(testthat) library(ggmlR) heavy <- c( "normalization", "sequence-ops", "binary-operations", "glu", "nn-sequential", "matrix-ops", "callbacks", "onnx-quant", "cpu-backend", "onnx-elementwise", "onnx-norm", "onnx-misc", "onnx-logic", "onnx-gemm", "onnx-resize", "onnx-nn", "nn-functional", "activations-extended", "onnx-ops", "transformer-ops", "onnx-shape", "math-operations", "activations", "backend-extended", "helpers", "onnx-reduce" ) is_cran_omp2 <- Sys.getenv("OMP_THREAD_LIMIT", "") == "2" if (is_cran_omp2) { # negative lookahead to exclude tests with "test-(heavy)" in their name exclude_pattern <- paste0("^(?!.*test-(", paste(heavy, collapse = "|"), "))") test_check("ggmlR", filter = exclude_pattern, perl = TRUE) } else { test_check("ggmlR") }