• Rae Moar's avatar
    kunit: fix bug in debugfs logs of parameterized tests · 887d85a0
    Rae Moar authored
    Fix bug in debugfs logs that causes individual parameterized results to not
    appear because the log is reinitialized (cleared) when each parameter is
    run.
    
    Ensure these results appear in the debugfs logs, increase log size to
    allow for the size of parameterized results. As a result, append lines to
    the log directly rather than using an intermediate variable that can cause
    stack size warnings due to the increased log size.
    
    Here is the debugfs log of ext4_inode_test which uses parameterized tests
    before the fix:
    
         KTAP version 1
    
         # Subtest: ext4_inode_test
         1..1
     # Totals: pass:16 fail:0 skip:0 total:16
     ok 1 ext4_inode_test
    
    As you can see, this log does not include any of the individual
    parametrized results.
    
    After (in combination with the next two fixes to remove extra empty line
    and ensure KTAP valid format):
    
     KTAP version 1
     1..1
         KTAP version 1
         # Subtest: ext4_inode_test
         1..1
            KTAP version 1
             # Subtest: inode_test_xtimestamp_decoding
             ok 1 1901-12-13 Lower bound of 32bit < 0 timestamp, no extra bits
             ... (the rest of the individual parameterized tests)
             ok 16 2446-05-10 Upper bound of 32bit >=0 timestamp. All extra
         # inode_test_xtimestamp_decoding: pass:16 fail:0 skip:0 total:16
         ok 1 inode_test_xtimestamp_decoding
     # Totals: pass:16 fail:0 skip:0 total:16
     ok 1 ext4_inode_test
    Signed-off-by: default avatarRae Moar <rmoar@google.com>
    Reviewed-by: default avatarDavid Gow <davidgow@google.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    887d85a0
test.h 50.1 KB