lumiera_/tests/vault/gear/scheduler-commutator-test.cpp
Ichthyostega 862933e809 Scheduler: define API for Layer-2
Notably both Layers are conceived as functionality providers;
only at Scheduler top-Level will functionality be combined with
external dependencies to create the actual service.
2023-10-17 19:20:53 +02:00

157 lines
4.1 KiB
C++

/*
SchedulerCommutator(Test) - verify dependent activity processing in the scheduler
Copyright (C) Lumiera.org
2023, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
/** @file scheduler-commutator-test.cpp
** unit test \ref SchedulerCommutator_test
*/
#include "lib/test/run.hpp"
#include "activity-detector.hpp"
#include "vault/gear/scheduler-commutator.hpp"
#include "lib/time/timevalue.hpp"
#include "lib/format-cout.hpp"
//#include "lib/util.hpp"
//#include <utility>
using test::Test;
//using std::move;
//using util::isSameObject;
namespace vault{
namespace gear {
namespace test {
// using lib::time::FrameRate;
// using lib::time::Offset;
using lib::time::Time;
/******************************************************************//**
* @test Scheduler Layer-2: dependency notification and triggering.
* @see SchedulerActivity_test
* @see SchedulerUsage_test
*/
class SchedulerCommutator_test : public Test
{
virtual void
run (Arg)
{
demonstrateSimpleUsage();
verify_GroomingToken();
verify_DispatchDecision();
verify_findWork();
verify_postDispatch();
integratedWorkCycle();
}
/** @test TODO demonstrate a simple usage scenario
* @todo WIP 10/23 ✔ define ⟶ 🔁 implement
*/
void
demonstrateSimpleUsage()
{
SchedulerInvocation queues;
SchedulerCommutator sched;
Activity activity;
Time when{1,2,3};
// prepare scenario: some activity is enqueued
queues.instruct (activity, when);
// use the ActivityDetector for test instrumentation...
ActivityDetector detector;
sched.postDispatch (sched.findWork(queues), detector.executionCtx);
cout << detector.showLog()<<endl; // HINT: use this for investigation...
}
/** @test TODO verify logic to control concurrent execution
* @todo WIP 10/23 🔁 define ⟶ implement
*/
void
verify_GroomingToken()
{
}
/** @test TODO verify the decision logic where and when
* to perform the dispatch of an Scheduler Activity chain.
* @todo WIP 10/23 🔁 define ⟶ implement
*/
void
verify_DispatchDecision()
{
UNIMPLEMENTED ("DispatchDecision");
}
/** @test TODO verify logic of queue updates and work prioritisation.
* @todo WIP 10/23 🔁 define ⟶ implement
*/
void
verify_findWork()
{
UNIMPLEMENTED ("findWork");
}
/** @test TODO verify entrance point for performing an Activity chain.
* @todo WIP 10/23 🔁 define ⟶ implement
*/
void
verify_postDispatch()
{
UNIMPLEMENTED ("postDispatch");
}
/** @test TODO build the integrated sequence of worker activation
* @todo WIP 10/23 🔁 define ⟶ implement
*/
void
integratedWorkCycle()
{
UNIMPLEMENTED ("integratedWorkCycle");
}
};
/** Register this test class... */
LAUNCHER (SchedulerCommutator_test, "unit engine");
}}} // namespace vault::gear::test