Belle II Software  release-08-01-10
TempDirCreator Class Reference

changes working directory into a newly created directory, and removes it (and contents) on destruction. More...

#include <TestHelpers.h>

Collaboration diagram for TempDirCreator:

Public Member Functions

 TempDirCreator ()
 ctor.
 
 ~TempDirCreator ()
 dtor.
 
std::string getTempDir () const
 Returns path of temporary directory.
 

Private Attributes

std::string m_oldpwd
 previous working directory.
 
std::string m_tmpdir
 path of temporary director.
 

Detailed Description

changes working directory into a newly created directory, and removes it (and contents) on destruction.

Example:

TEST(MyTest, TestThatCreatesFiles)
{
TestHelpers::TempDirCreator tempdir;
//create files here ... (automatically cleaned up at end of scope)
}
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.

Definition at line 66 of file TestHelpers.h.


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