r-lib / cpp11

cpp11 helps you to interact with R objects using C++ code.
https://cpp11.r-lib.org/
Other
199 stars 46 forks source link

tests in 'tests/testthat.R' failed #323

Closed nunotexbsd closed 1 year ago

nunotexbsd commented 1 year ago

make test fails on 0.4.4 (same on 0.4.3):

FreeBSD 13.2 amd64 R 4.3.1 R-cran-decor 1.0.2 R-cran-mockery 0.4.3 R-cran-testthat 3.1.9

Full log: https://people.freebsd.org/~eduardo/logs/R-cran-cpp11/00check.log

* checking tests ... ERROR
  Running 'testthat.R'
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
  Class:   simpleError/error/condition
  Backtrace:
      x
   1. +-cpp11:::expect_error_free(cpp11::cpp_source(clean = TRUE, code = "#include <cpp11/R.hpp>\n              #include <RProgress.h>\n\n              [[cpp11::linking_to(\"progress\")]]\n\n              [[cpp11::register]] void show_progress() {\n                RProgress::RProgress pb(\"Processing [:bar] ETA: :eta\");\n\n                pb.tick(0);\n                for (int i = 0; i < 100; i++) {\n                  usleep(2.0 / 100 * 1000000);\n                  pb.tick();\n                }\n              }\n              ")) at test-source.R:132:2
   2. | \-testthat::expect_error(..., regexp = regexp) at tests/testthat/helper.R:33:2
   3. |   \-testthat:::expect_condition_matching(...)
   4. |     \-testthat:::quasi_capture(...)
   5. |       +-testthat (local) .capture(...)
   6. |       | \-base::withCallingHandlers(...)
   7. |       \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   8. \-cpp11::cpp_source(clean = TRUE, code = "#include <cpp11/R.hpp>\n              #include <RProgress.h>\n\n              [[cpp11::linking_to(\"progress\")]]\n\n              [[cpp11::register]] void show_progress() {\n                RProgress::RProgress pb(\"Processing [:bar] ETA: :eta\");\n\n                pb.tick(0);\n                for (int i = 0; i < 100; i++) {\n                  usleep(2.0 / 100 * 1000000);\n                  pb.tick();\n                }\n              }\n              ")

  [ FAIL 1 | WARN 0 | SKIP 4 | PASS 106 ]
  Error: Test failures

Any hints?

pekkarr commented 1 year ago

The R package progress is required for that test

nunotexbsd commented 1 year ago

Fixed! Now I see #include in error log... Next time I will take more attention on this kind of details.

Thanks