diff options
author | Rae Moar <rmoar@google.com> | 2023-03-08 23:39:52 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2023-03-10 23:59:43 +0300 |
commit | 2c6a96dad5797e57b4cf04101d6c8d5c7a571603 (patch) | |
tree | e19212faf62e375b494418da13873e4a4dae30f7 /lib/Makefile | |
parent | f9a301c3317daa921375da0aec82462ddf019928 (diff) | |
download | linux-2c6a96dad5797e57b4cf04101d6c8d5c7a571603.tar.xz |
kunit: fix bug of extra newline characters in debugfs logs
Fix bug of the extra newline characters in debugfs logs. When a
line is added to debugfs with a newline character at the end,
an extra line appears in the debugfs log.
This is due to a discrepancy between how the lines are printed and how they
are added to the logs. Remove this discrepancy by checking if a newline
character is present before adding a newline character. This should closely
match the printk behavior.
Add kunit_log_newline_test to provide test coverage for this issue. (Also,
move kunit_log_test above suite definition to remove the unnecessary
declaration prior to the suite definition)
As an example, say we add these two lines to the log:
kunit_log(..., "KTAP version 1\n");
kunit_log(..., "1..1");
The debugfs log before this fix:
KTAP version 1
1..1
The debugfs log after this fix:
KTAP version 1
1..1
Signed-off-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/Makefile')
0 files changed, 0 insertions, 0 deletions