Skip to content

Add standalone headers tests - #517

Open
vsoulgard wants to merge 10 commits into
boostorg:developfrom
vsoulgard:feature/add-standalone-headers-tests
Open

Add standalone headers tests#517
vsoulgard wants to merge 10 commits into
boostorg:developfrom
vsoulgard:feature/add-standalone-headers-tests

Conversation

@vsoulgard

@vsoulgard vsoulgard commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

close #479

Added standalone compile tests for all public headers as new build target except src.hpp, because it already compiled separetely in other test target.

@vsoulgard
vsoulgard marked this pull request as draft July 27, 2026 19:45
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.17%. Comparing base (205080b) to head (8033279).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #517   +/-   ##
========================================
  Coverage    99.17%   99.17%           
========================================
  Files          146      146           
  Lines         7405     7405           
========================================
  Hits          7344     7344           
  Misses          61       61           

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 205080b...8033279. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vsoulgard
vsoulgard marked this pull request as ready for review July 27, 2026 22:23
@vsoulgard

Copy link
Copy Markdown
Contributor Author

Dependencies are linked explicitly without linking with other targets to prevent masking missing includes.

However, it seems that all public headers were already self-contained.

# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#

add_library(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I'd make this an executable
  • I'd link it to Boost::mysql, so you don't need to repeat any of the include directories or link libraries

Comment thread test/standalone/Jamfile Outdated
Comment thread test/standalone/Jamfile
@vsoulgard

Copy link
Copy Markdown
Contributor Author

Thanks! I truly appreciate your patience and guidance.

But why CMake build should be an executable? I tried to make target OBJECT library previously, but it didn't link against dependencies and STATIC worked just fine.

And in B2 build we just trying to compile all files to see if there's compile errors without building an executable.

@vsoulgard

Copy link
Copy Markdown
Contributor Author

CMake build also need to link Boost::pfr, because pfr.hpp includes <boost/pfr/config.hpp>

@anarthal

Copy link
Copy Markdown
Collaborator

Yes you are right about the executable comment, I was a bit picky. Static library should work fine too.

Pfr is supposed to be an optional dependency that you get only if you include that optional header, so it is expected to need the extra link libraries dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure that all public headers are standalone

2 participants