Utopia  2
Framework for studying models of complex & adaptive systems.
Classes | Functions
Utopia::TestTools Namespace Reference

Classes

struct  BaseInfrastructure
 A base class for an infrastructure fixture. More...
 
struct  LocationInfo
 Bundles and handles file location information: file path and line number. More...
 

Functions

template<typename Callable = std::function<void(const DataIO::Config&)>>
void test_config_callable (Callable &&func, const DataIO::Config &test_cases, const std::string_view context_name="", const LocationInfo loc={})
 Repeatedly invokes a unary function that expects a Config node. More...
 
template<typename ExcT , typename Callable = std::function<void()>>
void check_exception (Callable &&func, const std::string_view match="", const LocationInfo loc={})
 Checks if a callable throws with the expected error type and message. More...
 
bool contains (const std::string_view s, const std::string_view match)
 Returns true if the match string is contained within the given string. More...
 
std::ostream & operator<< (std::ostream &out, const LocationInfo &loc)
 Overload for allowing LocationInfo output streams. More...
 

Function Documentation

◆ contains()

bool Utopia::TestTools::contains ( const std::string_view  s,
const std::string_view  match 
)

Returns true if the match string is contained within the given string.

◆ operator<<()

std::ostream& Utopia::TestTools::operator<< ( std::ostream &  out,
const LocationInfo loc 
)

Overload for allowing LocationInfo output streams.