gem5 v24.0.0.0
|
Fixture class that handles temporary directory creation. More...
#include <serialization_fixture.hh>
Public Member Functions | |
std::string | getDirName () const |
Get the name of the directory we have created on SetUp. | |
std::string | getCptPath () const |
Get the path to the checkpoint file. | |
void | simulateSerialization (std::string contents) const |
Create a cpt file with the contents specified by the string. | |
void | SetUp () override |
void | TearDown () override |
Static Public Member Functions | |
static std::string | generateTempDirName () |
Generate a temporary directory name. | |
Private Attributes | |
std::string | dirName |
The name of the temporary directory. | |
Static Private Attributes | |
static unsigned | dirNumber = 0 |
Temporary directory names are generated based on this number, which is updated every time the generator function is called. | |
Fixture class that handles temporary directory creation.
These temporary directories are used by the tests in this file, in order to avoid that a failed test will not remove its directory, causing future runs to fail. This has been tailored for checkpoints, so it expects that the directory may contain a cpt file on removal.
Definition at line 52 of file serialization_fixture.hh.
|
inlinestatic |
Generate a temporary directory name.
Definition at line 69 of file serialization_fixture.hh.
References dirNumber.
|
inline |
Get the path to the checkpoint file.
Definition at line 79 of file serialization_fixture.hh.
References gem5::CheckpointIn::baseFilename, and getDirName().
Referenced by CheckpointInFixture::SetUp(), SerializableFixture::SetUp(), simulateSerialization(), TearDown(), and SerializableFixture::TearDown().
|
inline |
Get the name of the directory we have created on SetUp.
Definition at line 75 of file serialization_fixture.hh.
References dirName.
Referenced by getCptPath(), and SerializableFixture::SetUp().
|
inlineoverride |
Definition at line 98 of file serialization_fixture.hh.
References dirName, and generateTempDirName().
Referenced by CheckpointInFixture::SetUp(), and SerializableFixture::SetUp().
|
inline |
Create a cpt file with the contents specified by the string.
This function should be used when testing unserialization, since it simulates a previous serialization.
Definition at line 90 of file serialization_fixture.hh.
References gem5::X86ISA::contents, and getCptPath().
|
inlineoverride |
Definition at line 107 of file serialization_fixture.hh.
References dirName, and getCptPath().
Referenced by SerializableFixture::TearDown().
|
private |
The name of the temporary directory.
Definition at line 62 of file serialization_fixture.hh.
Referenced by getDirName(), SetUp(), and TearDown().
|
staticprivate |
Temporary directory names are generated based on this number, which is updated every time the generator function is called.
Definition at line 59 of file serialization_fixture.hh.
Referenced by generateTempDirName().