blob: 83dcbcc948b3c90bd148c0ab0d4a2fcc77a24d73 (
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 "kapi/cio.hpp"
#include "kernel/test_support/cio.hpp"
#include "kernel/test_support/log_buffer.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
|