NEURON
test_utils.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2023 Blue Brain Project, EPFL.
3  * See the top-level LICENSE file for details.
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #pragma once
9 
10 #include <string>
11 
12 #include "nmodl/utils/logger.hpp"
13 
14 namespace nmodl {
15 namespace test_utils {
16 
17 std::string reindent_text(const std::string& text, int indent_level = 0);
18 
19 // RAII state guard for the actual log
21  public:
22  LoggerCapture();
24  std::string output() const;
25 
26  private:
27  std::shared_ptr<std::ostringstream> capture_stream;
29 };
30 } // namespace test_utils
31 } // namespace nmodl
std::shared_ptr< std::ostringstream > capture_stream
Definition: test_utils.hpp:27
nmodl::logger_type original_logger
Definition: test_utils.hpp:28
std::string reindent_text(const std::string &text, int indent_level)
Reindent nmodl text for text-to-text comparison.
Definition: test_utils.cpp:55
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
std::shared_ptr< spdlog::logger > logger_type
Definition: logger.cpp:19
Implement logger based on spdlog library.
#define text
Definition: plot.cpp:60