Skip to content

Commit b530586

Browse files
committed
update test/unit/multiple_translation_units_test.cpp to cover all of the stan math library
1 parent bc20c34 commit b530586

5 files changed

Lines changed: 18 additions & 4 deletions

make/tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ endif
3838

3939
##
4040
# Adding a test for multiple translation units. If this fails,
41-
# a new function is probably missing an inline
41+
# a public umbrella header likely exposes a new non-inline external definition.
4242
##
4343

4444
ifneq ($(OS),Windows_NT)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#include <stan/math.hpp>
1+
#include <test/unit/multiple_translation_units_includes.hpp>
22

33
inline stan::math::var function1() { return 0; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#include <stan/math.hpp>
1+
#include <test/unit/multiple_translation_units_includes.hpp>
22

33
inline stan::math::var function2() { return 0; }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef TEST_UNIT_MULTIPLE_TRANSLATION_UNITS_INCLUDES_HPP
2+
#define TEST_UNIT_MULTIPLE_TRANSLATION_UNITS_INCLUDES_HPP
3+
4+
// Keep this list aligned with the public Stan Math umbrella headers. Each
5+
// translation unit test source includes this header so linking catches ODR
6+
// violations from any externally linked header-defined function reachable from
7+
// the public entry points.
8+
#include <stan/math.hpp>
9+
#include <stan/math/fwd.hpp>
10+
#include <stan/math/mix.hpp>
11+
#include <stan/math/prim.hpp>
12+
#include <stan/math/rev.hpp>
13+
14+
#endif

test/unit/multiple_translation_units_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
TEST(multiple_translation_units, compile) {
44
SUCCEED() << "this test compiling indicates that compiling the math library "
5-
<< "with multiple translation units is ok.";
5+
<< "public umbrella headers with multiple translation units is ok.";
66
}

0 commit comments

Comments
 (0)