14#include "arcane/utils/TestLogger.h"
16#include "arcane/utils/String.h"
17#include "arcane/utils/PlatformUtils.h"
18#include "arcane/utils/Array.h"
19#include "arcane/utils/FatalErrorException.h"
35 std::ostringstream m_stream;
53 return _impl().m_stream;
62 std::string str = _impl().m_stream.str();
72 String result_file = platform::getEnvironmentVariable(
"ARCANE_TEST_RESULT_FILE");
73 if (result_file.null())
76 UniqueArray<std::byte> bytes;
78 ARCANE_FATAL(
"Can not read test result file '{0}'", result_file);
80 std::string expected_str(
reinterpret_cast<const char*
>(bytes.data()), bytes.length());
81 std::string str = _impl().m_stream.str();
83 if (expected_str != str) {
84 std::cout <<
"TestLogger: ERROR during test comparison:\n";
85 std::cout <<
"Current:\n";
86 std::cout <<
"\n'''" << str <<
"'''\n";
87 std::cout <<
"\nExpected:\n";
88 std::cout <<
"\n'''" << expected_str <<
"'''\n";
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-