27using std::this_thread::sleep_for;
28using namespace std::chrono_literals;
34 using error::LUMIERA_ERROR_LOGIC;
41 #define Type(_EXPR_) lib::test::showType<decltype(_EXPR_)>()
72 ,[]{ sleep_for (10ms); }};
75 CHECK (not theThread);
85 if (DESTRUCTION_CODE == secretValue)
87 , LUMIERA_ERROR_SPECIAL};
89 return secretValue+42;
96 int mySecret =
rani(1000);
103 CHECK (mySecret+42 == theThread.join());
112 ,
this, DESTRUCTION_CODE};
115 auto res = theThread.join();
116 CHECK (
Type(res) ==
"Result<int>"_expect);
119 CHECK (not res.isValid());
129 ,[]{ sleep_for (10ms); }};
Variant of the standard case, requiring to wait and join() on the termination of this thread.
int theAction(int secretValue)
Abstract Base Class for all testcases.
void seedRand()
draw a new random seed from a common nucleus, and re-seed the default-Gen.
#define LUMIERA_ERROR_DEFINE(err, msg)
Definition and initialisation of an error constant.
Lumiera error handling (C++ interface).
const int DESTRUCTION_CODE
Implementation namespace for support and library code.
int rani(uint bound=_iBOUND())
LumieraError< LERR_(EXTERNAL)> External
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Convenience front-end to simplify and codify basic thread handling.