| 249 | } |
| 250 | |
| 251 | BasicTestingSetup::~BasicTestingSetup() |
| 252 | { |
| 253 | m_node.ecc_context.reset(); |
| 254 | m_node.kernel.reset(); |
| 255 | if (!EnableFuzzDeterminism()) { |
| 256 | SetMockTime(0s); // Reset mocktime for following tests |
| 257 | } |
| 258 | LogInstance().DisconnectTestLogger(); |
| 259 | if (m_has_custom_datadir) { |
| 260 | // Only remove the lock file, preserve the data directory. |
| 261 | UnlockDirectory(m_path_lock, ".lock"); |
| 262 | fs::remove(m_path_lock / ".lock"); |
| 263 | } else { |
| 264 | fs::remove_all(m_path_root); |
| 265 | } |
| 266 | // Clear all arguments except for -datadir, which GUI tests currently rely |
| 267 | // on to be set even after the testing setup is destroyed. |
| 268 | gArgs.ClearArgs(); |
| 269 | gArgs.ForceSetArg("-datadir", fs::PathToString(m_path_root)); |
| 270 | } |
| 271 | |
| 272 | ChainTestingSetup::ChainTestingSetup(const ChainType chainType, TestOpts opts) |
| 273 | : BasicTestingSetup(chainType, opts) |
nothing calls this directly
no test coverage detected