Page MenuHomePhabricator

[DEPENDS] Build boost unit tests with no main
AbandonedPublic

Authored by Fabien on Mon, Jan 6, 10:57.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

Since D4474 the unit tests rely on BOOST_TEST_NO_MAIN to override the
default Boost unit tests framework main function.
This doesn't work by default when Boost is built as a static library,
which is the case when the software builds against the depends
libraries.
This diff makes the Boost static build compliant for using with a custom
main, as per the documentation:
https://www.boost.org/doc/libs/1_64_0/libs/test/doc/html/boost_test/adv_scenarios/static_lib_customizations/entry_point.html.

Test Plan

For all platforms:

PLATFORM=Linux64 # Replace with the target platform
mkdir -p "build${PLATFORM}"
cd "build${PLATFORM}"
cmake -GNinja .. \
  -DCMAKE_TOOLCHAIN_FILE="../cmake/platforms/${PLATFORM}.cmake"
ninja test_bitcoin

Run the Gitian builds twice and ensure the builds are still
deterministic.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_boost_unit_static
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8747
Build 15478: Bitcoin ABC Buildbot
Build 15477: arc lint + arc unit