60 return util::join (std::forward<II> (ii),
"-");
107 Time nominalTime = lib::test::randTime();
108 int additionalKey = rand() % 5000;
111 MockJob mockJob{nominalTime, additionalKey};
112 mockJob.triggerJob();
113 CHECK (MockJob::was_invoked (mockJob));
114 CHECK (RealClock::wasRecently (MockJob::invocationTime (mockJob)));
115 CHECK (nominalTime == MockJob::invocationNominalTime (mockJob) );
116 CHECK (additionalKey == MockJob::invocationAdditionalKey(mockJob));
120 .attrib (
"start",
Time{0,10}
141 CHECK (123 == MockJob::invocationAdditionalKey (jobM));
142 CHECK (555 == MockJob::invocationAdditionalKey (jobP));
148 CHECK (dispatcher.
verify(jobD, port1, sink1));
166 .transform([&](FrameCnt frameNr)
168 return grid->timeOf (frameNr);
171 ==
"200ms-240ms-280ms-320ms-360ms-400ms-440ms-480ms"_expect);
178 dispatcher.forCalcStream(timings)
179 .timeRange(
Time{200,0},
Time{500,0})
181 ==
"200ms-240ms-280ms-320ms-360ms-400ms-440ms-480ms"_expect);
196 .timeRange(
Time{200,0},
Time{300,0})
199 CHECK (not isnil (pipeline));
200 CHECK (pipeline->isTopLevel());
203 Job job = ticket.createJobFor(Time::ZERO);
204 CHECK (dispatcher.
verify(job, port, sink));
230 auto [port,sink] = dispatcher.getDummyConnection(0);
231 auto pipeline = dispatcher.forCalcStream (timings)
232 .timeRange(
Time{200,0},
Time{300,0})
234 .expandPrerequisites();
237 CHECK (not isnil (pipeline));
238 CHECK (pipeline->isTopLevel());
239 Job job = pipeline->ticket().createJobFor (Time::ZERO);
240 CHECK (11 == job.parameter.invoKey.part.a);
242 auto visualise = [](
auto& pipeline) ->
string 244 Time frame{pipeline.currPoint};
245 Job job = pipeline->ticket().createJobFor(frame);
246 TimeValue nominalTime{job.parameter.nominalTime};
247 int32_t mark = job.parameter.invoKey.part.a;
248 return _Fmt{
"J(%d|%s)"} % mark % nominalTime;
250 CHECK (visualise(pipeline) ==
"J(11|200ms)"_expect);
252 CHECK (
materialise (pipeline.transform (visualise))
253 ==
"J(11|200ms)-J(22|200ms)-J(11|240ms)-J(22|240ms)-J(11|280ms)-J(22|280ms)"_expect);
282 .attrib(
"start",
Time{250,0})
297 auto [port,sink] = dispatcher.getDummyConnection(0);
298 auto pipeline = dispatcher.forCalcStream (timings)
299 .timeRange(
Time{200,0},
Time{300,0})
301 .expandPrerequisites()
306 CHECK (not isnil (pipeline));
307 CHECK (pipeline->isTopLevel());
309 CHECK (5 == pipeline.currFrameNr());
310 CHECK (not pipeline.isBefore (
Time{200,0}));
311 CHECK ( pipeline.isBefore (
Time{220,0}));
313 Job job = pipeline.buildJob();
314 CHECK (
Time(200,0) == job.parameter.nominalTime);
315 CHECK (11 == job.parameter.invoKey.part.a);
317 auto visualise = [](
auto& pipeline) ->
string 319 Job job = pipeline.buildJob();
320 TimeValue nominalTime{job.parameter.nominalTime};
321 int32_t mark = job.parameter.invoKey.part.a;
322 TimeValue deadline{pipeline.determineDeadline()};
323 return _Fmt{
"J(%d|%s⧐%s)"}
324 % mark % nominalTime % deadline;
326 CHECK (visualise(pipeline) ==
"J(11|200ms⧐1s180ms)"_expect);
330 .transform(visualise)
332 ==
"J(11|200ms⧐1s180ms)-J(22|200ms⧐1s150ms)-J(33|200ms⧐1s110ms)-" 333 "J(11|240ms⧐1s220ms)-J(22|240ms⧐1s190ms)-J(33|240ms⧐1s150ms)-" 334 "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.
NumIter< INT > eachNum(INT start, INT end)
convenience function to iterate "each number"
Framerate specified as frames per second.
Generic frame timing specification.
A mocked frame Dispatcher setup without any backing model.
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.
Simple test class runner.
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.
Job createJobFor(Time nominalTime)
Core operation: build a concrete render job based on this blueprint.