File: test-compiled-code.md

package info (click to toggle)
r-cran-testthat 3.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,048 kB
  • sloc: cpp: 9,269; sh: 14; ansic: 14; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 794 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# get_routine() fails when no routine exists

    Code
      get_routine("utils", "no_such_routine")
    Condition
      Error in `get_routine()`:
      ! Failed to locate routine `no_such_routine` in package utils.

# validates inputs

    Code
      expect_cpp_tests_pass(123)
    Condition
      Error in `expect_cpp_tests_pass()`:
      ! `package` must be a single string, not the number 123.
    Code
      run_cpp_tests(123)
    Condition
      Error in `run_cpp_tests()`:
      ! `package` must be a single string, not the number 123.

# useful messaging

    Code
      use_catch(path)
    Message
      v Added C++ unit testing infrastructure.
      i Please ensure you have LinkingTo: testthat in your DESCRIPTION.
      i Please ensure you have Suggests: xml2 in your DESCRIPTION.