Skip to content

Commit ee61492

Browse files
sulixshuahkh
authored andcommitted
kunit: kunit_tool: Fix invalid result when build fails
When separating out different phases of running tests[1] (build/exec/parse/etc), the format of the KunitResult tuple changed (adding an elapsed_time variable). This is not populated during a build failure, causing kunit.py to crash. This fixes [1] to probably populate the result variable, causing a failing build to be reported properly. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=45ba7a893ad89114e773b3dc32f6431354c465d6 Signed-off-by: David Gow <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Tested-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent e173b8b commit ee61492

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/testing/kunit/kunit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def build_tests(linux: kunit_kernel.LinuxSourceTree,
8282
request.make_options)
8383
build_end = time.time()
8484
if not success:
85-
return KunitResult(KunitStatus.BUILD_FAILURE, 'could not build kernel')
85+
return KunitResult(KunitStatus.BUILD_FAILURE,
86+
'could not build kernel',
87+
build_end - build_start)
8688
if not success:
8789
return KunitResult(KunitStatus.BUILD_FAILURE,
8890
'could not build kernel',

0 commit comments

Comments
 (0)