Skip to content

Commit 3431074

Browse files
committed
expand tests (using vendoring to see what is tested on each header)
1 parent 194b25c commit 3431074

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+10736
-91
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
^\.here$
22
^LICENSE\.md$
33
^src/Makevars$
4+
^\.covrignore$
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
R/
2+
src/add.h
3+
src/cpp4r.cpp
4+
src/cpp4r.hpp
5+
src/data_frame.h
6+
src/env-helpers.h
7+
src/errors_fmt.h
8+
src/errors.h
9+
src/find-intervals.h
10+
src/grow.h
11+
src/insert.h
12+
src/list-complex-helpers.h
13+
src/lists.h
14+
src/main.cpp
15+
src/Makevars
16+
src/Makevars.in
17+
src/Makevars.win
18+
src/map.h
19+
src/matrix.h
20+
src/protect.h
21+
src/release.h
22+
src/roxygen1.h
23+
src/roxygen2.h
24+
src/roxygen3.h
25+
src/safe.h
26+
src/strings.h
27+
src/sum.h
28+
src/sum_int.h
29+
src/test-as_advanced.h
30+
src/test-as_complexes.h
31+
src/test-as.h
32+
src/test-attribute_proxy.h
33+
src/test-complex.h
34+
src/test-cxx17.h
35+
src/test-cxx20.h
36+
src/test-cxx23.h
37+
src/test-data_frame.h
38+
src/test-doubles.h
39+
src/test-environment_advanced.h
40+
src/test-environment.h
41+
src/test-external_pointer.h
42+
src/test-function_advanced.h
43+
src/test-function.h
44+
src/test-helpers.h
45+
src/test-integers.h
46+
src/test-iterators-comprehensive.h
47+
src/test-list.h
48+
src/test-list_of.h
49+
src/test-logicals.h
50+
src/test-matrix_advanced.h
51+
src/test-matrix.h
52+
src/test-named_arg.h
53+
src/test-nas.h
54+
src/test-protect_advanced.h
55+
src/test-protect.h
56+
src/test-protect-nested.h
57+
src/test-raws.h
58+
src/test-r_bool_advanced.h
59+
src/test-r_complex.h
60+
src/test-r_string_advanced.h
61+
src/test-runner.cpp
62+
src/test-runner.h
63+
src/test-r_vector_advanced.h
64+
src/test-r_vector.h
65+
src/test-sexp_advanced.h
66+
src/test-sexp.h
67+
src/test-string.h
68+
src/test-strings.h
69+
src/test-translate_names.h
70+
src/truncate.h

extended-tests/cpp4rtest/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Authors@R:
1212
Description: Provides a test suite and benchmarking code for the 'cpp4r' package.
1313
License: Apache License (>= 2)
1414
Encoding: UTF-8
15-
LinkingTo: cpp4r, testthat
15+
LinkingTo: testthat
1616
Suggests:
1717
covr,
1818
testthat (>= 3.0.0),

extended-tests/cpp4rtest/R/cpp4r.R

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,54 @@ data_frame_ <- function() {
1414
.Call(`_cpp4rtest_data_frame_`)
1515
}
1616

17+
cpp4r_env_get_int_ <- function(env, name) {
18+
.Call(`_cpp4rtest_cpp4r_env_get_int_`, env, name)
19+
}
20+
21+
cpp4r_env_get_str_ <- function(env, name) {
22+
.Call(`_cpp4rtest_cpp4r_env_get_str_`, env, name)
23+
}
24+
25+
cpp4r_env_set_ <- function(env, name, value) {
26+
invisible(.Call(`_cpp4rtest_cpp4r_env_set_`, env, name, value))
27+
}
28+
29+
cpp4r_env_exists_ <- function(env, name) {
30+
.Call(`_cpp4rtest_cpp4r_env_exists_`, env, name)
31+
}
32+
33+
cpp4r_global_get_ <- function(name) {
34+
.Call(`_cpp4rtest_cpp4r_global_get_`, name)
35+
}
36+
37+
cpp4r_named_doubles_ <- function() {
38+
.Call(`_cpp4rtest_cpp4r_named_doubles_`)
39+
}
40+
41+
cpp4r_named_integers_ <- function() {
42+
.Call(`_cpp4rtest_cpp4r_named_integers_`)
43+
}
44+
45+
cpp4r_named_strings_ <- function() {
46+
.Call(`_cpp4rtest_cpp4r_named_strings_`)
47+
}
48+
49+
cpp4r_named_list_ <- function() {
50+
.Call(`_cpp4rtest_cpp4r_named_list_`)
51+
}
52+
53+
cpp4r_get_by_name_ <- function(x, name) {
54+
.Call(`_cpp4rtest_cpp4r_get_by_name_`, x, name)
55+
}
56+
57+
cpp4r_contains_name_ <- function(x, name) {
58+
.Call(`_cpp4rtest_cpp4r_contains_name_`, x, name)
59+
}
60+
61+
cpp4r_find_name_pos_ <- function(x, name) {
62+
.Call(`_cpp4rtest_cpp4r_find_name_pos_`, x, name)
63+
}
64+
1765
my_stop_n1fmt <- function(mystring) {
1866
invisible(.Call(`_cpp4rtest_my_stop_n1fmt`, mystring))
1967
}
@@ -103,6 +151,42 @@ cpp4r_insert_ <- function(num_sxp) {
103151
.Call(`_cpp4rtest_cpp4r_insert_`, num_sxp)
104152
}
105153

154+
cpp4r_list_of_doubles_ <- function() {
155+
.Call(`_cpp4rtest_cpp4r_list_of_doubles_`)
156+
}
157+
158+
cpp4r_list_of_integers_ <- function() {
159+
.Call(`_cpp4rtest_cpp4r_list_of_integers_`)
160+
}
161+
162+
cpp4r_list_of_strings_ <- function() {
163+
.Call(`_cpp4rtest_cpp4r_list_of_strings_`)
164+
}
165+
166+
cpp4r_list_of_named_ <- function() {
167+
.Call(`_cpp4rtest_cpp4r_list_of_named_`)
168+
}
169+
170+
cpp4r_make_complex_ <- function(real, imag) {
171+
.Call(`_cpp4rtest_cpp4r_make_complex_`, real, imag)
172+
}
173+
174+
cpp4r_complex_real_ <- function(x) {
175+
.Call(`_cpp4rtest_cpp4r_complex_real_`, x)
176+
}
177+
178+
cpp4r_complex_imag_ <- function(x) {
179+
.Call(`_cpp4rtest_cpp4r_complex_imag_`, x)
180+
}
181+
182+
cpp4r_complex_modulus_ <- function(x) {
183+
.Call(`_cpp4rtest_cpp4r_complex_modulus_`, x)
184+
}
185+
186+
cpp4r_complex_add_ <- function(x, y) {
187+
.Call(`_cpp4rtest_cpp4r_complex_add_`, x, y)
188+
}
189+
106190
#' @title List functions
107191
#' @rdname testing-list
108192
#' @keywords internal
@@ -459,6 +543,74 @@ nullable_extptr_2 <- function() {
459543
.Call(`_cpp4rtest_nullable_extptr_2`)
460544
}
461545

546+
cpp4r_add_int_vec_ <- function(x, value) {
547+
.Call(`_cpp4rtest_cpp4r_add_int_vec_`, x, value)
548+
}
549+
550+
cpp4r_as_integers_ <- function(x) {
551+
.Call(`_cpp4rtest_cpp4r_as_integers_`, x)
552+
}
553+
554+
cpp4r_negate_logical_ <- function(x) {
555+
.Call(`_cpp4rtest_cpp4r_negate_logical_`, x)
556+
}
557+
558+
cpp4r_logical_to_int_ <- function(x) {
559+
.Call(`_cpp4rtest_cpp4r_logical_to_int_`, x)
560+
}
561+
562+
cpp4r_logical_to_dbl_ <- function(x) {
563+
.Call(`_cpp4rtest_cpp4r_logical_to_dbl_`, x)
564+
}
565+
566+
cpp4r_iterator_sum_ <- function(x) {
567+
.Call(`_cpp4rtest_cpp4r_iterator_sum_`, x)
568+
}
569+
570+
cpp4r_iterator_sum_int_ <- function(x) {
571+
.Call(`_cpp4rtest_cpp4r_iterator_sum_int_`, x)
572+
}
573+
574+
cpp4r_iterator_find_ <- function(x, value) {
575+
.Call(`_cpp4rtest_cpp4r_iterator_find_`, x, value)
576+
}
577+
578+
cpp4r_iterator_count_ <- function(x, value) {
579+
.Call(`_cpp4rtest_cpp4r_iterator_count_`, x, value)
580+
}
581+
582+
cpp4r_iterator_min_ <- function(x) {
583+
.Call(`_cpp4rtest_cpp4r_iterator_min_`, x)
584+
}
585+
586+
cpp4r_iterator_max_ <- function(x) {
587+
.Call(`_cpp4rtest_cpp4r_iterator_max_`, x)
588+
}
589+
590+
cpp4r_iterator_double_values_ <- function(x) {
591+
.Call(`_cpp4rtest_cpp4r_iterator_double_values_`, x)
592+
}
593+
594+
cpp4r_reverse_vector_ <- function(x) {
595+
.Call(`_cpp4rtest_cpp4r_reverse_vector_`, x)
596+
}
597+
598+
cpp4r_iterator_at_ <- function(x, index) {
599+
.Call(`_cpp4rtest_cpp4r_iterator_at_`, x, index)
600+
}
601+
602+
cpp4r_iterator_distance_ <- function(x) {
603+
.Call(`_cpp4rtest_cpp4r_iterator_distance_`, x)
604+
}
605+
606+
cpp4r_raw_copy_ <- function(x) {
607+
.Call(`_cpp4rtest_cpp4r_raw_copy_`, x)
608+
}
609+
610+
cpp4r_raw_xor_ <- function(x, mask) {
611+
.Call(`_cpp4rtest_cpp4r_raw_xor_`, x, mask)
612+
}
613+
462614
test_destruction_inner <- function() {
463615
invisible(.Call(`_cpp4rtest_test_destruction_inner`))
464616
}

extended-tests/cpp4rtest/cpp4r.hpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#pragma once
2+
3+
#include "cpp4r/R.hpp"
4+
#include "cpp4r/as.hpp"
5+
#include "cpp4r/attribute_proxy.hpp"
6+
#include "cpp4r/complexes.hpp"
7+
#include "cpp4r/data_frame.hpp"
8+
#include "cpp4r/doubles.hpp"
9+
#include "cpp4r/environment.hpp"
10+
#include "cpp4r/external_pointer.hpp"
11+
#include "cpp4r/function.hpp"
12+
#include "cpp4r/integers.hpp"
13+
#include "cpp4r/list.hpp"
14+
#include "cpp4r/list_of.hpp"
15+
#include "cpp4r/logicals.hpp"
16+
#include "cpp4r/matrix.hpp"
17+
#include "cpp4r/named_arg.hpp"
18+
#include "cpp4r/protect.hpp"
19+
#include "cpp4r/r_bool.hpp"
20+
#include "cpp4r/r_string.hpp"
21+
#include "cpp4r/r_vector.hpp"
22+
#include "cpp4r/raws.hpp"
23+
#include "cpp4r/sexp.hpp"
24+
#include "cpp4r/strings.hpp"

extended-tests/cpp4rtest/src/Makevars.in

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,4 @@ PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
33
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
44

55
# Debugging
6-
7-
# uncomment one of the following lines to enable debugging
8-
# PKG_CPPFLAGS = -UDEBUG -g
9-
# PKG_CPPFLAGS = -UDEBUG -g -I vendor/
10-
11-
# uncomment to disable compiler optimizations
12-
# PKG_CXXFLAGS = -Wall -O0 -pedantic
13-
14-
# for local test coverage
15-
# PKG_CXXFLAGS = -Wall -O2 -pedantic
6+
PKG_CPPFLAGS = -UDEBUG -g -I vendor/ -Wall -O2 -pedantic

0 commit comments

Comments
 (0)