2#include <boost/test/framework.hpp>
3#include <boost/test/tree/test_unit.hpp>
12#include "testing/SourceLocation.hpp"
19DataID operator"" _dataID(
unsigned long long n)
22 return static_cast<DataID>(n);
28 return precice::testing::SourceLocation;
43 const auto &cspan = boost::unit_test::framework::current_test_case().p_file_name;
44 return {cspan.
begin(), cspan.end()};
49 std::string name = boost::unit_test::framework::current_test_case().p_name;
54 auto parent = boost::unit_test::framework::current_test_case().p_parent_id;
55 return boost::unit_test::framework::get<boost::unit_test::test_suite>(parent).p_name;
70 Eigen::MatrixXd MatrixA(VectorA.
size(), 1);
72 Eigen::MatrixXd MatrixB(VectorB.
size(), 1);
74 return equals(MatrixA, MatrixB, tolerance);
82 Eigen::MatrixXd MatrixA(VectorA.
size(), 1);
84 Eigen::MatrixXd MatrixB(VectorB.
size(), 1);
86 return equals(MatrixA, MatrixB, tolerance);
89boost::test_tools::predicate_result
equals(
float a,
float b,
float tolerance)
92 boost::test_tools::predicate_result res(
false);
93 res.message() <<
"Not equal: " << a <<
"!=" << b;
99boost::test_tools::predicate_result
equals(
double a,
double b,
double tolerance)
102 boost::test_tools::predicate_result res(
false);
103 res.message() <<
"Not equal: " << a <<
"!=" << b;
#define PRECICE_ASSERT(...)
This class provides a lightweight logger.
Manages a set of unique IDs.
constexpr bool equals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares two Eigen::MatrixBase for equality up to tolerance.
contains the testing framework.
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 o...
std::string getPathToRepository()
Returns the base path of the repo.
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 getPathToTests()
Returns the base path to the integration tests.
std::string getPathToSources()
Returns the base path to the sources.
static precice::logging::Logger _log("precicec")