HomePhabricator

Refactor TestFramework main() into setup/shutdown

Description

Refactor TestFramework main() into setup/shutdown

Summary:

Setup and shutdown code now moved into dedicated methods. Test "success" is added as a BitcoinTestFramework member, which can be accessed outside of main.
Argument parsing also moved into separate method and called from main.

In our codebase, set_test_params() is called in main() rather than in __init__ because we want parser options to be available during test setup (D1974).

This is a backport of Core PR17288 [2/7]
https://github.com/bitcoin/bitcoin/pull/17288/commits/6b71241291a184c9ee197bf5f0c7e1414417a0a0

Depends on D8241

Test Plan: ninja && ninja check-functional

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8242

Details

Provenance
JamesC <james.chiangwu@gmail.com>Authored on Nov 3 2020, 13:10
PiRKCommitted on Nov 3 2020, 13:10
abc-botPushed on Nov 3 2020, 13:16
Reviewer
Restricted Owners Package
Differential Revision
D8242: Refactor TestFramework main() into setup/shutdown
Parents
rABCa8b03bcc4505: Minor refactoring to remove implied m_addr_relay_peer.
Branches
Unknown
Tags
Unknown