Utilities for creating type lists for typed tests in Google Test. More...
#include "cudf_gtest.hpp"
Go to the source code of this file.
Classes | |
struct | cudf::test::AllSame |
Indicates if all types in a list are identical. More... | |
struct | cudf::test::ContainedIn< HAYSACK > |
Indicates if a type exists within a type list. More... | |
struct | cudf::test::Repeat< N > |
Transformation that repeats a type for a specified count. More... | |
Namespaces | |
cudf | |
cuDF interfaces | |
Typedefs | |
template<class TUPLE , int D> | |
using | cudf::test::GetType = typename GetTypeImpl< TUPLE, D >::type |
Gives the specified type from a type list. More... | |
template<class... T> | |
using | cudf::test::Concat = typename ConcatImpl< T... >::type |
Concatenates compile-time lists of types into a single type list. More... | |
template<class T > | |
using | cudf::test::Flatten = typename FlattenImpl< T >::type |
Flattens nested compile-time lists of types into a single list of types. More... | |
template<class... ARGS> | |
using | cudf::test::CrossProduct = typename CrossProductImpl< ARGS... >::type |
Creates a new type list from the cross product (cartesian product) of two type lists. More... | |
template<class PRED , class TUPLE > | |
using | cudf::test::RemoveIf = typename RemoveIfImpl< PRED, TUPLE >::type |
Removes types from a type list that satisfy a predicate. More... | |
template<class XFORM , class TYPES > | |
using | cudf::test::Transform = typename TransformImpl< XFORM, TYPES >::type |
Applies a transformation to every type in a type list. More... | |
template<class TYPES , class... ITEMS> | |
using | cudf::test::Append = typename AppendImpl< TYPES, ITEMS... >::type |
Appends types to a type list. More... | |
template<class TUPLE , int... IDXs> | |
using | cudf::test::Remove = typename RemoveImpl< TUPLE, IDXs... >::type |
Removes types at specified indices from a type list. More... | |
template<class TYPES > | |
using | cudf::test::Unique = typename UniqueImpl< TYPES >::type |
Removes duplicate types from a type list. More... | |
Variables | |
template<class TUPLE > | |
constexpr auto | cudf::test::GetSize = GetSizeImpl<TUPLE>::value |
Returns the size (number of elements) in a type list. More... | |
template<class NEEDLE , class HAYSACK > | |
constexpr bool | cudf::test::Exists = ExistsImpl<NEEDLE, HAYSACK>::value |
Indicates if a type exists within a type list. More... | |
Utilities for creating type lists for typed tests in Google Test.
A "type list" is a list of types passed to a Google Test type-parameterized test suite. The set of tests in the suite will be invoked once for each type in the list. Normally, this is done by using the testing::Types
struct
provided by GTest. For example,
The test mytest
will be invoked 3 times, once for each of the types int, char, float
.
Instead of using ::testing::Types directly, we provide cudf::test::Types
. This is a drop in replacement for GTest's ::testing::Types. In lieu of including gtest/gtest.h
, include cudf_gtest.hpp
to ensure cudf::test::Types
is used.
Using the utilities in this file, you can compose complex type lists.
For example, CrossProduct
may be used to compute the cross-product of two or more type lists:
RemoveIf can be used to remove some parameters that match a given predicate:
Definition in file type_list_utilities.hpp.
using cudf::test::Append = typedef typename AppendImpl<TYPES, ITEMS...>::type |
Appends types to a type list.
Example:
TYPES | The type list to append to |
ITEMS | The types to append |
Definition at line 539 of file type_list_utilities.hpp.
using cudf::test::Concat = typedef typename ConcatImpl<T...>::type |
Concatenates compile-time lists of types into a single type list.
Example:
Definition at line 185 of file type_list_utilities.hpp.
using cudf::test::CrossProduct = typedef typename CrossProductImpl<ARGS...>::type |
Creates a new type list from the cross product (cartesian product) of two type lists.
CrossProduct
of two type lists of size n
and m
, the resulting list will have n*m
types.Example:
Definition at line 288 of file type_list_utilities.hpp.
using cudf::test::Flatten = typedef typename FlattenImpl<T>::type |
Flattens nested compile-time lists of types into a single list of types.
Example:
Definition at line 220 of file type_list_utilities.hpp.
using cudf::test::GetType = typedef typename GetTypeImpl<TUPLE, D>::type |
Gives the specified type from a type list.
Example:
TUPLE | The type list |
D | Index of the desired type |
Definition at line 115 of file type_list_utilities.hpp.
using cudf::test::Remove = typedef typename RemoveImpl<TUPLE, IDXs...>::type |
Removes types at specified indices from a type list.
TUPLE | Type list to remove types from |
IDXs | Indices of types to remove |
Definition at line 585 of file type_list_utilities.hpp.
using cudf::test::RemoveIf = typedef typename RemoveIfImpl<PRED, TUPLE>::type |
Removes types from a type list that satisfy a predicate.
Possible predicates: AllSame
, ContainedIn
Example:
PRED | The predicate |
TUPLE | The list of types on which to apply the predicate |
Definition at line 441 of file type_list_utilities.hpp.
using cudf::test::Transform = typedef typename TransformImpl<XFORM, TYPES>::type |
Applies a transformation to every type in a type list.
Possible transformations: Repeat
Example:
XFORM | The transformation to apply |
TYPES | The list of types to transform |
Definition at line 470 of file type_list_utilities.hpp.
using cudf::test::Unique = typedef typename UniqueImpl<TYPES>::type |
Removes duplicate types from a type list.
Example:
TYPES | The type list from which to remove duplicates |
Definition at line 626 of file type_list_utilities.hpp.
|
constexpr |
Indicates if a type exists within a type list.
Example:
NEEDLE | The type to search for |
HAYSACK | The list to search in |
Definition at line 369 of file type_list_utilities.hpp.
|
constexpr |
Returns the size (number of elements) in a type list.
Example:
Definition at line 137 of file type_list_utilities.hpp.