@@ -138,6 +138,7 @@ void test_gradient(const ad_tolerances& tols, const F& f,
138138 grad_ad, tols.gradient_grad_ );
139139}
140140
141+ #ifndef STAN_MATH_TESTS_REV_ONLY
141142/* *
142143 * Tests that the specified function applied to the specified argument
143144 * yields the values and gradients consistent with finite differences
@@ -309,6 +310,7 @@ void test_grad_hessian(const ad_tolerances& tols, const F& f,
309310 expect_near_rel (" grad_hessian() grad Hessian" , grad_H_fd[i], grad_H_ad[i],
310311 tols.grad_hessian_grad_hessian_ );
311312}
313+ #endif
312314
313315/* *
314316 * For the specified functor and argument, test that automatic
@@ -332,10 +334,12 @@ void expect_ad_derivatives(const ad_tolerances& tols, const G& g,
332334 const Eigen::VectorXd& x) {
333335 double gx = g (x);
334336 test_gradient (tols, g, x, gx);
337+ #ifndef STAN_MATH_TESTS_REV_ONLY
335338 test_gradient_fvar (tols, g, x, gx);
336339 test_hessian (tols, g, x, gx);
337340 test_hessian_fvar (tols, g, x, gx);
338341 test_grad_hessian (tols, g, x, gx);
342+ #endif
339343}
340344
341345/* *
@@ -379,10 +383,12 @@ void expect_all_throw(const F& f, const Eigen::VectorXd& x) {
379383 using stan::math::var;
380384 expect_throw<double >(f, x, " double" );
381385 expect_throw<var>(f, x, " var" );
386+ #ifndef STAN_MATH_TESTS_REV_ONLY
382387 expect_throw<fvar<double >>(f, x, " fvar<double>" );
383388 expect_throw<fvar<fvar<double >>>(f, x, " fvar<fvar<double>>" );
384389 expect_throw<fvar<var>>(f, x, " fvar<var>" );
385390 expect_throw<fvar<fvar<var>>>(f, x, " fvar<fvar<var>>" );
391+ #endif
386392}
387393
388394/* *
0 commit comments