mirror of
https://github.com/catchorg/Catch2.git
synced 2025-01-16 15:18:00 +00:00
Compare commits
3 Commits
8b0845b1a2
...
81aa2d5582
Author | SHA1 | Date | |
---|---|---|---|
|
81aa2d5582 | ||
|
9d591f19ff | ||
|
a4ac07d104 |
@ -36,6 +36,7 @@ set(INTERNAL_HEADERS
|
||||
${SOURCES_DIR}/generators/catch_generators_all.hpp
|
||||
${SOURCES_DIR}/interfaces/catch_interfaces_all.hpp
|
||||
${SOURCES_DIR}/matchers/internal/catch_matchers_impl.hpp
|
||||
${SOURCES_DIR}/internal/catch_console_width.hpp
|
||||
${SOURCES_DIR}/internal/catch_container_nonmembers.hpp
|
||||
${SOURCES_DIR}/catch_approx.hpp
|
||||
${SOURCES_DIR}/internal/catch_assertion_handler.hpp
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <catch2/internal/catch_common.hpp>
|
||||
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
||||
#include <catch2/internal/catch_console_colour.hpp>
|
||||
#include <catch2/internal/catch_console_width.hpp>
|
||||
#include <catch2/internal/catch_container_nonmembers.hpp>
|
||||
#include <catch2/internal/catch_context.hpp>
|
||||
#include <catch2/internal/catch_debug_console.hpp>
|
||||
|
@ -15,10 +15,6 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#ifndef CATCH_CONFIG_CONSOLE_WIDTH
|
||||
#define CATCH_CONFIG_CONSOLE_WIDTH 80
|
||||
#endif
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct IStream;
|
||||
|
@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_console_colour.hpp>
|
||||
#include <catch2/catch_message.hpp>
|
||||
#include <catch2/internal/catch_list.hpp>
|
||||
|
@ -9,8 +9,7 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
|
||||
|
||||
// For CATCH_CONFIG_CONSOLE_WIDTH. We should refactor this out somewhere else.
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_console_width.hpp>
|
||||
|
||||
// Use Catch's value for console width (store Clara's off to the side, if present)
|
||||
#ifdef CLARA_CONFIG_CONSOLE_WIDTH
|
||||
|
8
src/catch2/internal/catch_console_width.hpp
Normal file
8
src/catch2/internal/catch_console_width.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef CATCH_CONSOLE_WIDTH_HPP_INCLUDED
|
||||
#define CATCH_CONSOLE_WIDTH_HPP_INCLUDED
|
||||
|
||||
#ifndef CATCH_CONFIG_CONSOLE_WIDTH
|
||||
#define CATCH_CONFIG_CONSOLE_WIDTH 80
|
||||
#endif
|
||||
|
||||
#endif // CATCH_CONSOLE_WIDTH_HPP_INCLUDED
|
@ -173,10 +173,14 @@ namespace Detail {
|
||||
Singleton<StringStreams>::getMutable().release( m_index );
|
||||
}
|
||||
|
||||
auto ReusableStringStream::str() const -> std::string {
|
||||
std::string ReusableStringStream::str() const {
|
||||
return static_cast<std::ostringstream*>( m_oss )->str();
|
||||
}
|
||||
|
||||
void ReusableStringStream::str( std::string const& str ) {
|
||||
static_cast<std::ostringstream*>( m_oss )->str( str );
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -37,7 +37,10 @@ namespace Catch {
|
||||
ReusableStringStream();
|
||||
~ReusableStringStream();
|
||||
|
||||
auto str() const -> std::string;
|
||||
//! Returns the serialized state
|
||||
std::string str() const;
|
||||
//! Sets internal state to `str`
|
||||
void str(std::string const& str);
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||
#include <catch2/internal/catch_console_width.hpp>
|
||||
#include <catch2/internal/catch_errno_guard.hpp>
|
||||
#include <catch2/reporters/catch_reporter_bases.hpp>
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
#include <catch2/reporters/catch_reporter_console.hpp>
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/catch_test_spec.hpp>
|
||||
#include <catch2/catch_reporter_registrars.hpp>
|
||||
#include <catch2/internal/catch_console_colour.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
@ -16,6 +18,8 @@
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
#include <catch2/internal/catch_console_width.hpp>
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
|
||||
#include <cfloat>
|
||||
#include <cstdio>
|
||||
@ -275,7 +279,7 @@ public:
|
||||
class TablePrinter {
|
||||
std::ostream& m_os;
|
||||
std::vector<ColumnInfo> m_columnInfos;
|
||||
std::ostringstream m_oss;
|
||||
ReusableStringStream m_oss;
|
||||
int m_currentColumn = -1;
|
||||
bool m_isOpen = false;
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/catch_reporter_registrars.hpp>
|
||||
#include <catch2/internal/catch_text.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
Loading…
Reference in New Issue
Block a user