blob: 45fb4bc827883ad3d3d910859a721eca23c47eb5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <kernel/test_support/cio.hpp>
#include <kernel/test_support/log_buffer.hpp>
#include <kapi/cio.hpp>
#include <iostream>
#include <string>
#include <string_view>
namespace kernel::tests::cio
{
auto output_device::write(kapi::cio::output_stream stream, std::string_view text) -> void
{
auto & standard_stream = stream == kapi::cio::output_stream::stdout ? std::cout : std::cerr;
standard_stream << text;
if (text != "\n")
{
m_log_buffer.append(std::string{text});
}
}
auto output_device::log_buffer() noexcept -> kernel::tests::log_buffer &
{
return m_log_buffer;
}
} // namespace kernel::tests::cio
|