mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +01:00
Suppressed a load of warnings
This commit is contained in:
parent
ebd4888fe1
commit
3bdc97d8ad
@ -9,15 +9,7 @@
|
|||||||
#ifndef TWOBLUECUBES_CATCH_HPP_INCLUDED
|
#ifndef TWOBLUECUBES_CATCH_HPP_INCLUDED
|
||||||
#define TWOBLUECUBES_CATCH_HPP_INCLUDED
|
#define TWOBLUECUBES_CATCH_HPP_INCLUDED
|
||||||
|
|
||||||
#ifdef __clang__
|
#include "internal/catch_suppress_warnings.h"
|
||||||
#pragma clang diagnostic ignored "-Wglobal-constructors"
|
|
||||||
#pragma clang diagnostic ignored "-Wvariadic-macros"
|
|
||||||
#pragma clang diagnostic ignored "-Wc99-extensions"
|
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma clang diagnostic ignored "-Wpadded"
|
|
||||||
#pragma clang diagnostic ignored "-Wc++98-compat"
|
|
||||||
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CATCH_CONFIG_MAIN
|
#ifdef CATCH_CONFIG_MAIN
|
||||||
# define CATCH_CONFIG_RUNNER
|
# define CATCH_CONFIG_RUNNER
|
||||||
@ -197,8 +189,6 @@
|
|||||||
|
|
||||||
using Catch::Detail::Approx;
|
using Catch::Detail::Approx;
|
||||||
|
|
||||||
#ifdef __clang__
|
#include "internal/catch_reenable_warnings.h"
|
||||||
#pragma clang diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // TWOBLUECUBES_CATCH_HPP_INCLUDED
|
#endif // TWOBLUECUBES_CATCH_HPP_INCLUDED
|
||||||
|
@ -58,6 +58,7 @@ namespace Catch {
|
|||||||
static void use( Code _colourCode );
|
static void use( Code _colourCode );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Colour( Colour const& other );
|
||||||
static Detail::IColourImpl* impl();
|
static Detail::IColourImpl* impl();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ namespace Catch {
|
|||||||
class ScopedMessage {
|
class ScopedMessage {
|
||||||
public:
|
public:
|
||||||
ScopedMessage( MessageBuilder const& builder );
|
ScopedMessage( MessageBuilder const& builder );
|
||||||
|
ScopedMessage( ScopedMessage const& other );
|
||||||
~ScopedMessage();
|
~ScopedMessage();
|
||||||
|
|
||||||
MessageInfo m_info;
|
MessageInfo m_info;
|
||||||
|
@ -33,6 +33,10 @@ namespace Catch {
|
|||||||
m_info.message = builder.m_stream.str();
|
m_info.message = builder.m_stream.str();
|
||||||
getResultCapture().pushScopedMessage( m_info );
|
getResultCapture().pushScopedMessage( m_info );
|
||||||
}
|
}
|
||||||
|
ScopedMessage::ScopedMessage( ScopedMessage const& other )
|
||||||
|
: m_info( other.m_info )
|
||||||
|
{}
|
||||||
|
|
||||||
ScopedMessage::~ScopedMessage() {
|
ScopedMessage::~ScopedMessage() {
|
||||||
getResultCapture().popScopedMessage( m_info );
|
getResultCapture().popScopedMessage( m_info );
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ namespace Catch {
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NotImplementedException( SourceLineInfo const& lineInfo );
|
NotImplementedException( SourceLineInfo const& lineInfo );
|
||||||
|
NotImplementedException( NotImplementedException const& ) {}
|
||||||
|
|
||||||
virtual ~NotImplementedException() CATCH_NOEXCEPT {}
|
virtual ~NotImplementedException() CATCH_NOEXCEPT {}
|
||||||
|
|
||||||
|
15
include/internal/catch_reenable_warnings.h
Normal file
15
include/internal/catch_reenable_warnings.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Two Blue Cubes Ltd
|
||||||
|
*
|
||||||
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
|
||||||
|
#define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
|
21
include/internal/catch_suppress_warnings.h
Normal file
21
include/internal/catch_suppress_warnings.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Two Blue Cubes Ltd
|
||||||
|
*
|
||||||
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TWOBLUECUBES_CATCH_SUPPRESS_WARNINGS_H_INCLUDED
|
||||||
|
#define TWOBLUECUBES_CATCH_SUPPRESS_WARNINGS_H_INCLUDED
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wglobal-constructors"
|
||||||
|
#pragma clang diagnostic ignored "-Wvariadic-macros"
|
||||||
|
#pragma clang diagnostic ignored "-Wc99-extensions"
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wpadded"
|
||||||
|
#pragma clang diagnostic ignored "-Wc++98-compat"
|
||||||
|
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // TWOBLUECUBES_CATCH_SUPPRESS_WARNINGS_H_INCLUDED
|
@ -66,26 +66,26 @@ namespace Catch {
|
|||||||
endElement();
|
endElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifndef CATCH_CPP11_OR_GREATER
|
//# ifndef CATCH_CPP11_OR_GREATER
|
||||||
XmlWriter& operator = ( XmlWriter const& other ) {
|
// XmlWriter& operator = ( XmlWriter const& other ) {
|
||||||
XmlWriter temp( other );
|
// XmlWriter temp( other );
|
||||||
swap( temp );
|
// swap( temp );
|
||||||
return *this;
|
// return *this;
|
||||||
}
|
// }
|
||||||
# else
|
//# else
|
||||||
XmlWriter( XmlWriter const& ) = default;
|
// XmlWriter( XmlWriter const& ) = default;
|
||||||
XmlWriter( XmlWriter && ) = default;
|
// XmlWriter( XmlWriter && ) = default;
|
||||||
XmlWriter& operator = ( XmlWriter const& ) = default;
|
// XmlWriter& operator = ( XmlWriter const& ) = default;
|
||||||
XmlWriter& operator = ( XmlWriter && ) = default;
|
// XmlWriter& operator = ( XmlWriter && ) = default;
|
||||||
# endif
|
//# endif
|
||||||
|
//
|
||||||
void swap( XmlWriter& other ) {
|
// void swap( XmlWriter& other ) {
|
||||||
std::swap( m_tagIsOpen, other.m_tagIsOpen );
|
// std::swap( m_tagIsOpen, other.m_tagIsOpen );
|
||||||
std::swap( m_needsNewline, other.m_needsNewline );
|
// std::swap( m_needsNewline, other.m_needsNewline );
|
||||||
std::swap( m_tags, other.m_tags );
|
// std::swap( m_tags, other.m_tags );
|
||||||
std::swap( m_indent, other.m_indent );
|
// std::swap( m_indent, other.m_indent );
|
||||||
std::swap( m_os, other.m_os );
|
// std::swap( m_os, other.m_os );
|
||||||
}
|
// }
|
||||||
|
|
||||||
XmlWriter& startElement( std::string const& name ) {
|
XmlWriter& startElement( std::string const& name ) {
|
||||||
ensureTagClosed();
|
ensureTagClosed();
|
||||||
@ -163,7 +163,13 @@ namespace Catch {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setStream( std::ostream& os ) {
|
||||||
|
m_os = &os;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
XmlWriter( XmlWriter const& );
|
||||||
|
void operator=( XmlWriter const& );
|
||||||
|
|
||||||
std::ostream& stream() {
|
std::ostream& stream() {
|
||||||
return *m_os;
|
return *m_os;
|
||||||
|
@ -99,7 +99,6 @@ namespace Catch {
|
|||||||
return node->stats.sectionInfo.lineInfo == m_other.lineInfo;
|
return node->stats.sectionInfo.lineInfo == m_other.lineInfo;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
BySectionInfo& operator=( BySectionInfo const& other ); // = delete;
|
|
||||||
|
|
||||||
SectionInfo const& m_other;
|
SectionInfo const& m_other;
|
||||||
};
|
};
|
||||||
|
@ -142,7 +142,7 @@ namespace Catch {
|
|||||||
private:
|
private:
|
||||||
// Colour::LightGrey
|
// Colour::LightGrey
|
||||||
|
|
||||||
static Colour dimColour() { return Colour::FileName; }
|
static Colour::Code dimColour() { return Colour::FileName; }
|
||||||
|
|
||||||
#ifdef CATCH_PLATFORM_MAC
|
#ifdef CATCH_PLATFORM_MAC
|
||||||
static const char* failedString() { return "FAILED"; }
|
static const char* failedString() { return "FAILED"; }
|
||||||
@ -157,7 +157,7 @@ namespace Catch {
|
|||||||
stream << result.getSourceInfo() << ":";
|
stream << result.getSourceInfo() << ":";
|
||||||
}
|
}
|
||||||
|
|
||||||
void printResultType( Colour colour, std::string passOrFail ) const {
|
void printResultType( Colour::Code colour, std::string passOrFail ) const {
|
||||||
if( !passOrFail.empty() ) {
|
if( !passOrFail.empty() ) {
|
||||||
{
|
{
|
||||||
Colour colourGuard( colour );
|
Colour colourGuard( colour );
|
||||||
@ -205,7 +205,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void printRemainingMessages( Colour colour = dimColour() ) {
|
void printRemainingMessages( Colour::Code colour = dimColour() ) {
|
||||||
if ( itMessage == messages.end() )
|
if ( itMessage == messages.end() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void StartTesting() {
|
virtual void StartTesting() {
|
||||||
m_xml = XmlWriter( m_config.stream() );
|
m_xml.setStream( m_config.stream() );
|
||||||
m_xml.startElement( "Catch" );
|
m_xml.startElement( "Catch" );
|
||||||
if( !m_config.fullConfig()->name().empty() )
|
if( !m_config.fullConfig()->name().empty() )
|
||||||
m_xml.writeAttribute( "name", m_config.fullConfig()->name() );
|
m_xml.writeAttribute( "name", m_config.fullConfig()->name() );
|
||||||
|
@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_CASE( "INFO and WARN do not abort tests", "[messages][.]" )
|
TEST_CASE( "INFO and WARN do not abort tests", "[messages][.]" )
|
||||||
{
|
{
|
||||||
INFO( "this is a " << "message" ); // This should output the message if a failure occurs
|
INFO( "this is a " << "message" ); // This should output the message if a failure occurs
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_CASE( "random SECTION tests", "[.][sections][failing]" )
|
TEST_CASE( "random SECTION tests", "[.][sections][failing]" )
|
||||||
{
|
{
|
||||||
int a = 1;
|
int a = 1;
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_common.h"
|
#include "catch_common.h"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_console_colour.hpp"
|
#include "catch_console_colour.hpp"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_interfaces_capture.h"
|
#include "catch_interfaces_capture.h"
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_interfaces_config.h"
|
#include "catch_interfaces_config.h"
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_interfaces_reporter.h"
|
#include "catch_interfaces_reporter.h"
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_interfaces_testcase.h"
|
#include "catch_interfaces_testcase.h"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_message.h"
|
#include "catch_message.h"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_option.hpp"
|
#include "catch_option.hpp"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_ptr.hpp"
|
#include "catch_ptr.hpp"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_streambuf.h"
|
#include "catch_streambuf.h"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
// This file is only here to verify (to the extent possible) the self sufficiency of the header
|
||||||
|
#include "catch_suppress_warnings.h"
|
||||||
#include "catch_test_spec.hpp"
|
#include "catch_test_spec.hpp"
|
||||||
|
@ -12,6 +12,11 @@
|
|||||||
|
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wc++98-compat"
|
||||||
|
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Catch
|
namespace Catch
|
||||||
{
|
{
|
||||||
template<>
|
template<>
|
||||||
|
@ -67,6 +67,8 @@
|
|||||||
263FD06117AF8DF200988A20 /* catch_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_timer.h; sourceTree = "<group>"; };
|
263FD06117AF8DF200988A20 /* catch_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_timer.h; sourceTree = "<group>"; };
|
||||||
2656C21F1925E5100040DB02 /* catch_test_spec_parser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_test_spec_parser.hpp; sourceTree = "<group>"; };
|
2656C21F1925E5100040DB02 /* catch_test_spec_parser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_test_spec_parser.hpp; sourceTree = "<group>"; };
|
||||||
2656C2201925E7330040DB02 /* catch_test_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_test_spec.cpp; path = ../../../SelfTest/SurrogateCpps/catch_test_spec.cpp; sourceTree = "<group>"; };
|
2656C2201925E7330040DB02 /* catch_test_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_test_spec.cpp; path = ../../../SelfTest/SurrogateCpps/catch_test_spec.cpp; sourceTree = "<group>"; };
|
||||||
|
2656C226192A77EF0040DB02 /* catch_suppress_warnings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_suppress_warnings.h; sourceTree = "<group>"; };
|
||||||
|
2656C227192A78410040DB02 /* catch_reenable_warnings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_reenable_warnings.h; sourceTree = "<group>"; };
|
||||||
266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariadicMacrosTests.cpp; path = ../../../SelfTest/VariadicMacrosTests.cpp; sourceTree = "<group>"; };
|
266B06B616F3A60A004ED264 /* VariadicMacrosTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariadicMacrosTests.cpp; path = ../../../SelfTest/VariadicMacrosTests.cpp; sourceTree = "<group>"; };
|
||||||
266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = "<group>"; };
|
266ECD73170F3C620030D735 /* BDDTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BDDTests.cpp; path = ../../../SelfTest/BDDTests.cpp; sourceTree = "<group>"; };
|
||||||
266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = "<group>"; };
|
266ECD8C1713614B0030D735 /* catch_legacy_reporter_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_legacy_reporter_adapter.hpp; sourceTree = "<group>"; };
|
||||||
@ -440,6 +442,8 @@
|
|||||||
262E739A1846759000CAC268 /* catch_common.hpp */,
|
262E739A1846759000CAC268 /* catch_common.hpp */,
|
||||||
261488FC184D1DC10041FBEB /* catch_stream.h */,
|
261488FC184D1DC10041FBEB /* catch_stream.h */,
|
||||||
268F47B018A93F7800D8C14F /* catch_clara.h */,
|
268F47B018A93F7800D8C14F /* catch_clara.h */,
|
||||||
|
2656C226192A77EF0040DB02 /* catch_suppress_warnings.h */,
|
||||||
|
2656C227192A78410040DB02 /* catch_reenable_warnings.h */,
|
||||||
);
|
);
|
||||||
name = Infrastructure;
|
name = Infrastructure;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
Loading…
Reference in New Issue
Block a user