On 09/03/26 09:20, Gabriele Monaco wrote:
> On Fri, 2026-03-06 at 17:10 +0100, Juri Lelli wrote:
> > Add the foundational infrastructure for SCHED_DEADLINE scheduler tests
> > following the pattern established by sched_ext selftests. This provides
> > a clean, extensible framework for testing SCHED_DEADLINE functionality.
> > 
> > The framework uses ELF constructors for automatic test registration,
> > allowing new tests to be added simply by defining a struct dl_test and
> > calling REGISTER_DL_TEST(). The runner discovers all registered tests
> > at runtime and executes them serially, providing a simple and consistent
> > way to expand test coverage without modifying the test runner itself.
> > 
> > The framework provides a complete test lifecycle with setup, run, and
> > cleanup phases for each test. Tests can be filtered by name, listed for
> > inspection, or run in quiet mode for automated testing environments. The
> > framework includes assertion macros such as DL_EQ and DL_FAIL_IF to
> > simplify test authoring and provide consistent error reporting. Signal
> > handling ensures graceful interruption and cleanup when tests are
> > terminated early.
> > 
> > This commit establishes the framework without any actual tests. Tests
> > will be added in subsequent patches. The framework design is inspired by
> > tools/testing/selftests/sched_ext/ but tailored for SCHED_DEADLINE
> > testing needs.
> > 
> > Assisted-by: Claude Code: claude-sonnet-4-5@20250929
> > Signed-off-by: Juri Lelli <[email protected]>
> > ---
> >  tools/testing/selftests/sched/deadline/.gitignore |   3 +
> >  tools/testing/selftests/sched/deadline/Makefile   |  34 ++++
> >  tools/testing/selftests/sched/deadline/dl_test.h  | 238
> > ++++++++++++++++++++++
> >  tools/testing/selftests/sched/deadline/runner.c   | 219 
> > ++++++++++++++++++++
> >  4 files changed, 494 insertions(+)
> > 
> 
> I wonder if this runner couldn't be made generic, something like not 
> mentioning
> DL in any of the helpers, keep runner.c in tools/testing/selftests/sched/ and
> have a tools/testing/selftests/sched/deadline/Makefile glue all required 
> objects
> together for the deadline tests (or anything else).
> 
> That would probably make adding new tests much easier without code 
> duplication.

Yeah, guess we can do that. I started this with DEADLINE in mind, but if
people think the infra might be of help for adding tests for other
classes/policies, we can definitely restructure as you suggest.

Thanks for taking a look!

Best,
Juri


Reply via email to