spies.hpp File Reference
#include <atria/meta/utils.hpp>
#include <ableton/build_system/Warnings.hpp>
#include <boost/variant/static_visitor.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/optional.hpp>
#include <unordered_set>
#include <typeindex>
#include <functional>
#include <memory>

Go to the source code of this file.

Classes

class  variant_spy
 Class for spying on functions that take a variant as a parameter. More...
 
struct  variant_spy::all_variants
 
struct  defaulting< T >
 
struct  returning< T >
 
class  spy_fn< MockT >
 Functor that counts the number of times it was called. More...
 
struct  copy_spy< BaseT >
 Utility for testing how many times an object is copied. More...
 

Namespaces

 atria
 C++ amazing templates and reusable implementations awesomeness.
 
 atria::testing
 Testing tools, like spies, for modern C++ development.
 

Functions

template<typename Fn >
auto spy (const Fn &fn) -> spy_fn< Fn >
 Returns a spy object that uses fn as mock implementation. More...
 
auto spy () -> spy_fn<>
 Returns a spy object with a no-op mock implementation. More...
 
template<typename MockT >
auto spy_on (MockT &mock) -> spy_fn< detail::scoped_intruder< MockT > >
 Given a functor object mock of a general functor with type erasure (e.g. More...
 
template<typename MockT , typename FnT >
auto spy_on (MockT &mock, const FnT &replacement) -> spy_fn< detail::scoped_intruder< MockT > >
 Like spy_on(), but it installs the replacement function instead of keeping the original one. More...
 
Fork me on GitHub