Skip to content

Commit

Permalink
kunit: tool: fix --alltests flag
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
  • Loading branch information
bjh83 authored and shuahkh committed Sep 23, 2020
1 parent 21a6d17 commit 67e2fae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions tools/testing/kunit/configs/broken_on_uml.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@
# CONFIG_QCOM_CPR is not set
# CONFIG_RESET_BRCMSTB_RESCAL is not set
# CONFIG_RESET_INTEL_GW is not set
# CONFIG_ADI_AXI_ADC is not set
15 changes: 10 additions & 5 deletions tools/testing/kunit/kunit_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,23 @@ def make_olddefconfig(self, build_dir, make_options):
except subprocess.CalledProcessError as e:
raise ConfigError(e.output)

def make_allyesconfig(self):
def make_allyesconfig(self, build_dir, make_options):
kunit_parser.print_with_timestamp(
'Enabling all CONFIGs for UML...')
command = ['make', 'ARCH=um', 'allyesconfig']
if make_options:
command.extend(make_options)
if build_dir:
command += ['O=' + build_dir]
process = subprocess.Popen(
['make', 'ARCH=um', 'allyesconfig'],
command,
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT)
process.wait()
kunit_parser.print_with_timestamp(
'Disabling broken configs to run KUnit tests...')
with ExitStack() as es:
config = open(KCONFIG_PATH, 'a')
config = open(get_kconfig_path(build_dir), 'a')
disable = open(BROKEN_ALLCONFIG_PATH, 'r').read()
config.write(disable)
kunit_parser.print_with_timestamp(
Expand Down Expand Up @@ -161,9 +166,9 @@ def build_reconfig(self, build_dir, make_options):
return self.build_config(build_dir, make_options)

def build_um_kernel(self, alltests, jobs, build_dir, make_options):
if alltests:
self._ops.make_allyesconfig()
try:
if alltests:
self._ops.make_allyesconfig(build_dir, make_options)
self._ops.make_olddefconfig(build_dir, make_options)
self._ops.make(jobs, build_dir, make_options)
except (ConfigError, BuildError) as e:
Expand Down

0 comments on commit 67e2fae

Please sign in to comment.