Skip to content

Commit 67e2fae

Browse files
bjh83shuahkh
authored andcommitted
kunit: tool: fix --alltests flag
Alltests flag evidently stopped working when run from outside of the root of the source tree, so fix that. Also add an additional broken config to the broken_on_uml config. Signed-off-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 21a6d17 commit 67e2fae

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

tools/testing/kunit/configs/broken_on_uml.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
# CONFIG_QCOM_CPR is not set
4040
# CONFIG_RESET_BRCMSTB_RESCAL is not set
4141
# CONFIG_RESET_INTEL_GW is not set
42+
# CONFIG_ADI_AXI_ADC is not set

tools/testing/kunit/kunit_kernel.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,23 @@ def make_olddefconfig(self, build_dir, make_options):
5353
except subprocess.CalledProcessError as e:
5454
raise ConfigError(e.output)
5555

56-
def make_allyesconfig(self):
56+
def make_allyesconfig(self, build_dir, make_options):
5757
kunit_parser.print_with_timestamp(
5858
'Enabling all CONFIGs for UML...')
59+
command = ['make', 'ARCH=um', 'allyesconfig']
60+
if make_options:
61+
command.extend(make_options)
62+
if build_dir:
63+
command += ['O=' + build_dir]
5964
process = subprocess.Popen(
60-
['make', 'ARCH=um', 'allyesconfig'],
65+
command,
6166
stdout=subprocess.DEVNULL,
6267
stderr=subprocess.STDOUT)
6368
process.wait()
6469
kunit_parser.print_with_timestamp(
6570
'Disabling broken configs to run KUnit tests...')
6671
with ExitStack() as es:
67-
config = open(KCONFIG_PATH, 'a')
72+
config = open(get_kconfig_path(build_dir), 'a')
6873
disable = open(BROKEN_ALLCONFIG_PATH, 'r').read()
6974
config.write(disable)
7075
kunit_parser.print_with_timestamp(
@@ -161,9 +166,9 @@ def build_reconfig(self, build_dir, make_options):
161166
return self.build_config(build_dir, make_options)
162167

163168
def build_um_kernel(self, alltests, jobs, build_dir, make_options):
164-
if alltests:
165-
self._ops.make_allyesconfig()
166169
try:
170+
if alltests:
171+
self._ops.make_allyesconfig(build_dir, make_options)
167172
self._ops.make_olddefconfig(build_dir, make_options)
168173
self._ops.make(jobs, build_dir, make_options)
169174
except (ConfigError, BuildError) as e:

0 commit comments

Comments
 (0)