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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
testing.hh File Reference
#include <ase/utils.hh>
#include <ase/strings.hh>

Go to the source code of this file.

Classes

class  Ase::Test::Timer
 
struct  Ase::Test::TestEntry
 

Namespaces

namespace  Ase
 The Anklang C++ API namespace.
 
namespace  Ase::Test
 Helper namespace for unit testing.
 

Macros

#define TSTART(...)
 Print message once a test case starts.
 
#define TDONE()
 Print message for test case end.
 
#define TPASS(...)
 Print a message about a passing test.
 
#define TBENCH(...)
 Print a message about a passing benchmark.
 
#define TNOTE(...)
 Print a message from a test program.
 
#define TCHECK(cond, ...)
 Verbose assertion, calls TPASS() on success./*#end#*‍/.
 
#define TCMPS(a, cmp, b)
 Variant of TCMP() for C strings.
 
#define TCMP(a, cmp, b)
 Compare a and b according to operator cmp, verbose on failiure.
 
#define TASSERT(cond)
 Unconditional test assertion, enters breakpoint if not fullfilled.
 
#define TASSERT_AT(LINE, cond)
 Unconditional test assertion for deputy LINE.
 
#define TOK()
 
#define TFLOATS(a, b, eps)
 Test floats for equality while ignoring differences smaller than eps.
 
#define TEST_ADD(fun)
 Register a function to run as part of the unit test suite.
 
#define TEST_SLOW(fun)
 
#define TEST_BENCH(fun)
 
#define TEST_BROKEN(fun)
 

Typedefs

using Ase::Test::TestEntries = std::vector< TestEntry >
 

Enumerations

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

Functions

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

Macro Definition Documentation

◆ TASSERT

#define TASSERT (   cond)

Unconditional test assertion, enters breakpoint if not fullfilled.

Definition at line 24 of file testing.hh.

◆ TASSERT_AT

#define TASSERT_AT (   LINE,
  cond 
)

Unconditional test assertion for deputy LINE.

Definition at line 25 of file testing.hh.

◆ TBENCH

#define TBENCH (   ...)

Print a message about a passing benchmark.

Definition at line 17 of file testing.hh.

◆ TCHECK

#define TCHECK (   cond,
  ... 
)

Verbose assertion, calls TPASS() on success./*#end#*‍/.

Definition at line 21 of file testing.hh.

◆ TCMP

#define TCMP (   a,
  cmp,
 
)

Compare a and b according to operator cmp, verbose on failiure.

Definition at line 23 of file testing.hh.

◆ TCMPS

#define TCMPS (   a,
  cmp,
 
)

Variant of TCMP() for C strings.

Definition at line 22 of file testing.hh.

◆ TDONE

#define TDONE ( )

Print message for test case end.

Definition at line 15 of file testing.hh.

◆ TEST_ADD

#define TEST_ADD (   fun)

Register a function to run as part of the unit test suite.

Definition at line 31 of file testing.hh.

◆ TEST_BENCH

#define TEST_BENCH (   fun)

Definition at line 33 of file testing.hh.

◆ TEST_BROKEN

#define TEST_BROKEN (   fun)

Definition at line 34 of file testing.hh.

◆ TEST_SLOW

#define TEST_SLOW (   fun)

Definition at line 32 of file testing.hh.

◆ TFLOATS

#define TFLOATS (   a,
  b,
  eps 
)

Test floats for equality while ignoring differences smaller than eps.

Definition at line 28 of file testing.hh.

◆ TNOTE

#define TNOTE (   ...)

Print a message from a test program.

Definition at line 18 of file testing.hh.

◆ TOK

#define TOK ( )

Deprecated progress indicator, tests generally need to run fast.

Definition at line 26 of file testing.hh.

◆ TPASS

#define TPASS (   ...)

Print a message about a passing test.

Definition at line 16 of file testing.hh.

◆ TSTART

#define TSTART (   ...)

Print message once a test case starts.

Definition at line 14 of file testing.hh.