gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::SerializationFixture Class Reference

Fixture class that handles temporary directory creation. More...

#include <serialization_fixture.hh>

Inheritance diagram for gem5::SerializationFixture:
CheckpointInFixture SerializableFixture

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
 

Private Attributes

std::string dirName = "/tmp/temp_dir_test_XXXXXX"
 The name of the temporary directory.
 

Detailed Description

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.

Todo
Ideally the checkpoints should not be necessarily using files, and stringstreams would be used instead to avoid overhead in the tests.

Definition at line 53 of file serialization_fixture.hh.

Member Function Documentation

◆ getCptPath()

std::string gem5::SerializationFixture::getCptPath ( ) const
inline

◆ getDirName()

std::string gem5::SerializationFixture::getDirName ( ) const
inline

Get the name of the directory we have created on SetUp.

Definition at line 63 of file serialization_fixture.hh.

References dirName.

Referenced by getCptPath(), and SerializableFixture::SetUp().

◆ SetUp()

void gem5::SerializationFixture::SetUp ( )
inlineoverride

Definition at line 86 of file serialization_fixture.hh.

References dirName.

Referenced by CheckpointInFixture::SetUp(), and SerializableFixture::SetUp().

◆ simulateSerialization()

void gem5::SerializationFixture::simulateSerialization ( std::string contents) const
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 78 of file serialization_fixture.hh.

References gem5::X86ISA::contents, and getCptPath().

◆ TearDown()

void gem5::SerializationFixture::TearDown ( )
inlineoverride

Definition at line 94 of file serialization_fixture.hh.

References dirName, and getCptPath().

Referenced by SerializableFixture::TearDown().

Member Data Documentation

◆ dirName

std::string gem5::SerializationFixture::dirName = "/tmp/temp_dir_test_XXXXXX"
private

The name of the temporary directory.

Definition at line 57 of file serialization_fixture.hh.

Referenced by getDirName(), SetUp(), and TearDown().


The documentation for this class was generated from the following file:

Generated on Mon May 26 2025 09:19:25 for gem5 by doxygen 1.13.2