mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Standardize and document the parallel processing toggle
This commit is contained in:
parent
e640c3837a
commit
c365ac392b
@ -150,6 +150,7 @@ by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`.
|
|||||||
CATCH_CONFIG_WCHAR // Enables use of wchart_t
|
CATCH_CONFIG_WCHAR // Enables use of wchart_t
|
||||||
CATCH_CONFIG_EXPERIMENTAL_REDIRECT // Enables the new (experimental) way of capturing stdout/stderr
|
CATCH_CONFIG_EXPERIMENTAL_REDIRECT // Enables the new (experimental) way of capturing stdout/stderr
|
||||||
CATCH_CONFIG_ENABLE_BENCHMARKING // Enables the integrated benchmarking features (has a significant effect on compilation speed)
|
CATCH_CONFIG_ENABLE_BENCHMARKING // Enables the integrated benchmarking features (has a significant effect on compilation speed)
|
||||||
|
CATCH_CONFIG_USE_ASYNC // Force parallel statistical processing of samples during benchmarking
|
||||||
|
|
||||||
Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support.
|
Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
|
|
||||||
#if defined(CATCH_USE_ASYNC)
|
#if defined(CATCH_CONFIG_USE_ASYNC)
|
||||||
#include <future>
|
#include <future>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ namespace Catch {
|
|||||||
auto mean = &Detail::mean<std::vector<double>::iterator>;
|
auto mean = &Detail::mean<std::vector<double>::iterator>;
|
||||||
auto stddev = &standard_deviation;
|
auto stddev = &standard_deviation;
|
||||||
|
|
||||||
#ifdef CATCH_USE_ASYNC
|
#if defined(CATCH_CONFIG_USE_ASYNC)
|
||||||
auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
|
auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
|
||||||
auto seed = entropy();
|
auto seed = entropy();
|
||||||
return std::async(std::launch::async, [=] {
|
return std::async(std::launch::async, [=] {
|
||||||
|
@ -152,7 +152,7 @@
|
|||||||
|
|
||||||
#if defined(_REENTRANT) || defined(_MSC_VER)
|
#if defined(_REENTRANT) || defined(_MSC_VER)
|
||||||
// Enable async processing, as -pthread is specified or no additional linking is required
|
// Enable async processing, as -pthread is specified or no additional linking is required
|
||||||
# define CATCH_USE_ASYNC
|
# define CATCH_INTERNAL_CONFIG_USE_ASYNC
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -272,6 +272,10 @@
|
|||||||
# define CATCH_CONFIG_POLYFILL_ISNAN
|
# define CATCH_CONFIG_POLYFILL_ISNAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
|
||||||
|
# define CATCH_CONFIG_USE_ASYNC
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
|
#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
|
||||||
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
|
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
|
||||||
# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS
|
# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS
|
||||||
|
Loading…
Reference in New Issue
Block a user