* Fix non-default-constructible type lists used in TEMPLATE_LIST_TEST_CASE
std::tuple is not default constructible when the first type is not
default-constuctible. Therefore it can not be instantiated.
to circumvent this, we have to use std::declval in the unevaluate decltype
context.
- The current setup tries to detect USE_CPP14/USE_CPP17 and sets the
CXX_STANDARD property for the SelfTest target. This is not ideal, since
CMAKE_CXX_STANDARD can be provided by the toolchain file or as command line
option and should be used by the library internally correctly. Hence, the
whole set of the relevant lines from `projects/CMakeLists.txt` have been
removed.
- The above can also cause subtle issues where the user is expecting the tests
to compile with C++17 after setting CMAKE_CXX_STANDARD and then getting
results of compilation with C++11 as USE_CPP17 has not been set.
- The current build matrix used the above code to run the tests. So, even
though the it should not required anymore to build Catch2, it was still
required to send correct options to build matrix. In that respect,
.travis.yml has been modified to send correct options to the build command
in the new setup.
This keeps it out of the main include path when benchmarking is
enabled, somewhat reducing the compilation-time penalty.
Also moved some other functions into the .cpp file, especially
helpers that could be given internal linkage, and concretized some
iterator-templated code that only ever used
`std::vector<double>::iterator`.
* Units from <ratio> are no longer redeclared in our own namespace
* The default clock is `steady_clock`, not `high_resolution_clock`,
because, as HH says "high_resolution_clock is useless. If you want
measure the passing of time, use steady_clock. If you want user
friendly time, use system_clock".
* Benchmarking support is opt-in, not opt-out, to avoid the large
(~10%) compile time penalty.
* Benchmarking-related options in CLI are always present, to decrease
the amount of code that is only compiled conditionally and making
the whole shebang more maintainble.
Changes done to Nonius:
* Moved things into "Catch::Benchmark" namespace
* Benchmarks were integrated with `TEST_CASE`/`SECTION`/`GENERATE` macros
* Removed Nonius's parameters for benchmarks, Generators should be used instead
* Added relevant methods to the reporter interface (default-implemented, to avoid
breaking existing 3rd party reporters)
* Async processing is guarded with `_REENTRANT` macro for GCC/Clang, used by default
on MSVC
* Added a macro `CATCH_CONFIG_DISABLE_BENCHMARKING` that removes all traces of
benchmarking from Catch
This fixes an issue where a self-assignment of a StringRef copy would point into internally (and now dangling) data.
(now self-assignment check is no longer needed)
Eventually this needs to be fixed in the textflow project by Phil,
but he has not done so in the half a year this bug has been known
to be there, so...
Closes#1470Closes#1455
* Deduce map return type implicitly
Giving the first template argument to map generator function to deduce
return type is now optional even if the return type is different from
the type generated by mapped generator.
This avoids the problem where writes to stderr/stdout stop being
line-buffered when stderr/stdout is redirected to a file, which led
to different order of outputs between Linux and Windows in our tests.