mirror of
https://github.com/catchorg/Catch2.git
synced 2026-08-09 07:02:17 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9712bc8fe5 | |||
| c002f18535 | |||
| ee1450f268 | |||
| a2b2e1f707 | |||
| a7782d1d7c | |||
| d4b0b34561 | |||
| c359076e8a | |||
| 20ace55034 |
+1
-1
@@ -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
|
||||
|
||||
@@ -73,10 +73,10 @@ namespace Detail {
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val) {
|
||||
Detail::Approx operator ""_a(long double val) {
|
||||
return Detail::Approx(val);
|
||||
}
|
||||
Detail::Approx operator "" _a(unsigned long long val) {
|
||||
Detail::Approx operator ""_a(unsigned long long val) {
|
||||
return Detail::Approx(val);
|
||||
}
|
||||
} // end namespace literals
|
||||
|
||||
@@ -118,8 +118,8 @@ namespace Detail {
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val);
|
||||
Detail::Approx operator "" _a(unsigned long long val);
|
||||
Detail::Approx operator ""_a(long double val);
|
||||
Detail::Approx operator ""_a(unsigned long long val);
|
||||
} // end namespace literals
|
||||
|
||||
template<>
|
||||
|
||||
@@ -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 ) \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -92,12 +92,12 @@ namespace Catch {
|
||||
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
||||
|
||||
|
||||
constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
constexpr auto operator ""_sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
return StringRef( rawChars, size );
|
||||
}
|
||||
} // namespace Catch
|
||||
|
||||
constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
|
||||
constexpr auto operator ""_catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
|
||||
return Catch::StringRef( rawChars, size );
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") {
|
||||
STATIC_REQUIRE(sr1.size() == 3);
|
||||
STATIC_REQUIRE(sr1.isNullTerminated());
|
||||
|
||||
using Catch::operator"" _sr;
|
||||
using Catch::operator""_sr;
|
||||
constexpr auto sr2 = ""_sr;
|
||||
STATIC_REQUIRE(sr2.empty());
|
||||
STATIC_REQUIRE(sr2.size() == 0);
|
||||
|
||||
@@ -677,12 +677,12 @@ namespace Catch {
|
||||
auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
|
||||
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
||||
|
||||
constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
constexpr auto operator ""_sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
return StringRef( rawChars, size );
|
||||
}
|
||||
} // namespace Catch
|
||||
|
||||
constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
|
||||
constexpr auto operator ""_catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
|
||||
return Catch::StringRef( rawChars, size );
|
||||
}
|
||||
|
||||
@@ -3177,8 +3177,8 @@ namespace Detail {
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val);
|
||||
Detail::Approx operator "" _a(unsigned long long val);
|
||||
Detail::Approx operator ""_a(long double val);
|
||||
Detail::Approx operator ""_a(unsigned long long val);
|
||||
} // end namespace literals
|
||||
|
||||
template<>
|
||||
@@ -7920,10 +7920,10 @@ namespace Detail {
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val) {
|
||||
Detail::Approx operator ""_a(long double val) {
|
||||
return Detail::Approx(val);
|
||||
}
|
||||
Detail::Approx operator "" _a(unsigned long long val) {
|
||||
Detail::Approx operator ""_a(unsigned long long val) {
|
||||
return Detail::Approx(val);
|
||||
}
|
||||
} // end namespace literals
|
||||
|
||||
Reference in New Issue
Block a user