Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

unittests: add a runner to execute all unittests

We'll soon have multiple unit tests, add a runner that will
discover all of them and execute all tests.

It was opted to discover only files that starts with "test",
as this way unittest discover won't try adding libraries or
other stuff that might not contain unittest classes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <2d9dd14f03d3d6394346fdaceeb3167d54d1dd0c.1773770483.git.mchehab+huawei@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
bd167a21 5f6fc8ed

+17
+17
tools/unittests/run.py
··· 1 + #!/bin/env python3 2 + import os 3 + import unittest 4 + import sys 5 + 6 + TOOLS_DIR=os.path.join(os.path.dirname(os.path.realpath(__file__)), "..") 7 + sys.path.insert(0, TOOLS_DIR) 8 + 9 + from lib.python.unittest_helper import TestUnits 10 + 11 + if __name__ == "__main__": 12 + loader = unittest.TestLoader() 13 + 14 + suite = loader.discover(start_dir=os.path.join(TOOLS_DIR, "unittests"), 15 + pattern="test*.py") 16 + 17 + TestUnits().run("", suite=suite)