Permalink
Browse files

Enable Werror for dev builds

  • Loading branch information...
horenmar committed Nov 21, 2017
1 parent 3b965aa commit 87c125ecb89724afb52f05170e44e3995733066a
View
@@ -302,7 +302,7 @@ if (NOT NO_SELFTEST)
# Add desired warnings
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
target_compile_options( SelfTest PRIVATE -Wall -Wextra -Wunreachable-code )
target_compile_options( SelfTest PRIVATE -Wall -Wextra -Wunreachable-code -Werror )
endif()
# Clang specific warning go here
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
@@ -295,12 +295,15 @@ void print( std::ostream& os, int const level, std::string const& title, Catch::
// 2. My listener and registration:
//
const std::string dashed_line =
char const * dashed_line =
"--------------------------------------------------------------------------";
struct MyListener : Catch::TestEventListenerBase {
using TestEventListenerBase::TestEventListenerBase; // inherit constructor
// Get rid of Wweak-tables
~MyListener();
// The whole test run starting
virtual void testRunStarting( Catch::TestRunInfo const& testRunInfo ) override {
@@ -367,6 +370,10 @@ struct MyListener : Catch::TestEventListenerBase {
CATCH_REGISTER_LISTENER( MyListener )
// Get rid of Wweak-tables
MyListener::~MyListener() {}
// -----------------------------------------------------------------------
// 3. Test cases:
//
@@ -12,6 +12,11 @@
#include "catch_context.h"
#include "catch_interfaces_capture.h"
#if defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
namespace {
// Report the error condition
void reportFatal( char const * const message ) {
@@ -174,3 +179,7 @@ namespace Catch {
# endif // CATCH_CONFIG_POSIX_SIGNALS
#endif // not Windows
#if defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
@@ -8,7 +8,10 @@
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wdouble-promotion"
// Wdouble-promotion is not supported until 3.8
# if (__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ > 7)
# pragma clang diagnostic ignored "-Wdouble-promotion"
# endif
#endif
#include "catch.hpp"

0 comments on commit 87c125e

Please sign in to comment.