Skip to content

Commit

Permalink
Add compile test to check for missing includes
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtum committed Nov 29, 2023
1 parent 76fe0d5 commit 843349e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# http://www.boost.org/LICENSE_1_0.txt)

# bring in rules for testing
import path ;
import regex ;
import testing ;

project
Expand All @@ -32,6 +34,13 @@ run test_xml_parser_rapidxml.cpp ;

run test_multi_module1.cpp test_multi_module2.cpp ;

# Ensure that all headers are self-contained.
for local file in [ glob-tree-ex ../include : *.hpp ]
{
local rel_name = [ path.relative-to ../include $(file) ] ;
compile self_contained_header.cpp : <define>HEADER_PATH=$(rel_name) : [ regex.replace $(rel_name) "/" "_" ] ;
}

compile ../examples/custom_data_type.cpp ;
compile ../examples/debug_settings.cpp ;
compile ../examples/empty_ptree_trick.cpp ;
Expand Down
3 changes: 3 additions & 0 deletions test/self_contained_header.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define INCLUDE_HEADER() <HEADER_PATH>

#include INCLUDE_HEADER()

0 comments on commit 843349e

Please sign in to comment.