Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

David Gow and committed by
Shuah Khan
ee61492a e173b8b8

+3 -1
+3 -1
tools/testing/kunit/kunit.py
··· 82 82 request.make_options) 83 83 build_end = time.time() 84 84 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) 86 88 if not success: 87 89 return KunitResult(KunitStatus.BUILD_FAILURE, 88 90 'could not build kernel',