Lines Matching +full:pico +full:- +full:seconds

3  *  Generated: 2019-11-15 15:01:56.628356
4 * ----------------------------------------------------------
34 # pragma clang diagnostic ignored "-Wpadded"
35 # pragma clang diagnostic ignored "-Wswitch-enum"
36 # pragma clang diagnostic ignored "-Wcovered-switch-default"
39 // Because REQUIREs trigger GCC's -Wparentheses, and because still
42 # pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details
45 # pragma GCC diagnostic ignored "-Wunused-variable"
46 # pragma GCC diagnostic ignored "-Wpadded"
106 // Detect a number of compiler features - by compiler
121 // can be combined, en-mass, with the _NO_ forms later.
152 _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
153 _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
156 _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
159 _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
162 _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
165 _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
170 // Assume that non-Windows platforms support posix signals by default
210 // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
213 // https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
243 // _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
250 // Enable async processing, as -pthread is specified or no additional linking is required
255 // Check if we are compiled with -fno-exceptions or equivalent
338 // This is set by default, because we assume that unix compilers are posix-signal-compatible by def…
580 /// A non-owning string class (similar to the forthcoming std::string_view)
614 auto operator == ( StringRef const& other ) const noexcept -> bool;
615 auto operator != (StringRef const& other) const noexcept -> bool { in operator !=()
619 auto operator[] ( size_type index ) const noexcept -> char { in operator []()
625 constexpr auto empty() const noexcept -> bool { in empty()
628 constexpr auto size() const noexcept -> size_type { in size()
633 // null-terminated, throws std::domain_exception
634 auto c_str() const -> char const*;
640 auto substr( size_type start, size_type length ) const noexcept -> StringRef;
642 // Returns the current start pointer. May not be null-terminated.
643 auto data() const noexcept -> char const*;
645 constexpr auto isNullTerminated() const noexcept -> bool { in isNullTerminated()
654 auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
655 auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
657 constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { in operator ""_sr()
662 constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::S… in operator ""_catch_sr()
762 constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
765 constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
795 constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> { return {}; } \
798 constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList<Cs...> { return {}; } \
950 auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker*;
953 auto makeTestInvoker( void (C::*testAsMethod)() ) noexcept -> ITestInvoker* { in makeTestInvoker()
1081 …(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]),…
1127 … ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl…
1171 …Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList…
1205 …(void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_ty…
1254 …s>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl…
1301 …NEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList…
1331 Unknown = -1,
1381 // the struct is then treated as non-aggregate
1415 auto makeStream( StringRef const &filename ) -> IStream const*;
1424 auto str() const -> std::string;
1427 auto operator << ( T const& value ) -> ReusableStringStream& { in operator <<()
1431 auto get() -> std::ostream& { return *m_oss; } in get()
1507 #pragma clang diagnostic ignored "-Warc-performSelector-leaks" in performOptionalSelector()
1544 -> decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type());
1547 static auto test(...)->std::false_type;
1582 auto bytes = System::Text::Encoding::UTF8->GetBytes(ref->ToString());
1584 return std::string(reinterpret_cast<char const *>(p), bytes->Length);
1598 // NB: call using the function-like syntax to avoid ambiguity with in convert()
1599 // user-defined templated operator<< under clang. in convert()
1846 // Separate std-lib types stringification, so it can be selectively enabled
2054 struct ratio_string<std::pico> {
2127 auto const timeStampSize = sizeof("2017-01-16T17:06:45Z"); in convert()
2129 const char * const fmt = "%Y-%m-%dT%H:%M:%SZ"; in convert()
2173 auto isBinaryExpression() const -> bool { return m_isBinaryExpression; } in isBinaryExpression()
2174 auto getResult() const -> bool { return m_result; } in getResult()
2183 // complain if it's not here :-(
2213 auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator &&()
2220 auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator ||()
2227 auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator ==()
2234 auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator !=()
2241 auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator >()
2248 auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator <()
2255 auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator >=()
2262 auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const { in operator <=()
2286 …auto compareEqual( LhsT const& lhs, RhsT const& rhs ) -> bool { return static_cast<bool>(lhs == rh… in compareEqual()
2288 …auto compareEqual( T* const& lhs, int rhs ) -> bool { return lhs == reinterpret_cast<void const*>(… in compareEqual()
2290 …auto compareEqual( T* const& lhs, long rhs ) -> bool { return lhs == reinterpret_cast<void const*>… in compareEqual()
2292 …auto compareEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) … in compareEqual()
2294 …auto compareEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs )… in compareEqual()
2297 …auto compareNotEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return static_cast<bool>(lhs != rhs)… in compareNotEqual()
2299 …auto compareNotEqual( T* const& lhs, int rhs ) -> bool { return lhs != reinterpret_cast<void const… in compareNotEqual()
2301 …auto compareNotEqual( T* const& lhs, long rhs ) -> bool { return lhs != reinterpret_cast<void cons… in compareNotEqual()
2303 …auto compareNotEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs… in compareNotEqual()
2305 …auto compareNotEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lh… in compareNotEqual()
2314 auto operator == ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { in operator ==()
2317 auto operator == ( bool rhs ) -> BinaryExpr<LhsT, bool> const { in operator ==()
2322 auto operator != ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { in operator !=()
2325 auto operator != ( bool rhs ) -> BinaryExpr<LhsT, bool> const { in operator !=()
2330 auto operator > ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { in operator >()
2334 auto operator < ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { in operator <()
2338 auto operator >= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { in operator >=()
2342 auto operator <= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { in operator <=()
2347 auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { in operator &&()
2354 auto operator || ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { in operator ||()
2360 auto makeUnaryExpr() const -> UnaryExpr<LhsT> { in makeUnaryExpr()
2374 auto operator <= ( T const& lhs ) -> ExprLhs<T const&> { in operator <=()
2378 auto operator <=( bool value ) -> ExprLhs<bool> { in operator <=()
2425 … virtual auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
2498 … friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&;
2542 auto allowThrows() const -> bool;
2646 // Another way to speed-up compilation is to omit local try-catch for REQUIRE*
2672 …// The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluat…
2757 // Although this is matcher-based, it can be used with just a string
2788 Counts operator - ( Counts const& other ) const;
2802 Totals operator - ( Totals const& other ) const;
2849 auto getCurrentNanosecondsSinceEpoch() -> uint64_t;
2850 auto getEstimatedClockResolution() -> uint64_t;
2856 auto getElapsedNanoseconds() const -> uint64_t;
2857 auto getElapsedMicroseconds() const -> uint64_t;
2858 auto getElapsedMilliseconds() const -> unsigned int;
2859 auto getElapsedSeconds() const -> double;
2993 return (*it)->translate( it+1, itEnd ); in translate()
3036 // out-of-line to avoid including stdexcept in the header
3039 // out-of-line to avoid including stdexcept in the header
3047 Approx operator-() const;
3166 // !!! Be aware, returns refs into original string - make sure original string outlives them
3212 # pragma clang diagnostic ignored "-Wnon-virtual-dtor"
3245 if (!matcher->match(arg)) in match()
3260 description += matcher->toString(); in describe()
3278 if (matcher->match(arg)) in match()
3293 description += matcher->toString(); in describe()
3400 // Given IEEE-754 format for floats and doubles, we can assume
3401 // that float -> double promotion is lossless. Given this, we can
3403 // |lhs - rhs| <= epsilon * max(fabs(lhs), fabs(rhs)), then we get
3616 // - a more general approach would be via a compare template that defaults in match()
3618 // - then just call that directly in match()
3751 …ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString ) -> MatchExpr<ArgT, Mat… in makeMatchExpr()
3815 virtual auto hasGenerator() const -> bool = 0;
3816 virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
3948 return m_generator->get(); in get()
3951 return m_generator->next(); in next()
4018 auto makeGenerators( GeneratorWrapper<T>&& generator, Gs... moreGenerators ) -> Generators<T> { in makeGenerators()
4022 auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> { in makeGenerators()
4026 auto makeGenerators( T&& val, Gs... moreGenerators ) -> Generators<T> { in makeGenerators()
4030 auto makeGenerators( as<T>, U&& val, Gs... moreGenerators ) -> Generators<T> { in makeGenerators()
4034 auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
4037 // Note: The type after -> is weird, because VS2015 cannot parse
4040 …auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::dec… in generate()
4329 // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn) in getCurrentMutableContext()
4383 nullableValue->~T(); in reset()
4389 T* operator->() { return nullableValue; } in operator ->()
4390 const T* operator->() const { return nullableValue; } in operator ->()
4498 // The implementation is based on the PCG family (http://pcg-random.org)
4507 return static_cast<result_type>(-1); in result_type()
4529 // is chosen -- we take it as a constant for Catch2, so we only
4531 // Picked by reading 8 bytes from `/dev/random` :-)
4627 RangeGenerator(start, end, (start < end) ? T(1) : T(-1)) in RangeGenerator()
4706 #pragma clang diagnostic ignored "-Wpadded"
4798 // header for non obj-usage
4807 -(void) setUp;
4808 -(void) tearDown;
4944 … [str rangeOfString:m_substr].location == [str length] - [m_substr length]; in match()
4986 -(void) OC_MAKE_UNIQUE_NAME( Catch_TestCase_test_, uniqueSuffix )
4993 // Benchmarking needs the externally-facing parts of reporters to work
5007 #pragma clang diagnostic ignored "-Wpadded"
5014 #pragma clang diagnostic ignored "-Wpadded"
5228 int abortAfter = -1;
5675 if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) ) in StreamingReporterBase()
5774 return ((node->stats.sectionInfo.name == m_other.name) && in operator ()()
5775 (node->stats.sectionInfo.lineInfo == m_other.lineInfo)); in operator ()()
5792 if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) ) in CumulativeReporterBase()
5858 node->children.push_back(m_rootSection); in testCaseEnded()
5863 m_deepestSection->stdOut = testCaseStats.stdOut; in testCaseEnded()
5864 m_deepestSection->stdErr = testCaseStats.stdErr; in testCaseEnded()
5868 node->children.swap(m_testCases); in testGroupEnded()
5873 node->children.swap(m_testGroups); in testRunEnded()
5900 std::memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 ); in getLineOfChars()
5901 line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0; in getLineOfChars()
5965 // Use static method for one-shot changes
6199 m_writer->writeAttribute( name, attribute ); in writeAttribute()
6378 // User-facing chronometer
6461 …inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<!std::is_same<v… in invoke_deoptimized()
6466 …inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<std::is_same<vo… in invoke_deoptimized()
6545 ClockDuration<Clock> elapsed() const { return finished - started; } in elapsed()
6572 impl->start(); in measure()
6574 impl->finish(); in measure()
6688 : f(that.f->clone()) {} in BenchmarkFunction()
6696 f.reset(that.f->clone()); in operator =()
6700 void operator()(Chronometer meter) const { f->call(meter); } in operator ()()
6781 auto delta = end - start; in measure()
6860 this->benchmark(Chronometer(model, iterations_per_sample)); in run()
6861 auto sample_time = model.elapsed() - env.clock_cost.mean; in run()
6904 auto iqr = q3 - q1; in classify_outliers()
6905 auto los = q1 - (iqr * 3.); in classify_outliers()
6906 auto lom = q1 - (iqr * 1.5); in classify_outliers()
6924 auto count = last - first; in mean()
6931 auto n = last - first; in resample()
6932 std::uniform_int_distribution<decltype(n)> dist(0, n - 1); in resample()
6948 auto n = last - first; in jackknife()
6962 return std::erfc(-x / std::sqrt(2.0)) / 2.0; in normal_cdf()
6971 auto n_samples = last - first; in bootstrap()
6980 …d::make_pair(0., 0.), [jack_mean](std::pair<double, double> sqcb, double x) -> std::pair<double, d… in bootstrap()
6981 auto d = jack_mean - x; in bootstrap()
6994 double z1 = normal_quantile((1. - confidence_level) / 2.); in bootstrap()
6996 auto cumn = [n](double x) -> int { in bootstrap()
6998 auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); }; in bootstrap()
7000 double b2 = bias - z1; in bootstrap()
7004 auto hi = std::min(cumn(a2), n - 1); in bootstrap()
7042 … [](TimePoint<Clock> a, TimePoint<Clock> b) { return static_cast<double>((a - b).count()); }); in resolution()
7052 const auto clock_cost_estimation_time_limit = std::chrono::seconds(1);
7170 samples.reserve(last - first); in analyse()
7196 samples.reserve(last - first); in analyse()
7261 cfg->benchmarkSamples(), in run()
7262 cfg->benchmarkResamples(), in run()
7390 #pragma clang diagnostic ignored "-Wweak-vtables"
7554 // Cpp files will be included in the single-header file here
7573 w = -log((1.0 - x) * (1.0 + x)); in erf_inv()
7576 w = w - 3.125000; in erf_inv()
7577 p = -3.6444120640178196996e-21; in erf_inv()
7578 p = -1.685059138182016589e-19 + p * w; in erf_inv()
7579 p = 1.2858480715256400167e-18 + p * w; in erf_inv()
7580 p = 1.115787767802518096e-17 + p * w; in erf_inv()
7581 p = -1.333171662854620906e-16 + p * w; in erf_inv()
7582 p = 2.0972767875968561637e-17 + p * w; in erf_inv()
7583 p = 6.6376381343583238325e-15 + p * w; in erf_inv()
7584 p = -4.0545662729752068639e-14 + p * w; in erf_inv()
7585 p = -8.1519341976054721522e-14 + p * w; in erf_inv()
7586 p = 2.6335093153082322977e-12 + p * w; in erf_inv()
7587 p = -1.2975133253453532498e-11 + p * w; in erf_inv()
7588 p = -5.4154120542946279317e-11 + p * w; in erf_inv()
7589 p = 1.051212273321532285e-09 + p * w; in erf_inv()
7590 p = -4.1126339803469836976e-09 + p * w; in erf_inv()
7591 p = -2.9070369957882005086e-08 + p * w; in erf_inv()
7592 p = 4.2347877827932403518e-07 + p * w; in erf_inv()
7593 p = -1.3654692000834678645e-06 + p * w; in erf_inv()
7594 p = -1.3882523362786468719e-05 + p * w; in erf_inv()
7596 p = -0.00074070253416626697512 + p * w; in erf_inv()
7597 p = -0.0060336708714301490533 + p * w; in erf_inv()
7601 w = sqrt(w) - 3.250000; in erf_inv()
7602 p = 2.2137376921775787049e-09; in erf_inv()
7603 p = 9.0756561938885390979e-08 + p * w; in erf_inv()
7604 p = -2.7517406297064545428e-07 + p * w; in erf_inv()
7605 p = 1.8239629214389227755e-08 + p * w; in erf_inv()
7606 p = 1.5027403968909827627e-06 + p * w; in erf_inv()
7607 p = -4.013867526981545969e-06 + p * w; in erf_inv()
7608 p = 2.9234449089955446044e-06 + p * w; in erf_inv()
7609 p = 1.2475304481671778723e-05 + p * w; in erf_inv()
7610 p = -4.7318229009055733981e-05 + p * w; in erf_inv()
7611 p = 6.8284851459573175448e-05 + p * w; in erf_inv()
7612 p = 2.4031110387097893999e-05 + p * w; in erf_inv()
7613 p = -0.0003550375203628474796 + p * w; in erf_inv()
7615 p = -0.0016882755560235047313 + p * w; in erf_inv()
7617 p = -0.0037512085075692412107 + p * w; in erf_inv()
7622 w = sqrt(w) - 5.000000; in erf_inv()
7623 p = -2.7109920616438573243e-11; in erf_inv()
7624 p = -2.5556418169965252055e-10 + p * w; in erf_inv()
7625 p = 1.5076572693500548083e-09 + p * w; in erf_inv()
7626 p = -3.7894654401267369937e-09 + p * w; in erf_inv()
7627 p = 7.6157012080783393804e-09 + p * w; in erf_inv()
7628 p = -1.4960026627149240478e-08 + p * w; in erf_inv()
7629 p = 2.9147953450901080826e-08 + p * w; in erf_inv()
7630 p = -6.7711997758452339498e-08 + p * w; in erf_inv()
7631 p = 2.2900482228026654717e-07 + p * w; in erf_inv()
7632 p = -9.9298272942317002539e-07 + p * w; in erf_inv()
7633 p = 4.5260625972231537039e-06 + p * w; in erf_inv()
7634 p = -1.9681778105531670567e-05 + p * w; in erf_inv()
7635 p = 7.5995277030017761139e-05 + p * w; in erf_inv()
7636 p = -0.00021503011930044477347 + p * w; in erf_inv()
7637 p = -0.00013871931833623122026 + p * w; in erf_inv()
7647 double diff = b - m; in standard_deviation()
7649 }) / (last - first); in standard_deviation()
7660 auto count = last - first; in weighted_average_quantile()
7661 double idx = (count - 1) * k / static_cast<double>(q); in weighted_average_quantile()
7663 double g = idx - j; in weighted_average_quantile()
7669 return xj + g * (xj1 - xj); in weighted_average_quantile()
7673 return erf_inv(1.0 - x); in erfc_inv()
7685 result = -erfc_inv(2.0 * p); in normal_quantile()
7700 auto c_max = [n, mn, sb2, sg2](double x) -> double { in outlier_variance()
7701 double k = mn - x; in outlier_variance()
7704 double k0 = -n * nd; in outlier_variance()
7705 double k1 = sb2 - n * sg2 + nd; in outlier_variance()
7706 double det = k1 * k1 - 4 * sg2 * k0; in outlier_variance()
7707 return (int)(-2. * k0 / (k1 + std::sqrt(det))); in outlier_variance()
7711 double nc = n - c; in outlier_variance()
7712 return (nc / n) * (sb2 - nc * sg2); in outlier_variance()
7724 …auto n = static_cast<int>(last - first); // seriously, one can't use integral types without hell i… in analyse_samples()
7773 // Performs equivalent check of std::fabs(lhs - rhs) <= margin
7795 Approx Approx::operator-() const { in operator -()
7797 temp.m_value = -temp.m_value; in operator -()
7817 << " Approx::Margin has to be non-negative."); in setMargin()
8025 … auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
8086 … std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */
8104 auto operator <<( std::ostream& os, ITransientExpression const& expr ) -> std::ostream& { in operator <<()
8120 auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream& { in operator <<()
8125 if( lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression() ) in operator <<()
8131 os << "{** error - unchecked empty expression requested **}"; in operator <<()
8152 auto AssertionHandler::allowThrows() const -> bool { in allowThrows()
8153 return getCurrentContext().getConfig()->allowThrows(); in allowThrows()
8161 // call-stack for the code that caused it (typically a failed assertion) in complete()
8330 #define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH-1
8334 #pragma clang diagnostic ignored "-Wweak-vtables"
8335 #pragma clang diagnostic ignored "-Wexit-time-destructors"
8336 #pragma clang diagnostic ignored "-Wshadow"
8367 // ----------- #included from clara_textflow.hpp -----------
8371 // A single-header library for wrapping and laying out basic text, by Phil Nash
8392 inline auto isWhitespace(char c) -> bool { in isWhitespace()
8396 inline auto isBreakableBefore(char c) -> bool { in isBreakableBefore()
8400 inline auto isBreakableAfter(char c) -> bool { in isBreakableAfter()
8401 static std::string chars = "])}>.,:;*+-=&/\\"; in isBreakableAfter()
8429 auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; } in line()
8431 auto isBoundary(size_t at) const -> bool { in isBoundary()
8436 (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) || in isBoundary()
8438 isBreakableAfter(line()[at - 1]); in isBoundary()
8445 auto width = m_column.m_width - indent(); in calcLength()
8454 m_len = m_end - m_pos; in calcLength()
8458 --len; in calcLength()
8459 while (len > 0 && isWhitespace(line()[m_pos + len - 1])) in calcLength()
8460 --len; in calcLength()
8466 m_len = width - 1; in calcLength()
8471 auto indent() const -> size_t { in indent()
8476 auto addIndentAndSuffix(std::string const &plain) const -> std::string { in addIndentAndSuffix()
8477 return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain); in addIndentAndSuffix()
8495 auto operator *() const -> std::string { in operator *()
8501 auto operator ++() -> iterator& { in operator ++()
8517 auto operator ++(int) -> iterator { in operator ++()
8523 auto operator ==(iterator const& other) const -> bool { in operator ==()
8529 auto operator !=(iterator const& other) const -> bool { in operator !=()
8537 auto width(size_t newWidth) -> Column& { in width()
8542 auto indent(size_t newIndent) -> Column& { in indent()
8546 auto initialIndent(size_t newIndent) -> Column& { in initialIndent()
8551 auto width() const -> size_t { return m_width; } in width()
8552 auto begin() const -> iterator { return iterator(*this); } in begin()
8553 auto end() const -> iterator { return { *this, m_strings.size() }; } in end()
8567 auto operator + (Column const& other)->Columns;
8569 auto toString() const -> std::string { in toString()
8622 auto operator ==(iterator const& other) const -> bool { in operator ==()
8625 auto operator !=(iterator const& other) const -> bool { in operator !=()
8628 auto operator *() const -> std::string { in operator *()
8637 padding = std::string(width - col.size(), ' '); in operator *()
8646 auto operator ++() -> iterator& { in operator ++()
8653 auto operator ++(int) -> iterator { in operator ++()
8661 auto begin() const -> iterator { return iterator(*this); } in begin()
8662 auto end() const -> iterator { return { *this, iterator::EndTag() }; } in end()
8664 auto operator += (Column const& col) -> Columns& { in operator +=()
8668 auto operator + (Column const& col) -> Columns { in operator +()
8687 auto toString() const -> std::string { in toString()
8694 inline auto Column::operator + (Column const& other) -> Columns { in operator +()
8705 // ----------- end of #include from clara_textflow.hpp -----------
8755 auto exeName() const -> std::string { in exeName()
8770 inline auto isOptPrefix( char c ) -> bool { in isOptPrefix()
8771 return c == '-' in isOptPrefix()
8789 while( it != itEnd && it->empty() ) in loadBuffer()
8800 if( next[1] != '-' && next.size() > 2 ) { in loadBuffer()
8801 std::string opt = "- "; in loadBuffer()
8827 auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); } in count()
8829 auto operator*() const -> Token { in operator *()
8834 auto operator->() const -> Token const * { in operator ->()
8839 auto operator++() -> TokenStream & { in operator ++()
8869 auto value() const -> T const & { in value()
8886 auto operator=( ResultValueBase const &other ) -> ResultValueBase & { in operator =()
8923 static auto ok( U const &value ) -> BasicResult { return { ResultBase::Ok, value }; } in ok()
8924 static auto ok() -> BasicResult { return { ResultBase::Ok }; } in ok()
8925 …static auto logicError( std::string const &message ) -> BasicResult { return { ResultBase::LogicEr… in logicError()
8926 …static auto runtimeError( std::string const &message ) -> BasicResult { return { ResultBase::Runti… in runtimeError()
8929 auto type() const -> ResultBase::Type { return m_type; } in type()
8930 auto errorMessage() const -> std::string { return m_errorMessage; } in errorMessage()
8968 auto type() const -> ParseResultType { return m_type; } in type()
8969 auto remainingTokens() const -> TokenStream { return m_remainingTokens; } in remainingTokens()
8986 inline auto convertInto( std::string const &source, T& target ) -> ParserResult { in convertInto()
8995 inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult { in convertInto()
8999 inline auto convertInto( std::string const &source, bool &target ) -> ParserResult { in convertInto()
9012 …inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> Par… in convertInto()
9031 virtual auto isContainer() const -> bool { return false; } in isContainer()
9032 virtual auto isFlag() const -> bool { return false; } in isFlag()
9035 virtual auto setValue( std::string const &arg ) -> ParserResult = 0;
9038 virtual auto setFlag( bool flag ) -> ParserResult = 0;
9039 virtual auto isFlag() const -> bool { return true; } in isFlag()
9048 auto setValue( std::string const &arg ) -> ParserResult override { in setValue()
9059 auto isContainer() const -> bool override { return true; } in isContainer()
9061 auto setValue( std::string const &arg ) -> ParserResult override { in setValue()
9075 auto setFlag( bool flag ) -> ParserResult override { in setFlag()
9086 static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult { in invoke()
9094 static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult { in invoke()
9101 inline auto invokeLambda( L const &lambda, std::string const &arg ) -> ParserResult { in invokeLambda()
9116 auto setValue( std::string const &arg ) -> ParserResult override { in setValue()
9130 auto setFlag( bool flag ) -> ParserResult override { in setFlag()
9142 virtual auto validate() const -> Result { return Result::ok(); } in validate()
9143 …virtual auto parse( std::string const& exeName, TokenStream const &tokens) const -> InternalParseR…
9144 virtual auto cardinality() const -> size_t { return 1; } in cardinality()
9146 auto parse( Args const &args ) const -> InternalParseResult { in parse()
9155 auto operator|( T const &other ) const -> Parser;
9158 auto operator+( T const &other ) const -> Parser;
9185 auto operator()( std::string const &description ) -> DerivedT & { in operator ()()
9190 auto optional() -> DerivedT & { in optional()
9195 auto required() -> DerivedT & { in required()
9200 auto isOptional() const -> bool { in isOptional()
9204 auto cardinality() const -> size_t override { in cardinality()
9205 if( m_ref->isContainer() ) in cardinality()
9211 auto hint() const -> std::string { return m_hint; } in hint()
9219 static auto makeRef(LambdaT const &lambda) -> std::shared_ptr<BoundValueRefBase> { in makeRef()
9236 …auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override { in parse()
9240 auto name() const -> std::string { return *m_name; } in name()
9241 auto set( std::string const& newName ) -> ParserResult { in set()
9250 return m_ref->setValue( filename ); in set()
9260 …auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override… in parse()
9270 assert( !m_ref->isFlag() ); in parse()
9273 auto result = valueRef->setValue( remainingTokens->token ); in parse()
9281 inline auto normaliseOpt( std::string const &optName ) -> std::string { in normaliseOpt()
9284 return "-" + optName.substr( 1 ); in normaliseOpt()
9306 auto operator[]( std::string const &optName ) -> Opt & { in operator []()
9311 auto getHelpColumns() const -> std::vector<HelpColumns> { in getHelpColumns()
9326 auto isMatch( std::string const &optToken ) const -> bool { in isMatch()
9337 …auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override { in parse()
9343 if( remainingTokens && remainingTokens->type == TokenType::Option ) { in parse()
9346 if( m_ref->isFlag() ) { in parse()
9348 auto result = flagRef->setFlag( true ); in parse()
9361 auto result = valueRef->setValue( argToken.token ); in parse()
9373 auto validate() const -> Result override { in validate()
9380 if( name[0] != '-' && name[0] != '/' ) in validate()
9381 return Result::logicError( "Option name must begin with '-' or '/'" ); in validate()
9383 if( name[0] != '-' ) in validate()
9384 return Result::logicError( "Option name must begin with '-'" ); in validate()
9400 ["-?"]["-h"]["--help"]
9411 auto operator|=( ExeName const &exeName ) -> Parser & { in operator |=()
9416 auto operator|=( Arg const &arg ) -> Parser & { in operator |=()
9421 auto operator|=( Opt const &opt ) -> Parser & { in operator |=()
9426 auto operator|=( Parser const &other ) -> Parser & { in operator |=()
9433 auto operator|( T const &other ) const -> Parser { in operator |()
9439 auto operator+=( T const &other ) -> Parser & { return operator|=( other ); } in operator +=()
9441 auto operator+( T const &other ) const -> Parser { return operator|( other ); } in operator +()
9443 auto getHelpColumns() const -> std::vector<HelpColumns> { in getHelpColumns()
9488 TextFlow::Column( cols.right ).width( consoleWidth - 7 - optWidth ); in writeToStream()
9493 friend auto operator<<( std::ostream &os, Parser const &parser ) -> std::ostream& { in operator <<()
9498 auto validate() const -> Result override { in validate()
9514 …auto parse( std::string const& exeName, TokenStream const &tokens ) const -> InternalParseResult o… in parse()
9522 // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do in parse()
9539 … if( parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality() ) { in parse()
9540 result = parseInfo.parser->parse(exeName, result.value().remainingTokens()); in parse()
9554 …ernalParseResult::runtimeError( "Unrecognised token: " + result.value().remainingTokens()->token ); in parse()
9563 auto ComposableParserImpl<DerivedT>::operator|( T const &other ) const -> Parser { in operator |()
9656 config.testsOrTags.erase( config.testsOrTags.end()-1 ); in makeCommandLineParser()
9723 …runtimeError( "Unrecognized reporter, '" + reporter + "'. Check available with --list-reporters" ); in makeCommandLineParser()
9731 ["-l"]["--list-tests"] in makeCommandLineParser()
9734 ["-t"]["--list-tags"] in makeCommandLineParser()
9737 ["-s"]["--success"] in makeCommandLineParser()
9740 ["-b"]["--break"] in makeCommandLineParser()
9743 ["-e"]["--nothrow"] in makeCommandLineParser()
9746 ["-i"]["--invisibles"] in makeCommandLineParser()
9749 ["-o"]["--out"] in makeCommandLineParser()
9752 ["-r"]["--reporter"] in makeCommandLineParser()
9755 ["-n"]["--name"] in makeCommandLineParser()
9758 ["-a"]["--abort"] in makeCommandLineParser()
9761 ["-x"]["--abortx"] in makeCommandLineParser()
9764 ["-w"]["--warn"] in makeCommandLineParser()
9767 ["-d"]["--durations"] in makeCommandLineParser()
9770 ["-f"]["--input-file"] in makeCommandLineParser()
9773 ["-#"]["--filenames-as-tags"] in makeCommandLineParser()
9776 ["-c"]["--section"] in makeCommandLineParser()
9779 ["-v"]["--verbosity"] in makeCommandLineParser()
9782 ["--list-test-names-only"] in makeCommandLineParser()
9785 ["--list-reporters"] in makeCommandLineParser()
9788 ["--order"] in makeCommandLineParser()
9791 ["--rng-seed"] in makeCommandLineParser()
9794 ["--use-colour"] in makeCommandLineParser()
9797 ["--libidentify"] in makeCommandLineParser()
9800 ["--wait-for-keypress"] in makeCommandLineParser()
9803 ["--benchmark-samples"] in makeCommandLineParser()
9806 ["--benchmark-resamples"] in makeCommandLineParser()
9809 ["--benchmark-confidence-interval"] in makeCommandLineParser()
9812 ["--benchmark-no-analysis"] in makeCommandLineParser()
9907 std::ostream& Config::stream() const { return m_stream->stream(); } in stream()
9936 # pragma clang diagnostic ignored "-Wexit-time-destructors"
10037 ? config->useColour() in platformColourInstance()
10090 getCurrentContext().getConfig()->stream() in setColour()
10111 ? config->useColour() in platformColourInstance()
10157 impl->use( _colourCode ); in use()
10318 …Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << … in isDebuggerActive()
10328 // We need to find another way to determine this for non-appleclang compilers on macOS
10473 while (name_start > 0 && enumInstance[name_start - 1] != ':') { in extractInstanceName()
10474 --name_start; in extractInstanceName()
10476 return enumInstance.substr(name_start, enumInstance.size() - name_start); in extractInstanceName()
10502 enumInfo->m_name = enumName; in makeEnumInfo()
10503 enumInfo->m_values.reserve( values.size() ); in makeEnumInfo()
10509 enumInfo->m_values.push_back({ value, valueNames[i++] }); in makeEnumInfo()
10572 // In Objective-C try objective-c exceptions first in translateActiveException()
10582 // do not fill-in std::current_exception and thus lead to crash in translateActiveException()
10585 // here, but they fill-in current_exception properly, so in translateActiveException()
10615 return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end()); in tryTranslators()
10635 # pragma GCC diagnostic ignored "-Wmissing-field-initializers"
10643 Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message ); in reportFatal()
10654 // There is no 1-1 mapping between signals and windows exceptions.
10658 … { static_cast<DWORD>(EXCEPTION_ILLEGAL_INSTRUCTION), "SIGILL - Illegal instruction signal" },
10659 { static_cast<DWORD>(EXCEPTION_STACK_OVERFLOW), "SIGSEGV - Stack overflow" },
10660 … { static_cast<DWORD>(EXCEPTION_ACCESS_VIOLATION), "SIGSEGV - Segmentation violation signal" },
10666 if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) { in handleVectoredException()
10720 { SIGINT, "SIGINT - Terminal interrupt signal" },
10721 { SIGILL, "SIGILL - Illegal instruction signal" },
10722 { SIGFPE, "SIGFPE - Floating point error signal" },
10723 { SIGSEGV, "SIGSEGV - Segmentation violation signal" },
10724 { SIGTERM, "SIGTERM - Termination request signal" },
10725 { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" }
10763 … // Set signals back to previous values -- hopefully nobody overwrote them in the meantime in reset()
10809 auto acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& { in acquireGeneratorTracker()
10901 : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} in ReporterConfig()
11028 _CrtSetBreakAlloc(-1); in LeakDetector()
11173 countIt->second.add( tagName ); in listTags()
11184 .width( CATCH_CONFIG_CONSOLE_WIDTH-10 ); in listTags()
11203 + Column( factoryKvp.second->getDescription() ) in listReporters()
11206 .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) in listReporters()
11216 if( config->listTests() ) in list()
11218 if( config->listTestNamesOnly() ) in list()
11220 if( config->listTags() ) in list()
11222 if( config->listReporters() ) in list()
11341 // Potentially we can have +0 and -0 in almostEqualUlps()
11345 auto ulpDiff = std::abs(lc - rc); in almostEqualUlps()
11356 #pragma clang diagnostic ignored "-Wunused-function"
11391 // Performs equivalent check of std::fabs(lhs - rhs) <= margin
11400 << std::setprecision(std::numeric_limits<FloatingPoint>::max_digits10 - 1) in write()
11417 << " Margin has to be non-negative.");
11420 // Performs equivalent check of std::fabs(lhs - rhs) <= margin
11440 #pragma clang diagnostic ignored "-Wunreachable-code"
11472 write(ret, step(m_target, static_cast<double>(-INFINITY), m_ulps)); in describe()
11477 write(ret, step(static_cast<float>(m_target), static_cast<float>(-INFINITY), m_ulps)); in describe()
11719 --end; in Capturer()
11721 return names.substr(start, end - start + 1); in Capturer()
11767 m_messages.back().message = static_cast<std::string>(trimmed(start, names.size() - 1)); in Capturer()
11814 auto str() const -> std::string;
11826 auto str() const -> std::string;
11882 int m_originalStdout = -1;
11883 int m_originalStderr = -1;
11928 auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); } in str()
11934 auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); } in str()
12071 return (val >> count) | (val << (-count & mask)); in rotate_right()
12272 static auto getInternal() -> Singleton* { in getInternal()
12282 static auto get() -> InterfaceT const& { in get()
12285 static auto getMutable() -> MutableInterfaceT& { in getMutable()
12379 return it->second->create( ReporterConfig( config ) ); in create()
12441 assert( childTracker->isGeneratorTracker() ); in acquire()
12449 if( !ctx.completedCycle() && !tracker->isComplete() ) { in acquire()
12450 tracker->open(); in acquire()
12458 auto hasGenerator() const -> bool override { in hasGenerator()
12464 if (m_runState == CompletedSuccessfully && m_generator->next()) { in close()
12471 auto getGenerator() const -> GeneratorBasePtr const& override { in getGenerator()
12482 : m_runInfo(_config->name()), in RunContext()
12487 …m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().s…
12492 m_reporter->testRunStarting(m_runInfo);
12496 m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting())); in ~RunContext()
12500 m_reporter->testGroupStarting(GroupInfo(testSpec, groupIndex, groupsCount)); in testGroupStarting()
12504 …m_reporter->testGroupEnded(TestGroupStats(GroupInfo(testSpec, groupIndex, groupsCount), totals, ab… in testGroupEnded()
12515 m_reporter->testCaseStarting(testInfo); in runTest()
12521 static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); in runTest()
12526 } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); in runTest()
12531 deltaTotals.testCases.passed--; in runTest()
12535 m_reporter->testCaseEnded(TestCaseStats(testInfo, in runTest()
12561 if( m_activeTestCase->getTestCaseInfo().okToFail() ) in assertionEnded()
12572 static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); in assertionEnded()
12594 m_reporter->sectionStarting(sectionInfo); in sectionStarted()
12600 … auto RunContext::acquireGeneratorTracker( SourceLineInfo const& lineInfo ) -> IGeneratorTracker& { in acquireGeneratorTracker()
12611 if (!m_config->warnAboutMissingAssertions()) in testForMissingAssertions()
12621 Counts assertions = m_totals.assertions - endInfo.prevAssertions; in sectionEnded()
12625 m_activeSections.back()->close(); in sectionEnded()
12629 …m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, … in sectionEnded()
12636 m_activeSections.back()->fail(); in sectionEndedEarly()
12638 m_activeSections.back()->close(); in sectionEndedEarly()
12646 m_reporter->benchmarkPreparing(name); in benchmarkPreparing()
12649 m_reporter->benchmarkStarting( info ); in benchmarkStarting()
12652 m_reporter->benchmarkEnded( stats ); in benchmarkEnded()
12655 m_reporter->benchmarkFailed(error); in benchmarkFailed()
12673 ? m_activeTestCase->getTestCaseInfo().name in getCurrentTestName()
12687 m_reporter->fatalErrorEncountered(message); in handleFatalErrorCondition()
12689 // Don't rebuild the result -- the stringification itself can cause more fatal errors in handleFatalErrorCondition()
12700 auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); in handleFatalErrorCondition()
12706 m_reporter->sectionEnded(testCaseSectionStats); in handleFatalErrorCondition()
12708 auto const& testInfo = m_activeTestCase->getTestCaseInfo(); in handleFatalErrorCondition()
12713 m_reporter->testCaseEnded(TestCaseStats(testInfo, in handleFatalErrorCondition()
12720 m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false)); in handleFatalErrorCondition()
12735 return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter()); in aborting()
12739 auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); in runCurrentTest()
12741 m_reporter->sectionStarting(testCaseSection); in runCurrentTest()
12751 if (m_reporter->getPreferences().shouldRedirectStdOut) { in runCurrentTest()
12777 Counts assertions = m_totals.assertions - prevAssertions; in runCurrentTest()
12780 m_testCaseTracker->close(); in runCurrentTest()
12786 m_reporter->sectionEnded(testCaseSectionStats); in runCurrentTest()
12791 m_activeTestCase->invoke(); in invokeActiveTestCase()
12811 m_reporter->assertionStarting( info ); in handleExpr()
12850 m_reporter->assertionStarting( info ); in handleMessage()
12883 reaction.shouldDebugBreak = m_config->shouldDebugBreak(); in populateReaction()
12927 return getCurrentContext().getConfig()->rngSeed(); in rngSeed()
13075 return createReporter(config->getReporterName(), config); in makeReporter()
13087 multi.addListener(listener->create(Catch::ReporterConfig(config))); in makeReporter()
13089 multi.addReporter(createReporter(config->getReporterName(), config)); in makeReporter()
13100 m_matches = m_config->testSpec().matchesByFilter(allTestCases, *m_config);
13101 auto const& invalidArgs = m_config->testSpec().getInvalidArgs();
13114 auto const& invalidArgs = m_config->testSpec().getInvalidArgs(); in execute()
13116 m_context.testGroupStarting(m_config->name(), 1, 1); in execute()
13127 totals.error = -1; in execute()
13136 m_context.testGroupEnded(m_config->name(), totals, 1, 1); in execute()
13180 // There cannot be exceptions at startup in no-exception mode. in Session()
13235 Catch::cerr() << "Run with -? for usage\n" << std::endl; in applyCommandLine()
13253 int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, NULL, 0, NULL, NULL ); in applyCommandLine()
13257 WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, NULL, NULL ); in applyCommandLine()
13327 if( m_config->warnAboutNoTests() && totals.error == -1 ) in runInternal()
13352 static auto getSingletons() -> std::vector<ISingleton*>*& { in getSingletons()
13363 getSingletons()->push_back( singleton ); in addSingleton()
13382 … // If we run out of memory during start-up there's really not a lot more we can do about it in add()
13436 … m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) ); in sync()
13473 // Store the streambuf from cout up-front because
13503 auto makeStream( StringRef const &filename ) -> IStream const* { in makeStream()
13522 auto add() -> std::size_t { in add()
13525 return m_streams.size()-1; in add()
13535 m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state in release()
13546 static_cast<std::ostringstream*>( m_oss )->str(""); in ~ReusableStringStream()
13547 m_oss->clear(); in ~ReusableStringStream()
13551 auto ReusableStringStream::str() const -> std::string { in str()
13552 return static_cast<std::ostringstream*>( m_oss )->str(); in str()
13590 return !s.empty() && s[s.size()-1] == suffix; in endsWith()
13608 return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string(); in trim()
13618 while (real_end > real_begin && is_ws(ref[real_end - 1])) { --real_end; } in trim()
13620 return ref.substr(real_begin, real_end - real_begin); in trim()
13629 if( i < str.size()-withThis.size() ) in replaceInPlace()
13642 if( pos - start > 1 ) in splitStringRef()
13643 subStrings.push_back( str.substr( start, pos-start ) ); in splitStringRef()
13648 subStrings.push_back( str.substr( start, str.size()-start ) ); in splitStringRef()
13678 auto StringRef::c_str() const -> char const* { in c_str()
13679 … CATCH_ENFORCE(isNullTerminated(), "Called StringRef::c_str() on a non-null-terminated instance"); in c_str()
13682 auto StringRef::data() const noexcept -> char const* { in data()
13686 auto StringRef::substr( size_type start, size_type size ) const noexcept -> StringRef { in substr()
13688 return StringRef(m_start + start, (std::min)(m_size - start, size)); in substr()
13693 auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool { in operator ==()
13698 auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& { in operator <<()
13702 auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& { in operator +=()
13741 return &(it->second); in find()
13765 << "\tFirst seen at: " << find(alias)->lineInfo << "\n" in add()
13929 test->invoke(); in invoke()
13988 << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n" in enforceNoDuplicateTestCases()
14044 std::size_t penultimateColons = className.rfind( "::", lastColons-1 ); in extractClassName()
14047 className = className.substr( penultimateColons, lastColons-penultimateColons ); in extractClassName()
14064 # pragma clang diagnostic ignored "-Wexit-time-destructors"
14138 tracker->nameAndLocation().location == nameAndLocation.location && in findChild()
14139 tracker->nameAndLocation().name == nameAndLocation.name; in findChild()
14146 assert( m_parent ); // Should always be non-null except for root in parent()
14154 m_parent->openChild(); in openChild()
14165 m_parent->openChild(); in open()
14182 …all_of(m_children.begin(), m_children.end(), [](ITrackerPtr const& t){ return t->isComplete(); }) ) in close()
14200 m_parent->markAsNeedingAnotherRun(); in fail()
14221 while( !parent->isSectionTracker() ) in SectionTracker()
14222 parent = &parent->parent(); in SectionTracker()
14247 assert( childTracker->isSectionTracker() ); in acquire()
14255 section->tryOpen(); in acquire()
14267 m_filters.push_back(""); // Root - should never be consulted in addInitialFilters()
14268 m_filters.push_back(""); // Test Case - not a section filter in addInitialFilters()
14293 auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker* { in makeTestInvoker()
14357 : Pattern( underlyingPattern->name() ) in ExcludedPattern()
14362 return !m_underlyingPattern->matches( testCase ); in matches()
14366 …( m_patterns.begin(), m_patterns.end(), [&]( PatternPtr const& p ){ return p->matches( testCase );… in matches()
14372 name += p->name(); in name()
14412 m_arg = m_tagAliases->expandAliases( arg ); in parse()
14575 token = token.substr(0, m_escapeChars[i] - i) + token.substr(m_escapeChars[i] - i + 1); in preprocessPattern()
14642 auto getCurrentNanosecondsSinceEpoch() -> uint64_t { in getCurrentNanosecondsSinceEpoch()
14647 auto estimateClockResolution() -> uint64_t { in estimateClockResolution()
14661 auto delta = ticks - baseTicks; in estimateClockResolution()
14664 // If we have been calibrating for over 3 seconds -- the clock in estimateClockResolution()
14673 // - and potentially do more iterations if there's a high variance. in estimateClockResolution()
14677 auto getEstimatedClockResolution() -> uint64_t { in getEstimatedClockResolution()
14685 auto Timer::getElapsedNanoseconds() const -> uint64_t { in getElapsedNanoseconds()
14686 return getCurrentNanosecondsSinceEpoch() - m_nanoseconds; in getElapsedNanoseconds()
14688 auto Timer::getElapsedMicroseconds() const -> uint64_t { in getElapsedMicroseconds()
14691 auto Timer::getElapsedMilliseconds() const -> unsigned int { in getElapsedMilliseconds()
14694 auto Timer::getElapsedSeconds() const -> double { in getElapsedSeconds()
14704 # pragma clang diagnostic ignored "-Wexit-time-destructors"
14705 # pragma clang diagnostic ignored "-Wglobal-constructors"
14730 // If the lowest byte we read is non-zero, we can assume in which()
14742 i = end-1; in rawMemoryToString()
14743 end = inc = -1; in rawMemoryToString()
14767 if( i != std::string::npos && i != d.size()-1 ) { in fpToString()
14777 // Out-of-line defs for full specialization of StringMaker
14782 if (!getCurrentContext().getConfig()->showInvisibles()) { in convert()
14940 std::string ratio_string<std::pico>::symbol() { return "p"; } in symbol()
14956 Counts Counts::operator - ( Counts const& other ) const { in operator -()
14958 diff.passed = passed - other.passed; in operator -()
14959 diff.failed = failed - other.failed; in operator -()
14960 diff.failedButOk = failedButOk - other.failedButOk; in operator -()
14981 Totals Totals::operator - ( Totals const& other ) const { in operator -()
14983 diff.assertions = assertions - other.assertions; in operator -()
14984 diff.testCases = testCases - other.testCases; in operator -()
14995 Totals diff = *this - prevTotals; in delta()
15044 // branchName is never null -> 0th char is \0 if it is empty in operator <<()
15046 os << '-' << version.branchName in operator <<()
15073 m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); in WildcardPattern()
15119 CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); in trailingBytes()
15132 CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); in headerValue()
15184 if (idx > 2 && m_str[idx - 1] == ']' && m_str[idx - 2] == ']') in encodeTo()
15198 // Check for control characters and invalid utf-8 in encodeTo()
15201 … // see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0 in encodeTo()
15213 // UTF-8 territory in encodeTo()
15226 // Are there enough bytes left to avoid accessing out-of-bounds memory? in encodeTo()
15227 if (idx + encBytes - 1 >= m_str.size()) { in encodeTo()
15232 // The next encBytes bytes must together be a valid utf-8 in encodeTo()
15256 // If we got here, this is in fact a valid(ish) utf-8 sequence in encodeTo()
15260 idx += encBytes - 1; in encodeTo()
15285 m_writer->endElement(); in operator =()
15296 m_writer->endElement(m_fmt); in ~ScopedElement()
15301 m_writer->writeText( text, fmt ); in writeText()
15338 m_indent = m_indent.substr(0, m_indent.size() - 2); in endElement()
15385 m_os << "<!--" << text << "-->"; in writeComment()
15391 m_os << "<?xml-stylesheet type=\"text/xsl\" href=\"" << url << "\"?>\n"; in writeStylesheetRef()
15413 m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; in writeDeclaration()
15512 // - white: No tests ran.
15513 // - red: Failed [both/all] N test cases, failed [both/all] M assertions.
15514 // - white: Passed [both/all] N test cases (no assertions).
15515 // - red: Failed N tests cases, failed M assertions.
15516 // - green: Passed [both/all] N tests cases with M assertions.
15578 … printResultType(Colour::ResultSuccess, failedString() + std::string(" - but was ok")); in print()
15678 stream << " '" << itMessage->message << '\''; in printMessage()
15697 if (printInfoMessages || itMessage->type != ResultWas::Info) { in printRemainingMessages()
15739 if( !m_config->includeSuccessfulResults() && result.isOk() ) { in assertionEnded()
15753 if (m_config->showDurations() == ShowDurations::Always) { in sectionEnded()
15783 // For simplicity, benchmarking-only helpers are always enabled
15784 # pragma clang diagnostic ignored "-Wunused-function"
15817 passOrFail = "FAILED - but was ok"; in ConsoleAssertionPrinter()
15958 Seconds, enumerator
15985 m_units = Unit::Seconds; in Duration()
15992 auto value() const -> double { in value()
15998 case Unit::Seconds: in value()
16006 auto unitsAsString() const -> std::string { in unitsAsString()
16014 case Unit::Seconds: in unitsAsString()
16023 friend auto operator << (std::ostream& os, Duration const& duration) -> std::ostream& { in operator <<()
16033 int m_currentColumn = -1;
16041 auto columnInfos() const -> std::vector<ColumnInfo> const& { in columnInfos()
16053 headerCols += Column(info.name).width(static_cast<std::size_t>(info.width - 2)); in open()
16058 m_os << Catch::getLineOfChars<'-'>() << '\n'; in open()
16080 if (tp.m_currentColumn == static_cast<int>(tp.m_columnInfos.size() - 1)) { in operator <<()
16081 tp.m_currentColumn = -1; in operator <<()
16088 ? std::string(colInfo.width - (strSize + 1), ' ') in operator <<()
16100 tp.m_currentColumn = -1; in operator <<()
16109 [&config]() -> std::vector<ColumnInfo> { in ConsoleReporter()
16110 if (config.fullConfig()->benchmarkNoAnalysis()) in ConsoleReporter()
16113 { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, ColumnInfo::Left }, in ConsoleReporter()
16122 { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 32, ColumnInfo::Left }, in ConsoleReporter()
16148 bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); in assertionEnded()
16163 m_tablePrinter->close(); in sectionStarting()
16168 m_tablePrinter->close(); in sectionEnded()
16178 if (m_config->showDurations() == ShowDurations::Always) { in sectionEnded()
16191 …nameCol = Column(name).width(static_cast<std::size_t>(m_tablePrinter->columnInfos()[0].width - 2)); in benchmarkPreparing()
16207 if (!m_config->benchmarkNoAnalysis()) in benchmarkStarting()
16211 if (m_config->benchmarkNoAnalysis()) in benchmarkEnded()
16236 m_tablePrinter->close(); in testCaseEnded()
16262 m_tablePrinter->close(); in lazyPrint()
16281 stream << currentTestRunInfo->name in lazyPrintRunInfo()
16283 << "Run with -? for options\n\n"; in lazyPrintRunInfo()
16285 if (m_config->rngSeed() != 0) in lazyPrintRunInfo()
16286 stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n"; in lazyPrintRunInfo()
16291 if (!currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1) { in lazyPrintGroupInfo()
16292 printClosedHeader("Group: " + currentGroupInfo->name); in lazyPrintGroupInfo()
16298 printOpenHeader(currentTestCaseInfo->name); in printTestCaseAndSectionHeader()
16307 printHeaderString(it->name, 2); in printTestCaseAndSectionHeader()
16312 stream << getLineOfChars<'-'>() << '\n'; in printTestCaseAndSectionHeader()
16323 stream << getLineOfChars<'-'>() << '\n'; in printOpenHeader()
16403 stream << Colour(Colour::Warning) << "- none -"; in printSummaryRow()
16418 while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) in printTotalsDivider()
16420 while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) in printTotalsDivider()
16421 findMax(failedRatio, failedButOkRatio, passedRatio)--; in printTotalsDivider()
16430 stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '='); in printTotalsDivider()
16435 stream << getLineOfChars<'-'>() << '\n'; in printSummaryDivider()
16439 if (m_config->testSpec().hasFilters()) in printTestFilters()
16440 …stream << Colour(Colour::BrightYellow) << "Filters: " << serializeFilters( m_config->getTestsOrTag… in printTestFilters()
16470 auto const timeStampSize = sizeof("2017-01-16T17:06:45Z"); in getCurrentTimestamp()
16481 const char * const fmt = "%Y-%m-%dT%H:%M:%SZ"; in getCurrentTimestamp()
16496 return it->substr(1); in fileNameTag()
16562 xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions ); in writeGroup()
16565 if( m_config->showDurations() == ShowDurations::Never ) in writeGroup()
16572 if (m_config->hasTestFilters() || m_config->rngSeed() != 0) { in writeGroup()
16574 if (m_config->hasTestFilters()) { in writeGroup()
16577 .writeAttribute("value", serializeFilters(m_config->getTestsOrTags())); in writeGroup()
16579 if (m_config->rngSeed() != 0) { in writeGroup()
16581 .writeAttribute("name", "random-seed") in writeGroup()
16582 .writeAttribute("value", m_config->rngSeed()); in writeGroup()
16590 … xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline ); in writeGroup()
16591 … xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline ); in writeGroup()
16597 // All test cases have exactly one section - which represents the in writeTestCase()
16598 // test case itself. That section may have 0-n nested sections in writeTestCase()
16610 if ( !m_config->name().empty() ) in writeTestCase()
16611 className = m_config->name() + "." + className; in writeTestCase()
16640 … xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline ); in writeSection()
16642 … xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), XmlFormatting::Newline ); in writeSection()
16740 m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut; in addReporter()
16753 listener->noMatchingTestCases( spec ); in noMatchingTestCases()
16755 m_reporter->noMatchingTestCases( spec ); in noMatchingTestCases()
16760 listener->reportInvalidArguments( arg ); in reportInvalidArguments()
16762 m_reporter->reportInvalidArguments( arg ); in reportInvalidArguments()
16768 listener->benchmarkPreparing(name); in benchmarkPreparing()
16770 m_reporter->benchmarkPreparing(name); in benchmarkPreparing()
16774 listener->benchmarkStarting( benchmarkInfo ); in benchmarkStarting()
16776 m_reporter->benchmarkStarting( benchmarkInfo ); in benchmarkStarting()
16780 listener->benchmarkEnded( benchmarkStats ); in benchmarkEnded()
16782 m_reporter->benchmarkEnded( benchmarkStats ); in benchmarkEnded()
16787 listener->benchmarkFailed(error); in benchmarkFailed()
16789 m_reporter->benchmarkFailed(error); in benchmarkFailed()
16795 listener->testRunStarting( testRunInfo ); in testRunStarting()
16797 m_reporter->testRunStarting( testRunInfo ); in testRunStarting()
16802 listener->testGroupStarting( groupInfo ); in testGroupStarting()
16804 m_reporter->testGroupStarting( groupInfo ); in testGroupStarting()
16809 listener->testCaseStarting( testInfo ); in testCaseStarting()
16811 m_reporter->testCaseStarting( testInfo ); in testCaseStarting()
16816 listener->sectionStarting( sectionInfo ); in sectionStarting()
16818 m_reporter->sectionStarting( sectionInfo ); in sectionStarting()
16823 listener->assertionStarting( assertionInfo ); in assertionStarting()
16825 m_reporter->assertionStarting( assertionInfo ); in assertionStarting()
16831 static_cast<void>( listener->assertionEnded( assertionStats ) ); in assertionEnded()
16833 return m_reporter->assertionEnded( assertionStats ); in assertionEnded()
16838 listener->sectionEnded( sectionStats ); in sectionEnded()
16840 m_reporter->sectionEnded( sectionStats ); in sectionEnded()
16845 listener->testCaseEnded( testCaseStats ); in testCaseEnded()
16847 m_reporter->testCaseEnded( testCaseStats ); in testCaseEnded()
16852 listener->testGroupEnded( testGroupStats ); in testGroupEnded()
16854 m_reporter->testGroupEnded( testGroupStats ); in testGroupEnded()
16859 listener->testRunEnded( testRunStats ); in testRunEnded()
16861 m_reporter->testRunEnded( testRunStats ); in testRunEnded()
16866 listener->skipTest( testInfo ); in skipTest()
16868 m_reporter->skipTest( testInfo ); in skipTest()
16921 if( !m_config->name().empty() ) in testRunStarting()
16922 m_xml.writeAttribute( "name", m_config->name() ); in testRunStarting()
16923 if (m_config->testSpec().hasFilters()) in testRunStarting()
16924 m_xml.writeAttribute( "filters", serializeFilters( m_config->getTestsOrTags() ) ); in testRunStarting()
16925 if( m_config->rngSeed() != 0 ) in testRunStarting()
16927 .writeAttribute( "seed", m_config->rngSeed() ); in testRunStarting()
16945 if ( m_config->showDurations() == ShowDurations::Always ) in testCaseStarting()
16966 bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); in assertionEnded()
17038 if( --m_sectionDepth > 0 ) { in sectionEnded()
17044 if ( m_config->showDurations() == ShowDurations::Always ) in sectionEnded()
17056 if ( m_config->showDurations() == ShowDurations::Always ) in testCaseEnded()
17098 .writeComment("All values in nano seconds"); in benchmarkStarting()
17169 // Objective-C entry point
17277 // "BDD-style" convenience wrappers
17380 // "BDD-style" convenience wrappers
17474 // "BDD-style" convenience wrappers
17564 // "BDD-style" convenience wrappers