30using std::this_thread::sleep_for;
31using std::chrono_literals::operator
""us;
47 auto isOdd = [](
auto val) {
return bool (val % 2); };
62 typedef std::vector<uint>
VecI;
104 CHECK (0 == Marker::access());
107 CHECK (0 == Marker::access());
110 CHECK (1 == Marker::access());
115 CHECK (1 == Marker::access());
118 CHECK (2 == Marker::access());
123 loggedValues = Marker::extractStack();
125 CHECK (1 == Marker::access());
127 CHECK (0 == Marker::access());
129 CHECK (3 == loggedValues.size());
130 CHECK (2 == loggedValues[0]);
131 CHECK (1 == loggedValues[1]);
132 CHECK (0 == loggedValues[2]);
157 auto verifyResult = [](
VecI sequence)
160 for (
uint val : sequence)
162 CHECK (isOdd(val) and val > prev);
167 std::array<TestThread, NUM_THREADS> testcases;
173 for (
auto& res : results)
188 ,[seed = 1+
rani(MAX_RAND)]
197 return Marker::extractStack();
204 return descend (current+1);
207 return descend (current/2);
Diagnostic data frame to collect specific information concerning a scope.
Variant of the standard case, requiring to wait and join() on the termination of this thread.
lib::Result< RES > join()
put the caller into a blocking wait until this thread has terminated
void verify_simpleAccess()
void verify_heavilyParallelUsage()
static VecI descend(uint current)
Facility for collecting diagnostic context information explicitly.
Building tree expanding and backtracking evaluations within hierarchical scopes.
DiagnosticContext< uint > Marker
Subject of this test: a thread-local stack of int values.
Implementation namespace for support and library code.
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
int rani(uint bound=_iBOUND())
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Build a call stack within separate thread and capture diagnostics.
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.