boostorg / boostorg/test

TestRunner Scenario not possible with auto-link. [1.73]

Open
#273 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

Description

Hey everyone,
I am using a test scenario where we build DLLs containing the tests with a custom init_unit_test function. For this we want to dynamically link to Boost.Test and thus are defining BOOST_TEST_DYN_LINK as can be seen in the [documentation](https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/boost_test/adv_scenarios/external_test_runner.html).

The DLL does not need a main so BOOST_TEST_MAIN is not being defined. We are using the console_test_runner which is also dynamically linked to run our tests.

The issue:

As per this commit: https://github.com/boostorg/test/commit/961646222e4cf0eb475a86667a71ce89e4994d5c BOOST_TEST_MAIN has to be defined for auto linking to work. This is not the case when using a test_runner scenario.

Defining BOOST_TEST_MAIN and BOOST_TEST_NO_MAIN as a workaround does not work because now init_unit_test is defined twice.

Am I missing a piece of documentation for this to work?

BOOST 1.73 on MSVC v142

Best,
Faaux

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the external_test_runner documentation, the referenced auto-link commit, and the console_test_runner scenario described in the issue. Trace how BOOST_TEST_MAIN, BOOST_TEST_NO_MAIN, BOOST_TEST_DYN_LINK, and init_unit_test interact for the MSVC setup. Done means the scenario has a confirmed supported configuration or a clear documented limitation and workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.