Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
testing.hh File Reference

Classes

struct TestEntry
class Timer

Namespaces

namespace Ase
namespace Ase::Test

Macros

#defineTASSERT(cond)
#defineTASSERT_AT(LINE, cond)
#defineTBENCH(...)
#defineTCHECK(cond, ...)
#defineTCMP(a, cmp, b)
#defineTCMPS(a, cmp, b)
#defineTDONE()
#defineTEST_ADD(fun)
#defineTEST_BENCH(fun)
#defineTEST_BROKEN(fun)
#defineTEST_SLOW(fun)
#defineTFLOATS(a, b, eps)
#defineTNOTE(...)
#defineTOK()
#defineTPASS(...)
#defineTSTART(...)

Typedefs

usingTestEntries = std::vector< TestEntry >

Enumerations

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

Functions

const char *_as_strptr (const char *s)
TestEntrieslist_tests ()
doublerandom_float ()
doublerandom_frange (double begin, double end)
uint64_trandom_int64 ()
int64_trandom_irange (int64_t begin, int64_t end)
intrun ()
intrun (const StringS &test_names)
intrun_test (const std::string &test_identifier)
boolslow ()
template<class A >
Stringstringify_arg (const A &a, const char *str_a)
Stringstringify_arg (const char *a, const char *str_a)
template<class V >
Stringstringify_arg (const V *a, const char *str_a)
template<>
Stringstringify_arg< bool > (const bool &a, const char *str_a)
template<>
Stringstringify_arg< double > (const double &a, const char *str_a)
template<>
Stringstringify_arg< float > (const float &a, const char *str_a)
template<>
Stringstringify_arg< int16 > (const int16 &a, const char *str_a)
template<>
Stringstringify_arg< int32 > (const int32 &a, const char *str_a)
template<>
Stringstringify_arg< int64 > (const int64 &a, const char *str_a)
template<>
Stringstringify_arg< int8 > (const int8 &a, const char *str_a)
template<>
Stringstringify_arg< String > (const String &a, const char *str_a)
template<>
Stringstringify_arg< uint16 > (const uint16 &a, const char *str_a)
template<>
Stringstringify_arg< uint32 > (const uint32 &a, const char *str_a)
template<>
Stringstringify_arg< uint64 > (const uint64 &a, const char *str_a)
template<>
Stringstringify_arg< uint8 > (const uint8 &a, const char *str_a)
voidtest_output (int kind, const String &msg)
boolverbose ()

Macro Definition Documentation

TSTART

#define TSTART ( ...)

Print message once a test case starts.

TDONE

#define TDONE ( )

Print message for test case end.

TPASS

#define TPASS ( ...)

Print a message about a passing test.

TBENCH

#define TBENCH ( ...)

Print a message about a passing benchmark.

TNOTE

#define TNOTE ( ...)

Print a message from a test program.

TCHECK

#define TCHECK ( cond,
...
)

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

TCMPS

#define TCMPS ( a,
cmp,
b
)

Variant of TCMP() for C strings.

TCMP

#define TCMP ( a,
cmp,
b
)

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

TASSERT

#define TASSERT ( cond)

Unconditional test assertion, enters breakpoint if not fullfilled.

TASSERT_AT

#define TASSERT_AT ( LINE,
cond
)

Unconditional test assertion for deputy __LINE__.

TOK

#define TOK ( )

Deprecated progress indicator, tests generally need to run fast.

TFLOATS

#define TFLOATS ( a,
b,
eps
)

Test floats for equality while ignoring differences smaller than `eps`.

TEST_ADD

#define TEST_ADD ( fun)

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

TEST_SLOW

#define TEST_SLOW ( fun)

TEST_BENCH

#define TEST_BENCH ( fun)

TEST_BROKEN

#define TEST_BROKEN ( fun)