hemocell
Loading...
Searching...
No Matches
Functions
hemo_test Namespace Reference

Functions

std::string & outputRoot ()
 
std::string testConfig (const std::string &path, const std::function< void(std::string &)> &edit=nullptr)
 A copy of the configuration file path whose output directory lies in outputRoot(), so that the tests do not write into the repository.
 
void replaceOnce (std::string &text, const std::string &from, const std::string &to)
 Replace the first from in text by to (a failed expectation if absent).
 

Function Documentation

◆ outputRoot()

std::string & hemo_test::outputRoot ( )
inline

Directory for everything the tests' simulations write (output, logs, checkpoints) and for the configuration copies of testConfig(); set by tests/main.cpp (one per run, in the GoogleTest temporary directory) and removed at the end of the run unless HEMOCELL_KEEP_TEST_OUTPUT is set.

◆ replaceOnce()

void hemo_test::replaceOnce ( std::string &  text,
const std::string &  from,
const std::string &  to 
)
inline

Replace the first from in text by to (a failed expectation if absent).

◆ testConfig()

std::string hemo_test::testConfig ( const std::string &  path,
const std::function< void(std::string &)> &  edit = nullptr 
)
inline

A copy of the configuration file path whose output directory lies in outputRoot(), so that the tests do not write into the repository.

The copy is private to this rank (its name contains the rank and a running number); the output directory is the same on all ranks, as HemoCell needs. Input paths in the file stay relative to the working directory.

Parameters
[in]pathconfiguration file, relative to the working directory
[in]editapplied to the text of the copy (e.g. to change a setting)
Returns
path of the copy