Page MenuHomePhabricator

test: Log to debug.log in all tests
ClosedPublic

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

Details

Summary
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

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[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 test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Mar 25 2020, 19:13
This revision was automatically updated to reflect the committed changes.