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 b7692c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ jobs:
shell: cmd
run: |
cd ../boost-root
b2 -j1 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} ${{matrix.cxxflags}} variant=debug,release embed-manifest-via=linker
b2 -j1 --abbreviate-paths libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} ${{matrix.cxxflags}} variant=debug,release embed-manifest-via=linker
posix-cmake-subdir:
strategy:
Expand Down
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 b7692c2

Please sign in to comment.