mirror of
https://github.com/catchorg/Catch2.git
synced 2025-01-16 15:18:00 +00:00
Compare commits
5 Commits
a71721801e
...
5c502320e8
Author | SHA1 | Date | |
---|---|---|---|
|
5c502320e8 | ||
|
f3fe2dcb11 | ||
|
8b5f6e26d3 | ||
|
c24f7e5b34 | ||
|
7dae3efad2 |
@ -48,10 +48,10 @@ namespace Catch {
|
||||
|
||||
Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) {
|
||||
auto trimmed = [&] (size_t start, size_t end) {
|
||||
while (names[start] == ',' || isspace(names[start])) {
|
||||
while (names[start] == ',' || isspace(static_cast<unsigned char>(names[start]))) {
|
||||
++start;
|
||||
}
|
||||
while (names[end] == ',' || isspace(names[end])) {
|
||||
while (names[end] == ',' || isspace(static_cast<unsigned char>(names[end]))) {
|
||||
--end;
|
||||
}
|
||||
return names.substr(start, end - start + 1);
|
||||
|
@ -446,20 +446,27 @@ namespace Catch {
|
||||
#endif // CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
|
||||
|
||||
namespace Catch {
|
||||
struct not_this_one {}; // Tag type for detecting which begin/ end are being selected
|
||||
|
||||
// Import begin/ end from std here so they are considered alongside the fallback (...) overloads in this namespace
|
||||
// Import begin/ end from std here
|
||||
using std::begin;
|
||||
using std::end;
|
||||
|
||||
not_this_one begin( ... );
|
||||
not_this_one end( ... );
|
||||
namespace detail {
|
||||
template <typename...>
|
||||
struct void_type {
|
||||
using type = void;
|
||||
};
|
||||
|
||||
template <typename T, typename = void>
|
||||
struct is_range_impl : std::false_type {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_range_impl<T, typename void_type<decltype(begin(std::declval<T>()))>::type> : std::true_type {
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
template <typename T>
|
||||
struct is_range {
|
||||
static const bool value =
|
||||
!std::is_same<decltype(begin(std::declval<T>())), not_this_one>::value &&
|
||||
!std::is_same<decltype(end(std::declval<T>())), not_this_one>::value;
|
||||
struct is_range : detail::is_range_impl<T> {
|
||||
};
|
||||
|
||||
#if defined(_MANAGED) // Managed types are never ranges
|
||||
|
@ -74,7 +74,7 @@
|
||||
//
|
||||
// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
|
||||
# if !defined(__ibmxl__)
|
||||
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg) */
|
||||
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
|
||||
# endif
|
||||
|
||||
|
||||
|
@ -140,8 +140,6 @@ namespace Matchers {
|
||||
m_target(target)
|
||||
{}
|
||||
bool match(std::vector<T, AllocMatch> const& vec) const override {
|
||||
// Note: This is a reimplementation of std::is_permutation,
|
||||
// because I don't want to include <algorithm> inside the common path
|
||||
if (m_target.size() != vec.size()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -198,6 +198,11 @@ namespace Catch {
|
||||
xml.writeAttribute( "name", name );
|
||||
}
|
||||
xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) );
|
||||
// This is not ideal, but it should be enough to mimic gtest's
|
||||
// junit output.
|
||||
// Ideally the JUnit reporter would also handle `skipTest`
|
||||
// events and write those out appropriately.
|
||||
xml.writeAttribute( "status", "run" );
|
||||
|
||||
writeAssertions( sectionNode );
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user