You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifying this argument overrides the path location for test_bitcoin;
it becomes <datadir>/test_common_Bitcoin Core/<testname>/datadir. Also,
this directory isn't removed after the test completes. This can make it
easier for developers to study the results of a test (see the state of
the data directory after the test runs), and also (for example) have an
editor open on debug.log to monitor it across multiple test runs instead
of having to re-open a different pathname each time.
Example usage (note the "--" is needed):
test_bitcoin --run_test=getarg_tests/boolarg -- \
-testdatadir=/somewhere/mydatadir
This will create (if necessary) and use the data directory:
/somewhere/mydatadir/test_common_Bitcoin Core/getarg_tests/boolarg/datadir
Co-authored-by: furszy <[email protected]>
// Try to obtain the lock; if unsuccessful don't disturb the existing test.
165
+
TryCreateDirectories(m_path_lock);
166
+
if (util::LockDirectory(m_path_lock, ".lock", /*probe_only=*/false) != util::LockResult::Success) {
167
+
ExitFailure("Cannot obtain a lock on test data lock directory " + fs::PathToString(m_path_lock) + '\n' + "The test executable is probably already running.");
168
+
}
169
+
170
+
// Always start with a fresh data directory; this doesn't delete the .lock file located one level above.
171
+
fs::remove_all(m_path_root);
172
+
if (!TryCreateDirectories(m_path_root)) ExitFailure("Cannot create test data directory");
173
+
174
+
// Print the test directory name if custom.
175
+
std::cout << "Test directory (will not be deleted): " << m_path_root << std::endl;
0 commit comments