kunit: test: add string_stream a std::stream like string builder
authorBrendan Higgins <brendanhiggins@google.com>
Mon, 23 Sep 2019 09:02:33 +0000 (02:02 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 30 Sep 2019 23:35:00 +0000 (17:35 -0600)
commitd1fadef194008b22d7d9608426cad29d4bb69ab9
tree6b95896245d9b87ec2a4128aeac14b99fd43b9e4
parent0a756853586ce185ee1bb9ccbe5ec03e103e594f
kunit: test: add string_stream a std::stream like string builder

A number of test features need to do pretty complicated string printing
where it may not be possible to rely on a single preallocated string
with parameters.

So provide a library for constructing the string as you go similar to
C++'s std::string. string_stream is really just a string builder,
nothing more.

Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/kunit/string-stream.h [new file with mode: 0644]
lib/kunit/Makefile
lib/kunit/string-stream.c [new file with mode: 0644]