Skip to content

Commit 2ac5ba2

Browse files
committed
Merge bitcoin#31083: doc: add doxygen for m_args in tests
1fe1b3b doc: doxygen comment for m_args usage in tests (willcl-ark) Pull request description: Closes: bitcoin#25055 Add a doxygen comment to the `m_args` member in the unit test framework, clarifying its purpose and providing usage guidelines. ACKs for top commit: maflcko: lgtm ACK 1fe1b3b brunoerg: ACK 1fe1b3b Tree-SHA512: 9b8dc30e3b0d26c0cecec4599dc5addca519965603073d02f37fa0a46c488659958e327d9c25da8acdb4bb9b082a64455baaffb406ac11827d7f56a094522fce
2 parents 48cf3da + 1fe1b3b commit 2ac5ba2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/util/setup_common.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ struct BasicTestingSetup {
7575
fs::path m_path_root;
7676
fs::path m_path_lock;
7777
bool m_has_custom_datadir{false};
78+
/** @brief Test-specific arguments and settings.
79+
*
80+
* This member is intended to be the primary source of settings for code
81+
* being tested by unit tests. It exists to make tests more self-contained
82+
* and reduce reliance on global state.
83+
*
84+
* Usage guidelines:
85+
* 1. Prefer using m_args where possible in test code.
86+
* 2. If m_args is not accessible, use m_node.args as a fallback.
87+
* 3. Avoid direct references to gArgs in test code.
88+
*
89+
* Note: Currently, m_node.args points to gArgs for backwards
90+
* compatibility. In the future, it will point to m_args to further isolate
91+
* test environments.
92+
*
93+
* @see https://github.com/bitcoin/bitcoin/issues/25055 for additional context.
94+
*/
7895
ArgsManager m_args;
7996
};
8097

0 commit comments

Comments
 (0)