30 using std::this_thread::sleep_for;
31 using std::chrono_literals::operator
""us;
44 const uint NUM_THREADS = 75;
45 const uint MAX_RAND = 100*1000;
47 auto isOdd = [](
auto val) {
return bool (val % 2); };
62 typedef std::vector<uint> VecI;
85 verify_simpleAccess();
86 verify_heavilyParallelUsage();
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)]
189 {
return descend (seed); }}
194 descend (uint current)
203 Marker remember(current);
204 return descend (current+1);
207 return descend (current/2);
Variant of the standard case, requiring to wait and join() on the termination of this thread...
Build a call stack within separate thread and capture diagnostics.
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
Facility for collecting diagnostic context information explicitly.
void verify_simpleAccess()
int rani(uint bound=_iBOUND())
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Implementation namespace for support and library code.
ThreadJoinable(string const &, FUN &&, ARGS &&...) -> ThreadJoinable< std::invoke_result_t< FUN, ARGS... >>
deduction guide: find out about result value to capture from a generic callable.
Simplistic test class runner.
lib::Result< RES > join()
put the caller into a blocking wait until this thread has terminated
Convenience front-end to simplify and codify basic thread handling.
A collection of frequently used helper functions to support unit testing.
Diagnostic data frame to collect specific information concerning a scope.
ExampleStrategy::Qualifier two(string additionalArg)
definition of another qualifier two(arg), accepting an additional argument
static DiagnosticContext & access()
accessing the innermost diagnostic context created
Building tree expanding and backtracking evaluations within hierarchical scopes.
ExampleStrategy::Qualifier one()
definition of a qualifier one()
void verify_heavilyParallelUsage()
static ValSequence extractStack()
snapshot of the current stack of diagnostic frames