mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Use temp folder for Env test sqlite files:
* Moved empty path check to DatabaseCon, and only for non-standalone. * No more "DummyForUnitTest" files getting left behind in repo after running unit tests.
This commit is contained in:
committed by
Vinnie Falco
parent
1320898fbe
commit
48e0466a2b
@@ -62,6 +62,11 @@ DatabaseCon::Setup setup_DatabaseCon (Config const& c)
|
||||
setup.startUp = c.START_UP;
|
||||
setup.standAlone = c.RUN_STANDALONE;
|
||||
setup.dataDir = c.legacy ("database_path");
|
||||
if (!setup.standAlone && setup.dataDir.empty())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"database_path must be set.");
|
||||
}
|
||||
|
||||
return setup;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ getSociSqliteInit (std::string const& name,
|
||||
std::string const& dir,
|
||||
std::string const& ext)
|
||||
{
|
||||
if (dir.empty () || name.empty ())
|
||||
if (name.empty ())
|
||||
{
|
||||
Throw<std::runtime_error> (
|
||||
"Sqlite databases must specify a dir and a name. Name: " +
|
||||
|
||||
@@ -59,7 +59,7 @@ setupConfigForUnitTests (Config& config)
|
||||
config.overwrite (ConfigSection::nodeDatabase (), "path", "main");
|
||||
|
||||
config.deprecatedClearSection (ConfigSection::importNodeDatabase ());
|
||||
config.legacy("database_path", "DummyForUnitTests");
|
||||
config.legacy("database_path", "");
|
||||
|
||||
config.RUN_STANDALONE = true;
|
||||
config["server"].append("port_peer");
|
||||
|
||||
Reference in New Issue
Block a user