51 return util::join (std::forward<II> (ii),
"-");
99 Time nominalTime = lib::test::randTime();
100 int additionalKey =
rani(5000);
103 MockJob mockJob{nominalTime, additionalKey};
104 mockJob.triggerJob();
105 CHECK (MockJob::was_invoked (mockJob));
106 CHECK (RealClock::wasRecently (MockJob::invocationTime (mockJob)));
107 CHECK (nominalTime == MockJob::invocationNominalTime (mockJob) );
108 CHECK (additionalKey == MockJob::invocationAdditionalKey(mockJob));
112 .attrib (
"start",
Time{0,10}
133 CHECK (123 == MockJob::invocationAdditionalKey (jobM));
134 CHECK (555 == MockJob::invocationAdditionalKey (jobP));
140 CHECK (dispatcher.
verify(jobD, port1, sink1));
158 .transform([&](FrameCnt frameNr)
160 return grid->timeOf (frameNr);
163 ==
"200ms-240ms-280ms-320ms-360ms-400ms-440ms-480ms"_expect);
170 dispatcher.forCalcStream(timings)
171 .timeRange(
Time{200,0},
Time{500,0})
173 ==
"200ms-240ms-280ms-320ms-360ms-400ms-440ms-480ms"_expect);
188 .timeRange(
Time{200,0},
Time{300,0})
191 CHECK (not isnil (pipeline));
192 CHECK (pipeline->isTopLevel());
195 Job job = ticket.createJobFor(Time::ZERO);
196 CHECK (dispatcher.
verify(job, port, sink));
222 auto [port,sink] = dispatcher.getDummyConnection(0);
223 auto pipeline = dispatcher.forCalcStream (timings)
224 .timeRange(
Time{200,0},
Time{300,0})
226 .expandPrerequisites();
229 CHECK (not isnil (pipeline));
230 CHECK (pipeline->isTopLevel());
231 Job job = pipeline->ticket().createJobFor (Time::ZERO);
232 CHECK (11 == job.parameter.invoKey.part.a);
234 auto visualise = [](
auto& pipeline) ->
string 236 Time frame{pipeline.currPoint};
237 Job job = pipeline->ticket().createJobFor(frame);
238 TimeValue nominalTime{job.parameter.nominalTime};
239 int32_t mark = job.parameter.invoKey.part.a;
240 return _Fmt{
"J(%d|%s)"} % mark % nominalTime;
242 CHECK (visualise(pipeline) ==
"J(11|200ms)"_expect);
244 CHECK (
materialise (pipeline.transform (visualise))
245 ==
"J(11|200ms)-J(22|200ms)-J(11|240ms)-J(22|240ms)-J(11|280ms)-J(22|280ms)"_expect);
274 .attrib(
"start",
Time{250,0})
289 auto [port,sink] = dispatcher.getDummyConnection(0);
290 auto pipeline = dispatcher.forCalcStream (timings)
291 .timeRange(
Time{200,0},
Time{300,0})
293 .expandPrerequisites()
298 CHECK (not isnil (pipeline));
299 CHECK (pipeline->isTopLevel());
301 CHECK (5 == pipeline.currFrameNr());
302 CHECK (not pipeline.isBefore (
Time{200,0}));
303 CHECK ( pipeline.isBefore (
Time{220,0}));
305 Job job = pipeline.buildJob();
306 CHECK (
Time(200,0) == job.parameter.nominalTime);
307 CHECK (11 == job.parameter.invoKey.part.a);
309 auto visualise = [](
auto& pipeline) ->
string 311 Job job = pipeline.buildJob();
312 TimeValue nominalTime{job.parameter.nominalTime};
313 int32_t mark = job.parameter.invoKey.part.a;
314 TimeValue deadline{pipeline.determineDeadline()};
315 return _Fmt{
"J(%d|%s⧐%s)"}
316 % mark % nominalTime % deadline;
318 CHECK (visualise(pipeline) ==
"J(11|200ms⧐1s180ms)"_expect);
322 .transform(visualise)
324 ==
"J(11|200ms⧐1s180ms)-J(22|200ms⧐1s150ms)-J(33|200ms⧐1s110ms)-" 325 "J(11|240ms⧐1s220ms)-J(22|240ms⧐1s190ms)-J(33|240ms⧐1s150ms)-" 326 "J(44|280ms⧐1s200ms)-J(66|280ms⧐1s140ms)-J(55|280ms⧐1s130ms)"_expect);
void demonstrateScaffolding()
string materialise(II &&ii)
Diagnostic helper: join all the elements from some given container or iterable.
Mock data structures to support implementation testing of render job planning and frame dispatch...
void accessTopLevelJobTicket()
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
Framerate specified as frames per second.
Generic frame timing specification.
A mocked frame Dispatcher setup without any backing model.
int rani(uint bound=_iBOUND())
engine::JobTicket & jobTicket(size_t portNr) const
Access the JobTicket for this segment and the given portNr.
Mock setup for a render Job with NO action but built-in diagnostics.
play::test::DummyOutputLink getDummyConnection(uint index)
The faked builder/playback setup provides some preconfigured ModelPort and corresponding DataSink han...
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
Lumiera's internal time value datatype.
Abstract Base Class for all testcases.
PipelineBuilder< PipeFrameTick > forCalcStream(Timings timings)
Start a builder sequence to assemble a job-planning pipeline, backed by this Dispatcher.
bool verify(Job const &job, ModelPort const &port, play::DataSink const &sink)
Test support: verify the given Job is consistent with this Dispatcher.
Simplistic test class runner.
void seedRand()
draw a new random seed from a common nucleus, and re-seed the default-Gen.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Mock setup for a complete Segmentation to emulate the structure of the actual fixture, without the need of building a low-level Model.
A collection of frequently used helper functions to support unit testing.
static bool isAssociated(Job const &, JobTicket const &)
convenience shortcut to perform this test on arbitrary JobTicket and Job instances.
For the purpose of building and rendering, the fixture (for each timeline) is partitioned such that e...
void buildBaseTickGenerator()
Duration is the internal Lumiera time metric.
Job createJobFor(size_t portIDX, TimeValue nominalTime)
Convenience shortcut for tests: JobTicket ⟼ Job.
Building tree expanding and backtracking evaluations within hierarchical scopes.
Individual frame rendering task, forwarding to a closure.
basic constant internal time value.
auto getPrerequisites()
Core operation: iterate over the prerequisites, required to carry out a render operation based on thi...
Simple stand-alone Quantiser implementation based on a constant sized gird.
static const FrameRate PAL
predefined constant for PAL framerate
execution plan for pulling a specific exit node.
NumIter< INT > eachNum(INT start=std::numeric_limits< INT >::min(), INT end=std::numeric_limits< INT >::max())
convenience function to iterate "each number"
Job createJobFor(Time nominalTime)
Core operation: build a concrete render job based on this blueprint.