Skip to content

Commit 5a9fcad

Browse files
Will Chenshuahkh
authored andcommitted
kunit: capture stderr on all make subprocess calls
Direct stderr to subprocess.STDOUT so error messages get included in the subprocess.CalledProcessError exceptions output field. This results in more meaningful error messages for the user. This is already being done in the make_allyesconfig method. Do the same for make_mrproper, make_olddefconfig, and make methods. With this, failures on unclean trees [1] will give users an error message that includes: "The source tree is not clean, please run 'make ARCH=um mrproper'" [1] https://bugzilla.kernel.org/show_bug.cgi?id=205219 Signed-off-by: Will Chen <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Tested-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 39f65da commit 5a9fcad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/kunit/kunit_kernel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LinuxSourceTreeOperations(object):
3434

3535
def make_mrproper(self):
3636
try:
37-
subprocess.check_output(['make', 'mrproper'])
37+
subprocess.check_output(['make', 'mrproper'], stderr=subprocess.STDOUT)
3838
except OSError as e:
3939
raise ConfigError('Could not call make command: ' + e)
4040
except subprocess.CalledProcessError as e:
@@ -47,7 +47,7 @@ def make_olddefconfig(self, build_dir, make_options):
4747
if build_dir:
4848
command += ['O=' + build_dir]
4949
try:
50-
subprocess.check_output(command, stderr=subprocess.PIPE)
50+
subprocess.check_output(command, stderr=subprocess.STDOUT)
5151
except OSError as e:
5252
raise ConfigError('Could not call make command: ' + e)
5353
except subprocess.CalledProcessError as e:
@@ -77,7 +77,7 @@ def make(self, jobs, build_dir, make_options):
7777
if build_dir:
7878
command += ['O=' + build_dir]
7979
try:
80-
subprocess.check_output(command)
80+
subprocess.check_output(command, stderr=subprocess.STDOUT)
8181
except OSError as e:
8282
raise BuildError('Could not call execute make: ' + e)
8383
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)