Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5200: Working on getting the test environment to start up
- Loading branch information
1 parent
35ea168
commit 874b0b2
Showing
4 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#pragma once | ||
|
||
#include "module/ApplicationContextBase.h" | ||
#include "os/fs.h" | ||
#include "os/dir.h" | ||
|
||
namespace radiant | ||
{ | ||
|
||
/** | ||
* Application context implementation used in DarkRadiant's unit tests | ||
*/ | ||
class TestContext : | ||
public radiant::ApplicationContextBase | ||
{ | ||
private: | ||
std::string _settingsFolder; | ||
|
||
public: | ||
TestContext() | ||
{ | ||
// Set up the temporary settings folder | ||
auto settingsFolder = os::getTemporaryPath() / "dr_temp_settings"; | ||
|
||
_settingsFolder = settingsFolder.string(); | ||
|
||
os::removeDirectory(_settingsFolder); | ||
os::makeDirectory(_settingsFolder); | ||
} | ||
|
||
std::string getSettingsPath() const override | ||
{ | ||
return _settingsFolder; | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters