Namespace Ase::Test
Namespace List > Ase > Test
Helper namespace for unit testing. More...
Classes
Type | Name |
---|---|
struct | IntegrityCheck |
struct | TestEntry |
class | Timer |
Public Types
Type | Name |
---|---|
enum | Kind |
typedef std::vector< TestEntry > | TestEntries |
Public Static Attributes
Type | Name |
---|---|
const TestChain * | global_test_chain = = NULL |
__thread String * | thread_test_start = = NULL |
Public Functions
Type | Name |
---|---|
const char * | _as_strptr (const char * s) |
TestEntries | list_tests () |
double | random_float () Return random double for reproduceble tests. |
double | random_frange (double begin, double end) Return random double within range for reproduceble tests. |
uint64_t | random_int64 () Return random int for reproduceble tests. |
int64_t | random_irange (int64_t begin, int64_t end) Return random int within range for reproduceble tests. |
int | run (const StringS & test_names) Run named tests. |
int | run (void) Run all registered tests. |
int | run_test (const std::string & test_identifier) |
bool | slow () Indicates whether slow tests should be run. |
String | stringify_arg (const char * a, const char * str_a) == Stringify Args == |
String | stringify_arg (const V * a, const char * str_a) |
String | stringify_arg (const A & a, const char * str_a) |
String | stringify_arg< String > (const String & a, const char * str_a) |
String | stringify_arg< bool > (const bool & a, const char * str_a) |
String | stringify_arg< double > (const double & a, const char * str_a) |
String | stringify_arg< float > (const float & a, const char * str_a) |
String | stringify_arg< int16 > (const int16 & a, const char * str_a) |
String | stringify_arg< int32 > (const int32 & a, const char * str_a) |
String | stringify_arg< int64 > (const int64 & a, const char * str_a) |
String | stringify_arg< int8 > (const int8 & a, const char * str_a) |
String | stringify_arg< uint16 > (const uint16 & a, const char * str_a) |
String | stringify_arg< uint32 > (const uint32 & a, const char * str_a) |
String | stringify_arg< uint64 > (const uint64 & a, const char * str_a) |
String | stringify_arg< uint8 > (const uint8 & a, const char * str_a) |
void | test_output (int kind, const String & msg) |
bool | verbose () Indicates whether tests should run verbosely. |
Public Static Functions
Type | Name |
---|---|
String | ensure_newline (const String & s) |
bool | match_testname (const std::string & name, const StringS & test_names) |
Detailed Description
The Test namespace offers utilities for unit tests. The Test namespace is made available by #include <ase/testing.hh>
See also ase/testing.hh.
Public Types Documentation
enum Kind
enum Ase::Test::Kind {
PLAIN = 0,
SLOW = 1,
BENCH = 2,
BROKEN = 4,
INTEGRITY = 8
};
typedef TestEntries
using Ase::Test::TestEntries = typedef std::vector<TestEntry>;
Public Static Attributes Documentation
variable global_test_chain
const TestChain* Ase::Test::global_test_chain;
variable thread_test_start
__thread String* Ase::Test::thread_test_start;
Public Functions Documentation
function _as_strptr
inline const char * Ase::Test::_as_strptr (
const char * s
)
function list_tests
TestEntries Ase::Test::list_tests ()
function random_float
double Ase::Test::random_float ()
function random_frange
double Ase::Test::random_frange (
double begin,
double end
)
function random_int64
uint64_t Ase::Test::random_int64 ()
function random_irange
int64_t Ase::Test::random_irange (
int64_t begin,
int64_t end
)
function run
int Ase::Test::run (
const StringS & test_names
)
function run
int Ase::Test::run (
void
)
function run_test
int Ase::Test::run_test (
const std::string & test_identifier
)
function slow
bool Ase::Test::slow ()
function stringify_arg
inline String Ase::Test::stringify_arg (
const char * a,
const char * str_a
)
function stringify_arg
template<class V>
inline String Ase::Test::stringify_arg (
const V * a,
const char * str_a
)
function stringify_arg
template<class A>
inline String Ase::Test::stringify_arg (
const A & a,
const char * str_a
)
function stringify_arg< String >
template<>
inline String Ase::Test::stringify_arg< String > (
const String & a,
const char * str_a
)
function stringify_arg< bool >
template<>
inline String Ase::Test::stringify_arg< bool > (
const bool & a,
const char * str_a
)
function stringify_arg< double >
template<>
inline String Ase::Test::stringify_arg< double > (
const double & a,
const char * str_a
)
function stringify_arg< float >
template<>
inline String Ase::Test::stringify_arg< float > (
const float & a,
const char * str_a
)
function stringify_arg< int16 >
template<>
inline String Ase::Test::stringify_arg< int16 > (
const int16 & a,
const char * str_a
)
function stringify_arg< int32 >
template<>
inline String Ase::Test::stringify_arg< int32 > (
const int32 & a,
const char * str_a
)
function stringify_arg< int64 >
template<>
inline String Ase::Test::stringify_arg< int64 > (
const int64 & a,
const char * str_a
)
function stringify_arg< int8 >
template<>
inline String Ase::Test::stringify_arg< int8 > (
const int8 & a,
const char * str_a
)
function stringify_arg< uint16 >
template<>
inline String Ase::Test::stringify_arg< uint16 > (
const uint16 & a,
const char * str_a
)
function stringify_arg< uint32 >
template<>
inline String Ase::Test::stringify_arg< uint32 > (
const uint32 & a,
const char * str_a
)
function stringify_arg< uint64 >
template<>
inline String Ase::Test::stringify_arg< uint64 > (
const uint64 & a,
const char * str_a
)
function stringify_arg< uint8 >
template<>
inline String Ase::Test::stringify_arg< uint8 > (
const uint8 & a,
const char * str_a
)
function test_output
void Ase::Test::test_output (
int kind,
const String & msg
)
function verbose
bool Ase::Test::verbose ()
Public Static Functions Documentation
function ensure_newline
static String Ase::Test::ensure_newline (
const String & s
)
function match_testname
static bool Ase::Test::match_testname (
const std::string & name,
const StringS & test_names
)
The documentation for this class was generated from the following file /__w/anklang/anklang/ase/internal.hh