Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cd36d10

Browse files
committedFeb 28, 2025·
rayrender v0.38.10: Don't include testthat C++ tests on the CRAN
1 parent 12ed39d commit cd36d10

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed
 

‎DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: rayrender
22
Type: Package
33
Title: Build and Raytrace 3D Scenes
4-
Version: 0.38.9
5-
Date: 2025-02-20
4+
Version: 0.38.10
5+
Date: 2025-02-24
66
Authors@R: c(person("Tyler", "Morgan-Wall", email = "tylermw@gmail.com",
77
role = c("aut", "cph", "cre"), comment = c(ORCID = "0000-0002-3131-3814")),
88
person("Syoyo", "Fujita", role=c("ctb", "cph")),

‎src/matrix.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "matrix.h"
22
#include "simd.h"
3-
#include <testthat.h>
43

54
static_assert(std::is_trivially_copyable<FVec4>::value,
65
"FVec4 must be trivially copyable to use memcpy safely.");
@@ -175,6 +174,7 @@ Matrix4x4 Transpose(const Matrix4x4 &m) {
175174
m.m[0][3], m.m[1][3], m.m[2][3], m.m[3][3]);
176175
}
177176

177+
#ifdef NOT_CRAN
178178
#include <testthat.h>
179179
#include <Rcpp.h>
180180

@@ -303,3 +303,5 @@ context("Inverse computes matrix inverse correctly") {
303303
}
304304
}
305305
}
306+
307+
#endif

‎src/simd.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ inline IVec4 sort_simd_4_floats(FVec4 values) {
5555
extract_index(values[3])));
5656
}
5757

58+
#ifdef NOT_CRAN
5859
#include <testthat.h>
5960

6061
context("simd_load loads values correctly") {
@@ -68,7 +69,6 @@ context("simd_load loads values correctly") {
6869
}
6970
}
7071

71-
7272
context("simd_sub subtracts vectors correctly") {
7373
test_that("[simd_sub]") {
7474
float a_values[SIMD_WIDTH] = {5.0f, 6.0f, 7.0f, 8.0f};
@@ -695,4 +695,5 @@ context("simd_set1 initializes SimdMask with unsigned int value correctly") {
695695
expect_true(mask_bits == value);
696696
}
697697
}
698-
}
698+
}
699+
#endif

‎src/test-runner.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@
33
* 'run_testthat_tests()' C routine that can be used to run the Catch unit tests
44
* available in your package.
55
*/
6+
#ifdef NOT_CRAN
67
#define TESTTHAT_TEST_RUNNER
78
#include <testthat.h>
9+
#else
10+
11+
#include <R.h>
12+
#include <Rinternals.h>
13+
extern "C" SEXP run_testthat_tests(SEXP use_xml_sxp) {
14+
return Rf_ScalarLogical(true);
15+
}
16+
#endif

‎src/transform.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ hit_record Transform::operator()(hit_record &r) const {
695695
// return ret;
696696
// }
697697

698-
698+
#ifdef NOT_CRAN
699699
// Unit Tests
700700
#include <testthat.h>
701701

@@ -978,3 +978,5 @@ context("Transform composition works correctly") {
978978
expect_true(pTransformed.z() == Approx(expectedPoint.z()));
979979
}
980980
}
981+
982+
#endif

‎src/vectypes.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#include "Rcpp.h"
2-
#include <testthat.h>
32
#include "vec3.h"
43
#include "point3.h"
54
#include "normal.h"
65
#include "simd.h"
76
#include "vectypes.h" // Your provided header with inline functions
87

8+
#ifdef NOT_CRAN
9+
#include <testthat.h>
10+
911
context("Conversion functions") {
1012
test_that("[convert_to_point3(vec3f)]") {
1113
vec3f v; v.e[0] = 1.0f; v.e[1] = 2.0f; v.e[2] = 3.0f;
@@ -462,3 +464,5 @@ context("point3<Float> arithmetic operators") {
462464
expect_true(v.z() == Approx(1.0f));
463465
}
464466
}
467+
468+
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.