Page MenuHomePhabricator

test: Log to debug.log in all tests

Authored by Fabien on Tue, Mar 24, 14:17.


This makes it easier to debug a frozen test or a test that failed. To
debug a failed test, remove the line fs::remove_all(m_path_root);.

The pull is done in three commits:

 - Create a datadir for every unit test once (and only once). This
requires the SetDataDir function to go away.
 - Use the common setup in the gui unit tests. Some of those tests are
testing the init sequence, so we'd have to undo some of what the testing
setup did.
 - Log to the debug.log in all tests

Backport of core PR16252 and PR16289 (bugfix).

Depends on D5553.

This fixes the debug.log failure when running test_bitcoin-qt.exe on Windows.

Test Plan
ninja check

Check the /tmp/test_common_Bitcoin\ ABC/ dir is created.

Run test_bitcoin-qt.exe on Windows, it should return no error.

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Tue, Mar 24, 14:17
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Mar 24, 14:17
teamcity edited the summary of this revision. (Show Details)Tue, Mar 24, 14:17

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Fabien edited the summary of this revision. (Show Details)Tue, Mar 24, 14:35
Fabien edited the test plan for this revision. (Show Details)
jasonbcox accepted this revision.Wed, Mar 25, 19:13
This revision is now accepted and ready to land.Wed, Mar 25, 19:13
This revision was automatically updated to reflect the committed changes.