2#ifndef STORMM_TEST_ENVIRONMENT_H
3#define STORMM_TEST_ENVIRONMENT_H
8#include "Constants/behavior.h"
9#include "Namelists/command_line_parser.h"
10#include "unit_test_enumerators.h"
15using constants::ExceptionResponse;
16using namelist::CommandLineParser;
38 TmpdirStatus tmpdir_required = TmpdirStatus::NOT_REQUIRED,
39 ExceptionResponse policy = ExceptionResponse::WARN);
42 TmpdirStatus tmpdir_required = TmpdirStatus::NOT_REQUIRED,
43 ExceptionResponse policy = ExceptionResponse::WARN);
45 TestEnvironment(
int argc,
const char* argv[], ExceptionResponse policy);
132 TestVerbosity verbose_level;
136 double general_tolerance;
143 std::string stormm_home_path;
146 std::string stormm_source_path;
150 std::string tmpdir_path;
159 bool tmpdir_writeable;
164 std::vector<std::string> files_created;
167 std::vector<std::string> directories_created;
174 bool do_intensive_tests;
180 SnapshotOperation snapshot_behavior;
A class for collecting command line information. The class object will function somewhat like a namel...
Definition command_line_parser.h:30
double getTolerance() const
Get the general tolerance that can be applied in blanket fashion across many tests....
Definition test_environment.cpp:344
std::vector< std::string > getListOfFilesCreated() const
Get the list of files that this test program has been given responsibility. It will assume that these...
Definition test_environment.cpp:379
void logFileCreated(const std::string &path)
Catalog that a file has been created by the program. This function will not actually check that the f...
Definition test_environment.cpp:399
std::string getStormmSourcePath() const
Get the STORMM source root path.
Definition test_environment.cpp:359
bool getTemporaryDirectoryAccess() const
Check whether the temporary directory is accessible to the program.
Definition test_environment.cpp:369
TestEnvironment(int argc, const char *argv[], CommandLineParser *clip, TmpdirStatus tmpdir_required=TmpdirStatus::NOT_REQUIRED, ExceptionResponse policy=ExceptionResponse::WARN)
The TestEnvironment constructor takes command line arguments but also searches for native environment...
Definition test_environment.cpp:32
bool getDisplayTimingsOrder() const
Return the directive on displaying timings at the end of a test program.
Definition test_environment.cpp:389
SnapshotOperation takeSnapshot() const
Return whether to record a snapshot of the current data into the named file, or compare the data to a...
Definition test_environment.cpp:384
bool doIntensiveTests() const
Get the directives as to intensive unit test execution.
Definition test_environment.cpp:374
void logDirectoryCreated(const std::string &path)
Catalog that a directory has been created by the program. As above, this function will take the devel...
Definition test_environment.cpp:416
void setFileRemoval(const bool remove_files_in)
Set the file removal flag.
Definition test_environment.cpp:394
TestVerbosity getVerbosity() const
Get the verbosity level requested for this test environment.
Definition test_environment.cpp:339
int getRandomSeed() const
Get the random seed from the test environment. Separate random seeds can be supplied to any random nu...
Definition test_environment.cpp:349
std::string getStormmHomePath() const
Get the STORMM home (test executable and installed library) path.
Definition test_environment.cpp:354
~TestEnvironment()
Destructor for the TestEnvironment object must delete the temporary directory if it was created by th...
Definition test_environment.cpp:320
std::string getTemporaryDirectoryPath() const
Get the temporary directory path that the test environment can use to store files.
Definition test_environment.cpp:364