mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
test-gdb: allow running just one test
This commit is contained in:
@@ -11892,7 +11892,7 @@ Sources:
|
|||||||
* link:build-test-gdb[]
|
* link:build-test-gdb[]
|
||||||
* link:test-gdb[]
|
* link:test-gdb[]
|
||||||
|
|
||||||
If something goes wrong, re-run the test commands manually and use `--verbose` to understand what happened:
|
If a test fails, re-run the test commands manually and use `--verbose` to understand what happened:
|
||||||
|
|
||||||
....
|
....
|
||||||
./run --arch arm --background --baremetal add --wait-gdb &
|
./run --arch arm --background --baremetal add --wait-gdb &
|
||||||
|
|||||||
35
test-gdb
35
test-gdb
@@ -6,23 +6,38 @@ import os
|
|||||||
import common
|
import common
|
||||||
|
|
||||||
class Main(common.LkmcCliFunction):
|
class Main(common.LkmcCliFunction):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.add_argument(
|
||||||
|
'tests',
|
||||||
|
metavar='tests',
|
||||||
|
nargs='*',
|
||||||
|
help='''\
|
||||||
|
If given, run only the given tests. Otherwise, run all tests,
|
||||||
|
found by searching for the Python test files.
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
|
||||||
def timed_main(self):
|
def timed_main(self):
|
||||||
run = self.import_path('run').Main()
|
run = self.import_path('run').Main()
|
||||||
run_gdb = self.import_path('run-gdb').Main()
|
run_gdb = self.import_path('run-gdb').Main()
|
||||||
for emulator in self.env['emulators']:
|
for emulator in self.env['emulators']:
|
||||||
if self.env['arch'] in self.env['crosstool_ng_supported_archs']:
|
if self.env['arch'] in self.env['crosstool_ng_supported_archs']:
|
||||||
test_scripts_noext = []
|
if self.env['tests'] == []:
|
||||||
for f in os.listdir(self.env['baremetal_src_dir']):
|
test_scripts_noext = []
|
||||||
base, ext = os.path.splitext(f)
|
for f in os.listdir(self.env['baremetal_src_dir']):
|
||||||
if ext == '.py':
|
|
||||||
test_scripts_noext.append(base)
|
|
||||||
for root, dirs, files in os.walk(os.path.join(self.env['baremetal_src_dir'], 'arch', self.env['arch'])):
|
|
||||||
for f in files:
|
|
||||||
base, ext = os.path.splitext(f)
|
base, ext = os.path.splitext(f)
|
||||||
if ext == '.py':
|
if ext == '.py':
|
||||||
full_path = os.path.join(root, base)
|
test_scripts_noext.append(base)
|
||||||
relpath = os.path.relpath(full_path, self.env['baremetal_src_dir'])
|
for root, dirs, files in os.walk(os.path.join(self.env['baremetal_src_dir'], 'arch', self.env['arch'])):
|
||||||
test_scripts_noext.append(relpath)
|
for f in files:
|
||||||
|
base, ext = os.path.splitext(f)
|
||||||
|
if ext == '.py':
|
||||||
|
full_path = os.path.join(root, base)
|
||||||
|
relpath = os.path.relpath(full_path, self.env['baremetal_src_dir'])
|
||||||
|
test_scripts_noext.append(relpath)
|
||||||
|
else:
|
||||||
|
test_scripts_noext = self.env['tests']
|
||||||
for test_script_noext in test_scripts_noext:
|
for test_script_noext in test_scripts_noext:
|
||||||
run_thread = threading.Thread(target=lambda: run(
|
run_thread = threading.Thread(target=lambda: run(
|
||||||
archs=[self.env['arch']],
|
archs=[self.env['arch']],
|
||||||
|
|||||||
Reference in New Issue
Block a user