preCICE v3.2.0
|
contains the testing framework. More...
Namespaces | |
namespace | com |
namespace | inject |
Classes | |
struct | ConnectionOptions |
class | DataContextFixture |
struct | ParallelCouplingSchemeFixture |
struct | ParticipantState |
Represents a ParticipantState in a test. More... | |
class | precice_testsetup_fixture |
struct | QuickTest |
struct | Ranks |
struct | SerialCouplingSchemeFixture |
class | TestContext |
struct | TestSetup |
Contains the setup description of a test including participants and requirements. More... | |
class | WaveformFixture |
struct | WhiteboxAccessor |
struct giving access to the impl of a befriended class or struct More... | |
Typedefs | |
using | Par = utils::Parallel |
using | ErrorPredicate = std::function<bool(::precice::Error)> |
Enumerations | |
enum class | Require { PETSc , Events , Ginkgo } |
enum struct | ConnectionType { GatherScatter , PointToPoint } |
Functions | |
cplscheme::PtrCouplingData | makeCouplingData (mesh::PtrData data, mesh::PtrMesh mesh, bool exchangeSubsteps) |
cplscheme::PtrCouplingData | makeCouplingData (mesh::PtrData data, mesh::PtrMesh mesh) |
boost::unit_test::log_level | getBoostTestLogLevel () |
Boost test Initialization function. | |
std::string | filterFromLogLevel (boost::unit_test::log_level logLevel) |
void | setupTestLogging () |
void | addDummyVertices (size_t nVertices, mesh::Mesh &mesh) |
auto | makeDummy2DMesh (size_t nVertices) |
auto | makeDummy3DMesh (size_t nVertices) |
QuickTest::Mesh | operator""_mesh (const char *name, std::size_t) |
QuickTest::ReadData | operator""_read (const char *name, std::size_t) |
QuickTest::WriteData | operator""_write (const char *name, std::size_t) |
constexpr Ranks | operator""_ranks (unsigned long long value) |
constexpr Ranks | operator""_rank (unsigned long long value) |
constexpr ParticipantState | operator""_on (const char *name, std::size_t) |
User-defined literal allowing to create a serial ParticipantState from a given string. | |
DataID | operator""_dataID (unsigned long long n) |
std::string | getPathToRepository () |
Returns the base path of the repo. | |
std::string | getPathToSources () |
Returns the base path to the sources. | |
std::string | getPathToTests () |
Returns the base path to the integration tests. | |
std::string | getTestPath () |
Returns the full path to the file containing the current test. | |
std::string | getTestName () |
Returns the name of the current test. | |
std::string | getFullTestName () |
Return the full name of the current test as seen in boost assertions. | |
TestSetup | getTestSetup () |
Returns the registered TestSetup for the test. | |
std::optional< TestSetup > | getTestSetupFor (const boost::unit_test::test_unit &tu) |
Returns the registered TestSetup for a test if available. | |
int | nextMeshID () |
boost::test_tools::predicate_result | equals (const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance) |
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands on failure | |
boost::test_tools::predicate_result | equals (const std::vector< double > &VectorA, const std::vector< double > &VectorB, double tolerance) |
boost::test_tools::predicate_result | equals (float a, float b, float tolerance=math::NUMERICAL_ZERO_DIFFERENCE) |
equals to be used in tests. Compares two scalar numbers using a given tolerance. Prints both operands on failure | |
boost::test_tools::predicate_result | equals (double a, double b, double tolerance) |
void | expectFile (std::string_view name) |
ErrorPredicate | errorContains (std::string_view substring) |
Checks if the message of a given precice::Error contains a substring. | |
ErrorPredicate | errorMatches (std::string regex) |
Checks if the message of a given precice::Error matches a regex. | |
template<class DerivedA , class DerivedB > | |
boost::test_tools::predicate_result | equals (const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=math::NUMERICAL_ZERO_DIFFERENCE) |
equals to be used in tests. Compares two matrices using a given tolerance. Prints both operands on failure. | |
template<typename... ARGS> | |
auto | testSetup (ARGS... args) |
template<typename... Args> | |
void | expectFiles (Args... args) |
contains the testing framework.
using precice::testing::ErrorPredicate = std::function<bool(::precice::Error)> |
Definition at line 171 of file Testing.hpp.
using precice::testing::Par = utils::Parallel |
Definition at line 32 of file TestContext.cpp.
|
strong |
A type of distributed connection
Enumerator | |
---|---|
GatherScatter | |
PointToPoint |
Definition at line 151 of file TestContext.hpp.
|
strong |
Defines requirements for a test setup
Enumerator | |
---|---|
PETSc | Require to initialize PETSc. This implies the initialization of Events. |
Events | Require to initialize Event. |
Ginkgo | Ginkgo initialization. |
Definition at line 99 of file TestContext.hpp.
|
inline |
boost::test_tools::predicate_result precice::testing::equals | ( | const Eigen::MatrixBase< DerivedA > & | A, |
const Eigen::MatrixBase< DerivedB > & | B, | ||
double | tolerance = math::NUMERICAL_ZERO_DIFFERENCE ) |
equals to be used in tests. Compares two matrices using a given tolerance. Prints both operands on failure.
Definition at line 66 of file Testing.hpp.
boost::test_tools::predicate_result precice::testing::equals | ( | const std::vector< double > & | VectorA, |
const std::vector< double > & | VectorB, | ||
double | tolerance ) |
boost::test_tools::predicate_result precice::testing::equals | ( | const std::vector< float > & | VectorA, |
const std::vector< float > & | VectorB, | ||
float | tolerance ) |
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands on failure
Definition at line 93 of file Testing.cpp.
boost::test_tools::predicate_result precice::testing::equals | ( | double | a, |
double | b, | ||
double | tolerance ) |
boost::test_tools::predicate_result precice::testing::equals | ( | float | a, |
float | b, | ||
float | tolerance ) |
equals to be used in tests. Compares two scalar numbers using a given tolerance. Prints both operands on failure
Definition at line 117 of file Testing.cpp.
ErrorPredicate precice::testing::errorContains | ( | std::string_view | substring | ) |
Checks if the message of a given precice::Error contains a substring.
Definition at line 142 of file Testing.cpp.
ErrorPredicate precice::testing::errorMatches | ( | std::string | pattern | ) |
Checks if the message of a given precice::Error matches a regex.
Definition at line 150 of file Testing.cpp.
void precice::testing::expectFile | ( | std::string_view | name | ) |
void precice::testing::expectFiles | ( | Args... | args | ) |
std::string precice::testing::filterFromLogLevel | ( | boost::unit_test::log_level | logLevel | ) |
Definition at line 45 of file GlobalFixtures.cpp.
boost::unit_test::log_level precice::testing::getBoostTestLogLevel | ( | ) |
Boost test Initialization function.
Boost Test Log Levels and corresponding command line arguments to –log_level as of Boost 1.68:
Definition at line 34 of file GlobalFixtures.cpp.
std::string precice::testing::getFullTestName | ( | ) |
Return the full name of the current test as seen in boost assertions.
Definition at line 60 of file Testing.cpp.
std::string precice::testing::getPathToRepository | ( | ) |
Returns the base path of the repo.
Definition at line 27 of file Testing.cpp.
std::string precice::testing::getPathToSources | ( | ) |
Returns the base path to the sources.
Definition at line 33 of file Testing.cpp.
std::string precice::testing::getPathToTests | ( | ) |
Returns the base path to the integration tests.
Definition at line 38 of file Testing.cpp.
std::string precice::testing::getTestName | ( | ) |
Returns the name of the current test.
Definition at line 49 of file Testing.cpp.
std::string precice::testing::getTestPath | ( | ) |
Returns the full path to the file containing the current test.
Definition at line 43 of file Testing.cpp.
TestSetup precice::testing::getTestSetup | ( | ) |
Returns the registered TestSetup for the test.
Definition at line 65 of file Testing.cpp.
std::optional< TestSetup > precice::testing::getTestSetupFor | ( | const boost::unit_test::test_unit & | tu | ) |
Returns the registered TestSetup for a test if available.
Definition at line 74 of file Testing.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
int precice::testing::nextMeshID | ( | ) |
Generates a new mesh id for use in tests.
Definition at line 86 of file Testing.cpp.
DataID precice::testing::operator""_dataID | ( | unsigned long long | n | ) |
Definition at line 21 of file Testing.cpp.
|
inline |
Definition at line 153 of file QuickTest.hpp.
|
inlineconstexpr |
User-defined literal allowing to create a serial ParticipantState from a given string.
Definition at line 86 of file TestContext.hpp.
|
inlineconstexpr |
User-defined literal for expressively defining a single rank
[in] | value | the amount of ranks which has to be 1 |
Definition at line 40 of file TestContext.hpp.
|
inlineconstexpr |
User-defined literal for expressively defining multiple ranks
[in] | value | the amount of ranks <= 1 |
Definition at line 29 of file TestContext.hpp.
|
inline |
Definition at line 158 of file QuickTest.hpp.
|
inline |
Definition at line 163 of file QuickTest.hpp.
void precice::testing::setupTestLogging | ( | ) |
auto precice::testing::testSetup | ( | ARGS... | args | ) |
Definition at line 146 of file Testing.hpp.