Compare commits

..

6 Commits

Author SHA1 Message Date
Martin Hořeňovský
ee1450f268 Merge pull request #2862 from rikyoz/backport-clang-tidy-bugprone-chained-comparison
Fix clang-tidy `bugprone-chained-comparison` warnings on v2.x
2024-04-25 14:29:32 +02:00
Oz
a2b2e1f707 Fix clang-tidy bugprone-chained-comparison warnings on v2.x 2024-04-22 22:05:38 +02:00
morinmorin
a7782d1d7c Add workaround for unguarded use of __has_extension (for v2.x) 2024-03-12 22:58:19 +01:00
Martin Hořeňovský
d4b0b34561 Fix lowercase namespace in own-main example
Fixes #2715
2023-07-13 14:02:19 +02:00
Martin Sternevald
c359076e8a Fix missing include causing compiler error
catch_registry_hub.cpp:65:17: error: use of undeclared identifier 'CATCH_INTERNAL_ERROR'
                CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
2022-12-10 23:35:59 +01:00
alvinhochun
20ace55034 Allow ANSI colour to be compiled on Windows
This enables building with `CATCH_CONFIG_COLOUR_ANSI` on Windows. The changes are taken from v3 commit 0e176c318b.
2022-10-25 12:10:28 +02:00
5 changed files with 12 additions and 4 deletions

View File

@@ -87,7 +87,7 @@ int main( int argc, char* argv[] )
int height = 0; // Some user variable you want to be able to set
// Build a new parser on top of Catch's
using namespace Catch::clara;
using namespace Catch::Clara;
auto cli
= session.cli() // Get Catch's composite command line parser
| Opt( height, "height" ) // bind variable to a new option, with a hint string

View File

@@ -47,7 +47,7 @@
INTERNAL_CATCH_TRY { \
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
} INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \

View File

@@ -121,7 +121,10 @@ namespace {
#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
#include <unistd.h>
#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC )
# define CATCH_INTERNAL_HAS_ISATTY
# include <unistd.h>
#endif
namespace Catch {
namespace {
@@ -170,7 +173,8 @@ namespace {
#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
!isDebuggerActive() &&
#endif
#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
#if defined( CATCH_INTERNAL_HAS_ISATTY ) && \
!( defined( __DJGPP__ ) && defined( __STRICT_ANSI__ ) )
isatty(STDOUT_FILENO)
#else
false

View File

@@ -12,6 +12,9 @@
// See e.g.:
// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html
#ifdef __APPLE__
# ifndef __has_extension
# define __has_extension(x) 0
# endif
# include <TargetConditionals.h>
# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \
(defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1)

View File

@@ -9,6 +9,7 @@
#include "catch_interfaces_registry_hub.h"
#include "catch_context.h"
#include "catch_enforce.h"
#include "catch_test_case_registry_impl.h"
#include "catch_reporter_registry.h"
#include "catch_exception_translator_registry.h"