• Daniel Latypov's avatar
    kunit: tool: make --json do nothing if --raw_ouput is set · 309e22ef
    Daniel Latypov authored
    When --raw_output is set (to any value), we don't actually parse the
    test results. So asking to print the test results as json doesn't make
    sense.
    
    We internally create a fake test with one passing subtest, so --json
    would actually print out something misleading.
    
    This patch:
    * Rewords the flag descriptions so hopefully this is more obvious.
    * Also updates --raw_output's description to note the default behavior
      is to print out only "KUnit" results (actually any KTAP results)
    * also renames and refactors some related logic for clarity (e.g.
      test_result => test, it's a kunit_parser.Test object).
    
    Notably, this patch does not make it an error to specify --json and
    --raw_output together. This is an edge case, but I know of at least one
    wrapper around kunit.py that always sets --json. You'd never be able to
    use --raw_output with that wrapper.
    Signed-off-by: default avatarDaniel Latypov <dlatypov@google.com>
    Reviewed-by: default avatarDavid Gow <davidgow@google.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    309e22ef
kunit.py 17.5 KB