Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Namespaces | Defines | Enumerations | Functions
testutils.hh File Reference
#include <rcore/rcore.hh>

Go to the source code of this file.

Classes

class  Rapicorn::Test::Timer
 Class for profiling benchmark tests. More...
class  Rapicorn::Test::RegisterTest

Namespaces

namespace  Rapicorn
 

The Rapicorn namespace encompasses core utilities and toolkit functionality.


namespace  Rapicorn::Test
 

The Test namespace offers utilities for unit tests.


Defines

#define TTITLE(...)
 Print out the test program title.
#define TSTART(...)
 Print message once a test case starts.
#define TDONE()
 Print message for test case end.
#define TOUT(...)
 Test output for verbose mode, like fputs().
#define TMSG(...)
 Unconditional test message.
#define TINFO(...)
 Conditional test message (for verbose mode).
#define TWARN(...)
 Issue a non-fatal test warning.
#define TOK()
 Indicator for successful test progress.
#define TASSERT(cond)
 Unconditional test assertion, enters breakpoint if not fullfilled.
#define TASSERT_AT(LINE, cond)
 Unconditional test assertion for deputy __LINE__.
#define TCMP(a, cmp, b)
 Compare a and b according to operator cmp.
#define TCMPS(a, cmp, b)
 Variant of TCMP() for C strings.
#define TASSERT__AT(LINE, cond)
#define TCMP_op(a, cmp, b, sa, sb, cast)
#define REGISTER_TEST(name,...)
 Register a standard test function for execution as unit test.
#define REGISTER_SLOWTEST(name,...)
 Register a slow test function for execution as during slow unit testing.
#define REGISTER_LOGTEST(name,...)
 Register a logging test function for output recording and verification.

Enumerations

enum  TrapFlags { TRAP_INHERIT_STDIN, TRAP_SILENCE_STDOUT, TRAP_SILENCE_STDERR, TRAP_NO_FATAL_SYSLOG }
enum  Rapicorn::Test::ModeType { Rapicorn::Test::MODE_TESTING, Rapicorn::Test::MODE_VERBOSE, Rapicorn::Test::MODE_READOUT, Rapicorn::Test::MODE_SLOW }

Functions

void Rapicorn::init_core_test (const String &app_ident, int *argcp, char **argv, const StringVector &args)
 Initialize the Rapicorn toolkit core for a test program.
int Rapicorn::Test::run (void)
 Run all registered tests.
bool Rapicorn::Test::verbose (void)
 Indicates whether tests should run verbosely.
bool Rapicorn::Test::logging (void)
 Indicates whether only logging tests should be run.
bool Rapicorn::Test::slow (void)
 Indicates whether only slow tests should be run.
bool Rapicorn::Test::ui_test (void)
 Indicates execution of ui-thread tests.
void Rapicorn::Test::set_assertion_hook (const std::function< void()> &hook)
 Install hook tobe called when assertions fail.
void Rapicorn::Test::assertion_failed (const char *file, int line, const char *message)
 Internal function for failing assertions.
String Rapicorn::Test::stringify_arg (const char *a, const char *str_a)
template<class V >
String Rapicorn::Test::stringify_arg (const V *a, const char *str_a)
template<class A >
String Rapicorn::Test::stringify_arg (const A &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< float > (const float &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< double > (const double &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< bool > (const bool &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< int8 > (const int8 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< int16 > (const int16 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< int32 > (const int32 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< int64 > (const int64 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< uint8 > (const uint8 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< uint16 > (const uint16 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< uint32 > (const uint32 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< uint64 > (const uint64 &a, const char *str_a)
template<>
String Rapicorn::Test::stringify_arg< String > (const String &a, const char *str_a)
const charRapicorn::Test::_as_strptr (const char *s)
char Rapicorn::Test::rand_bit (void)
 Return a random bit.
int32 Rapicorn::Test::rand_int (void)
 Return random int.
int32 Rapicorn::Test::rand_int_range (int32 begin, int32 end)
 Return random int within range.
double Rapicorn::Test::test_rand_double (void)
 Return random double.
double Rapicorn::Test::test_rand_double_range (double range_start, double range_end)
 Return random double within range.
bool Rapicorn::Test::trap_fork (uint64 usec_timeout, uint test_trap_flags)
bool Rapicorn::Test::trap_fork_silent ()
bool Rapicorn::Test::trap_timed_out ()
bool Rapicorn::Test::trap_passed ()
bool Rapicorn::Test::trap_aborted ()
bool Rapicorn::Test::trap_sigtrap ()
String Rapicorn::Test::trap_stdout ()
String Rapicorn::Test::trap_stderr ()

Detailed Description

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines