Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
Ase::Test Namespace Reference

Helper namespace for unit testing. More...

Classes

struct  IntegrityCheck
 
struct  TestEntry
 
class  Timer
 

Typedefs

using TestEntries = std::vector< TestEntry >
 

Enumerations

enum  Kind {
  PLAIN , SLOW , BENCH , BROKEN ,
  INTEGRITY
}
 

Functions

void test_output (int kind, const String &msg)
 
bool slow ()
 Indicates whether slow tests should be run.
 
bool verbose ()
 Indicates whether tests should run verbosely.
 
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.
 
double random_float ()
 Return random double for reproduceble tests.
 
double random_frange (double begin, double end)
 Return random double within range for reproduceble tests.
 
int run (const StringS &test_names)
 Run named tests.
 
int run ()
 Run all registered tests.
 
TestEntries list_tests ()
 
int run_test (const std::string &test_identifier)
 
String stringify_arg (const char *a, const char *str_a)
 == Stringify Args ==
 
template<class V >
String stringify_arg (const V *a, const char *str_a)
 
template<class A >
String stringify_arg (const A &a, const char *str_a)
 
template<>
String stringify_arg< float > (const float &a, const char *str_a)
 
template<>
String stringify_arg< double > (const double &a, const char *str_a)
 
template<>
String stringify_arg< bool > (const bool &a, const char *str_a)
 
template<>
String stringify_arg< int8 > (const int8 &a, const char *str_a)
 
template<>
String stringify_arg< int16 > (const int16 &a, const char *str_a)
 
template<>
String stringify_arg< int32 > (const int32 &a, const char *str_a)
 
template<>
String stringify_arg< int64 > (const int64 &a, const char *str_a)
 
template<>
String stringify_arg< uint8 > (const uint8 &a, const char *str_a)
 
template<>
String stringify_arg< uint16 > (const uint16 &a, const char *str_a)
 
template<>
String stringify_arg< uint32 > (const uint32 &a, const char *str_a)
 
template<>
String stringify_arg< uint64 > (const uint64 &a, const char *str_a)
 
template<>
String stringify_arg< String > (const String &a, const char *str_a)
 
const char_as_strptr (const char *s)
 

Detailed Description

Helper namespace for unit testing.

The Test namespace offers utilities for unit tests. The Test namespace is made available by #include <ase/testing.hh>
See also ase/testing.hh.

Typedef Documentation

◆ TestEntries

Definition at line 80 of file testing.hh.

Enumeration Type Documentation

◆ Kind

enum Ase::Test::Kind

Definition at line 66 of file testing.hh.

Function Documentation

◆ _as_strptr()

const char * Ase::Test::_as_strptr ( const char s)

Definition at line 107 of file testing.hh.

◆ list_tests()

TestEntries Ase::Test::list_tests ( )

Definition at line 272 of file testing.cc.

◆ random_float()

double Ase::Test::random_float ( )

Return random double for reproduceble tests.

Definition at line 197 of file testing.cc.

References Ase::random_float().

◆ random_frange()

double Ase::Test::random_frange ( double  begin,
double  end 
)

Return random double within range for reproduceble tests.

Definition at line 203 of file testing.cc.

References Ase::random_frange().

◆ random_int64()

uint64_t Ase::Test::random_int64 ( )

Return random int for reproduceble tests.

Definition at line 185 of file testing.cc.

References Ase::random_int64().

◆ random_irange()

int64_t Ase::Test::random_irange ( int64_t  begin,
int64_t  end 
)

Return random int within range for reproduceble tests.

Definition at line 191 of file testing.cc.

References Ase::random_irange().

◆ run() [1/2]

int Ase::Test::run ( void  )

Run all registered tests.

Definition at line 264 of file testing.cc.

References run().

◆ run() [2/2]

int Ase::Test::run ( const StringS test_names)

Run named tests.

Definition at line 256 of file testing.cc.

References run().

Referenced by run(), and run().

◆ run_test()

int Ase::Test::run_test ( const std::string test_identifier)

Definition at line 306 of file testing.cc.

◆ slow()

bool Ase::Test::slow ( )

Indicates whether slow tests should be run.

Definition at line 171 of file testing.cc.

References getenv(), Ase::string_option_find_value(), and Ase::string_to_bool().

◆ stringify_arg() [1/3]

template<class A >
String Ase::Test::stringify_arg ( const A &  a,
const char str_a 
)

Definition at line 94 of file testing.hh.

◆ stringify_arg() [2/3]

String Ase::Test::stringify_arg ( const char a,
const char str_a 
)

== Stringify Args ==

Definition at line 92 of file testing.hh.

References Ase::string_format().

◆ stringify_arg() [3/3]

template<class V >
String Ase::Test::stringify_arg ( const V *  a,
const char str_a 
)

Definition at line 93 of file testing.hh.

◆ stringify_arg< bool >()

template<>
String Ase::Test::stringify_arg< bool > ( const bool a,
const char str_a 
)

Definition at line 97 of file testing.hh.

◆ stringify_arg< double >()

template<>
String Ase::Test::stringify_arg< double > ( const double a,
const char str_a 
)

Definition at line 96 of file testing.hh.

◆ stringify_arg< float >()

template<>
String Ase::Test::stringify_arg< float > ( const float a,
const char str_a 
)

Definition at line 95 of file testing.hh.

◆ stringify_arg< int16 >()

template<>
String Ase::Test::stringify_arg< int16 > ( const int16 a,
const char str_a 
)

Definition at line 99 of file testing.hh.

◆ stringify_arg< int32 >()

template<>
String Ase::Test::stringify_arg< int32 > ( const int32 a,
const char str_a 
)

Definition at line 100 of file testing.hh.

◆ stringify_arg< int64 >()

template<>
String Ase::Test::stringify_arg< int64 > ( const int64 a,
const char str_a 
)

Definition at line 101 of file testing.hh.

◆ stringify_arg< int8 >()

template<>
String Ase::Test::stringify_arg< int8 > ( const int8 a,
const char str_a 
)

Definition at line 98 of file testing.hh.

◆ stringify_arg< String >()

template<>
String Ase::Test::stringify_arg< String > ( const String a,
const char str_a 
)

Definition at line 106 of file testing.hh.

◆ stringify_arg< uint16 >()

template<>
String Ase::Test::stringify_arg< uint16 > ( const uint16 a,
const char str_a 
)

Definition at line 103 of file testing.hh.

◆ stringify_arg< uint32 >()

template<>
String Ase::Test::stringify_arg< uint32 > ( const uint32 a,
const char str_a 
)

Definition at line 104 of file testing.hh.

◆ stringify_arg< uint64 >()

template<>
String Ase::Test::stringify_arg< uint64 > ( const uint64 a,
const char str_a 
)

Definition at line 105 of file testing.hh.

◆ stringify_arg< uint8 >()

template<>
String Ase::Test::stringify_arg< uint8 > ( const uint8 a,
const char str_a 
)

Definition at line 102 of file testing.hh.

◆ test_output()

void Ase::Test::test_output ( int  kind,
const String msg 
)

Definition at line 119 of file testing.cc.

◆ verbose()

bool Ase::Test::verbose ( )

Indicates whether tests should run verbosely.

Definition at line 178 of file testing.cc.

References getenv(), Ase::string_option_find_value(), and Ase::string_to_bool().