提交 71446614 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Update deps

上级 d172bdc5
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"testRegex": "test/test.*\\.js" "testRegex": "test/test.*\\.js"
}, },
"dependencies": { "dependencies": {
"@types/node": "^14.6.2", "@types/node": "^14.6.4",
"awaitqueue": "^2.2.3", "awaitqueue": "^2.2.3",
"debug": "^4.1.1", "debug": "^4.1.1",
"h264-profile-level-id": "^1.0.1", "h264-profile-level-id": "^1.0.1",
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
"@typescript-eslint/eslint-plugin": "^3.10.1", "@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1", "@typescript-eslint/parser": "^3.10.1",
"cross-env": "^7.0.2", "cross-env": "^7.0.2",
"eslint": "^7.7.0", "eslint": "^7.8.1",
"eslint-plugin-jest": "^23.20.0", "eslint-plugin-jest": "^23.20.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-clang-format": "^1.0.27", "gulp-clang-format": "^1.0.27",
......
...@@ -14,14 +14,12 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) ...@@ -14,14 +14,12 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif() endif()
project(Catch2 LANGUAGES CXX VERSION 2.13.0) project(Catch2 LANGUAGES CXX VERSION 2.13.1)
# Provide path for scripts # Provide path for scripts
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
include(GNUInstallDirs) include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(CTest)
option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF) option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF)
option(CATCH_BUILD_TESTING "Build SelfTest project" ON) option(CATCH_BUILD_TESTING "Build SelfTest project" ON)
...@@ -33,8 +31,6 @@ option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON) ...@@ -33,8 +31,6 @@ option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
option(CATCH_INSTALL_HELPERS "Install contrib alongside library" ON) option(CATCH_INSTALL_HELPERS "Install contrib alongside library" ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# define some folders # define some folders
set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest) set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
...@@ -45,12 +41,16 @@ if(USE_WMAIN) ...@@ -45,12 +41,16 @@ if(USE_WMAIN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
endif() endif()
if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT) if(NOT_SUBPROJECT)
include(CTest)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(BUILD_TESTING AND CATCH_BUILD_TESTING)
find_package(PythonInterp) find_package(PythonInterp)
if (NOT PYTHONINTERP_FOUND) if (NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "Python not found, but required for tests") message(FATAL_ERROR "Python not found, but required for tests")
endif() endif()
add_subdirectory(projects) add_subdirectory(projects)
endif()
endif() endif()
if(CATCH_BUILD_EXAMPLES) if(CATCH_BUILD_EXAMPLES)
...@@ -107,6 +107,7 @@ add_library(Catch2::Catch2 ALIAS Catch2) ...@@ -107,6 +107,7 @@ add_library(Catch2::Catch2 ALIAS Catch2)
# a subproject via `add_subdirectory`, or the destinations will break, # a subproject via `add_subdirectory`, or the destinations will break,
# see https://github.com/catchorg/Catch2/issues/1373 # see https://github.com/catchorg/Catch2/issues/1373
if (NOT_SUBPROJECT) if (NOT_SUBPROJECT)
include(CMakePackageConfigHelpers)
set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2") set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
configure_package_config_file( configure_package_config_file(
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
[![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](https://travis-ci.org/catchorg/Catch2) [![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](https://travis-ci.org/catchorg/Catch2)
[![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true)](https://ci.appveyor.com/project/catchorg/catch2) [![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true)](https://ci.appveyor.com/project/catchorg/catch2)
[![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2) [![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2)
[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/aavJBzemrxUgGV9S) [![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/6JUH8Eybx4CtvkJS)
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD) [![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.0/catch.hpp">The latest version of the single header can be downloaded directly using this link</a> <a href="https://github.com/catchorg/Catch2/releases/download/v2.13.1/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
## Catch2 is released! ## Catch2 is released!
......
...@@ -189,24 +189,29 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) ...@@ -189,24 +189,29 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
# Escape commas in the test spec # Escape commas in the test spec
string(REPLACE "," "\\," Name ${Name}) string(REPLACE "," "\\," Name ${Name})
# Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were neccessary,
# only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1
if(NOT ${CMAKE_VERSION} VERSION_EQUAL "3.18")
set(CTestName "\"${CTestName}\"")
endif()
# Add the test and set its properties # Add the test and set its properties
add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters}) add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
# Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8") if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property") ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON) set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
else() else()
set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
LABELS "${Labels}") LABELS "${Labels}")
endif() endif()
set_property( set_property(
TARGET ${TestTarget} TARGET ${TestTarget}
APPEND APPEND
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
set_property( set_property(
SOURCE ${SourceFile} SOURCE ${SourceFile}
APPEND APPEND
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
endif() endif()
......
...@@ -60,7 +60,7 @@ The specific order of the `SECTION`s will be "one", "one", "two", "two", ...@@ -60,7 +60,7 @@ The specific order of the `SECTION`s will be "one", "one", "two", "two",
"two", "one"... "two", "one"...
The fact that `GENERATE` introduces a virtual `SECTION` can als obe used The fact that `GENERATE` introduces a virtual `SECTION` can also be used
to make a generator replay only some `SECTION`s, without having to to make a generator replay only some `SECTION`s, without having to
explicitly add a `SECTION`. As an example, the code below reports 3 explicitly add a `SECTION`. As an example, the code below reports 3
assertions, because the "first" section is run once, but the "second" assertions, because the "first" section is run once, but the "second"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Release notes # Release notes
**Contents**<br> **Contents**<br>
[2.13.1](#2131)<br>
[2.13.0](#2130)<br> [2.13.0](#2130)<br>
[2.12.4](#2124)<br> [2.12.4](#2124)<br>
[2.12.3](#2123)<br> [2.12.3](#2123)<br>
...@@ -40,6 +41,19 @@ ...@@ -40,6 +41,19 @@
[Older versions](#older-versions)<br> [Older versions](#older-versions)<br>
[Even Older versions](#even-older-versions)<br> [Even Older versions](#even-older-versions)<br>
## 2.13.1
### Improvements
* `ParseAndAddCatchTests` handles CMake v3.18.0 correctly (#1984)
* Improved autodetection of `std::byte` (#1992)
* Simplified implementation of templated test cases (#2007)
* This should have a tiny positive effect on its compilation throughput
### Fixes
* Automatic stringification of ranges handles sentinel ranges properly (#2004)
## 2.13.0 ## 2.13.0
### Improvements ### Improvements
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 13 #define CATCH_VERSION_MINOR 13
#define CATCH_VERSION_PATCH 0 #define CATCH_VERSION_PATCH 1
#ifdef __clang__ #ifdef __clang__
# pragma clang system_header # pragma clang system_header
......
...@@ -240,7 +240,10 @@ ...@@ -240,7 +240,10 @@
// Check if byte is available and usable // Check if byte is available and usable
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
# include <cstddef>
# if __cpp_lib_byte > 0
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
# endif
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
// Check if variant is available and usable // Check if variant is available and usable
......
...@@ -160,7 +160,7 @@ struct AutoReg : NonCopyable { ...@@ -160,7 +160,7 @@ struct AutoReg : NonCopyable {
int index = 0; \ int index = 0; \
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
using expander = int[];\ using expander = int[];\
(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
...@@ -206,7 +206,7 @@ struct AutoReg : NonCopyable { ...@@ -206,7 +206,7 @@ struct AutoReg : NonCopyable {
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */\ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */\
} \ } \
}; \ }; \
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
...@@ -250,7 +250,7 @@ struct AutoReg : NonCopyable { ...@@ -250,7 +250,7 @@ struct AutoReg : NonCopyable {
void reg_tests() { \ void reg_tests() { \
int index = 0; \ int index = 0; \
using expander = int[]; \ using expander = int[]; \
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */\ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\
} \ } \
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
...@@ -285,7 +285,7 @@ struct AutoReg : NonCopyable { ...@@ -285,7 +285,7 @@ struct AutoReg : NonCopyable {
int index = 0; \ int index = 0; \
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
using expander = int[];\ using expander = int[];\
(void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
...@@ -334,7 +334,7 @@ struct AutoReg : NonCopyable { ...@@ -334,7 +334,7 @@ struct AutoReg : NonCopyable {
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
...@@ -381,7 +381,7 @@ struct AutoReg : NonCopyable { ...@@ -381,7 +381,7 @@ struct AutoReg : NonCopyable {
void reg_tests(){\ void reg_tests(){\
int index = 0;\ int index = 0;\
using expander = int[];\ using expander = int[];\
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
......
...@@ -309,8 +309,8 @@ namespace Catch { ...@@ -309,8 +309,8 @@ namespace Catch {
#endif #endif
namespace Detail { namespace Detail {
template<typename InputIterator> template<typename InputIterator, typename Sentinel = InputIterator>
std::string rangeToString(InputIterator first, InputIterator last) { std::string rangeToString(InputIterator first, Sentinel last) {
ReusableStringStream rss; ReusableStringStream rss;
rss << "{ "; rss << "{ ";
if (first != last) { if (first != last) {
......
...@@ -37,7 +37,7 @@ namespace Catch { ...@@ -37,7 +37,7 @@ namespace Catch {
} }
Version const& libraryVersion() { Version const& libraryVersion() {
static Version version( 2, 13, 0, "", 0 ); static Version version( 2, 13, 1, "", 0 );
return version; return version;
} }
......
...@@ -1203,6 +1203,7 @@ CmdLine.tests.cpp:<line number>: passed: config.benchmarkWarmupTime == 10 for: 1 ...@@ -1203,6 +1203,7 @@ CmdLine.tests.cpp:<line number>: passed: config.benchmarkWarmupTime == 10 for: 1
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1 Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1 Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1 Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1
ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy! Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively
......
...@@ -1380,6 +1380,6 @@ due to unexpected exception with message: ...@@ -1380,6 +1380,6 @@ due to unexpected exception with message:
Why would you throw a std::string? Why would you throw a std::string?
=============================================================================== ===============================================================================
test cases: 321 | 247 passed | 70 failed | 4 failed as expected test cases: 322 | 248 passed | 70 failed | 4 failed as expected
assertions: 1758 | 1606 passed | 131 failed | 21 failed as expected assertions: 1759 | 1607 passed | 131 failed | 21 failed as expected
...@@ -8895,6 +8895,17 @@ Misc.tests.cpp:<line number>: PASSED: ...@@ -8895,6 +8895,17 @@ Misc.tests.cpp:<line number>: PASSED:
with expansion: with expansion:
1 >= 1 1 >= 1
-------------------------------------------------------------------------------
Range type with sentinel
-------------------------------------------------------------------------------
ToString.tests.cpp:<line number>
...............................................................................
ToString.tests.cpp:<line number>: PASSED:
CHECK( Catch::Detail::stringify(UsesSentinel{}) == "{ }" )
with expansion:
"{ }" == "{ }"
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Reconstruction should be based on stringification: #914 Reconstruction should be based on stringification: #914
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
...@@ -14127,6 +14138,6 @@ Misc.tests.cpp:<line number> ...@@ -14127,6 +14138,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED: Misc.tests.cpp:<line number>: PASSED:
=============================================================================== ===============================================================================
test cases: 321 | 231 passed | 86 failed | 4 failed as expected test cases: 322 | 232 passed | 86 failed | 4 failed as expected
assertions: 1775 | 1606 passed | 148 failed | 21 failed as expected assertions: 1776 | 1607 passed | 148 failed | 21 failed as expected
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact <testsuitesloose text artifact
> >
<testsuite name="<exe-name>" errors="17" failures="132" tests="1776" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <testsuite name="<exe-name>" errors="17" failures="132" tests="1777" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties> <properties>
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
<property name="random-seed" value="1"/> <property name="random-seed" value="1"/>
...@@ -1045,6 +1045,7 @@ Message.tests.cpp:<line number> ...@@ -1045,6 +1045,7 @@ Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int, double, float>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int, double, float>" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int, double>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int, double>" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run"> <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
<failure message="truthy(false)" type="CHECK"> <failure message="truthy(false)" type="CHECK">
FAILED: FAILED:
......
...@@ -162,6 +162,7 @@ ...@@ -162,6 +162,7 @@
</file> </file>
<file path="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp"> <file path="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp">
<testCase name="Directly creating an EnumInfo" duration="{duration}"/> <testCase name="Directly creating an EnumInfo" duration="{duration}"/>
<testCase name="Range type with sentinel" duration="{duration}"/>
<testCase name="parseEnums/No enums" duration="{duration}"/> <testCase name="parseEnums/No enums" duration="{duration}"/>
<testCase name="parseEnums/One enum value" duration="{duration}"/> <testCase name="parseEnums/One enum value" duration="{duration}"/>
<testCase name="parseEnums/Multiple enum values" duration="{duration}"/> <testCase name="parseEnums/Multiple enum values" duration="{duration}"/>
......
...@@ -10962,6 +10962,17 @@ Nor would this ...@@ -10962,6 +10962,17 @@ Nor would this
</Expression> </Expression>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<TestCase name="Range type with sentinel" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
<Expression success="true" type="CHECK" filename="projects/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
<Original>
Catch::Detail::stringify(UsesSentinel{}) == "{ }"
</Original>
<Expanded>
"{ }" == "{ }"
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Reconstruction should be based on stringification: #914" tags="[!hide][.][Decomposition][failing]" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" > <TestCase name="Reconstruction should be based on stringification: #914" tags="[!hide][.][Decomposition][failing]" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
<Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" > <Expression success="false" type="CHECK" filename="projects/<exe-name>/UsageTests/Decomposition.tests.cpp" >
<Original> <Original>
...@@ -16711,9 +16722,9 @@ loose text artifact ...@@ -16711,9 +16722,9 @@ loose text artifact
</Section> </Section>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<OverallResults successes="1606" failures="149" expectedFailures="21"/> <OverallResults successes="1607" failures="149" expectedFailures="21"/>
<OverallResultsCases successes="231" failures="86" expectedFailures="4"/> <OverallResultsCases successes="232" failures="86" expectedFailures="4"/>
</Group> </Group>
<OverallResults successes="1606" failures="148" expectedFailures="21"/> <OverallResults successes="1607" failures="148" expectedFailures="21"/>
<OverallResultsCases successes="231" failures="86" expectedFailures="4"/> <OverallResultsCases successes="232" failures="86" expectedFailures="4"/>
</Catch> </Catch>
...@@ -4,6 +4,13 @@ ...@@ -4,6 +4,13 @@
enum class EnumClass3 { Value1, Value2, Value3, Value4 }; enum class EnumClass3 { Value1, Value2, Value3, Value4 };
struct UsesSentinel {
using const_iterator = int const*;
using const_sentinel = std::nullptr_t;
const_iterator begin() const { return nullptr; }
const_iterator end() const { return nullptr; }
};
TEST_CASE( "parseEnums", "[Strings][enums]" ) { TEST_CASE( "parseEnums", "[Strings][enums]" ) {
using namespace Catch::Matchers; using namespace Catch::Matchers;
...@@ -40,3 +47,7 @@ TEST_CASE( "Directly creating an EnumInfo" ) { ...@@ -40,3 +47,7 @@ TEST_CASE( "Directly creating an EnumInfo" ) {
CHECK( enumInfo->lookup(1) == "Value2" ); CHECK( enumInfo->lookup(1) == "Value2" );
CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" ); CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" );
} }
TEST_CASE("Range type with sentinel") {
CHECK( Catch::Detail::stringify(UsesSentinel{}) == "{ }" );
}
\ No newline at end of file
/* /*
* Catch v2.13.0 * Catch v2.13.1
* Generated: 2020-07-12 20:07:49.015950 * Generated: 2020-09-07 12:12:38.090364
* ---------------------------------------------------------- * ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly * This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved. * Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 13 #define CATCH_VERSION_MINOR 13
#define CATCH_VERSION_PATCH 0 #define CATCH_VERSION_PATCH 1
#ifdef __clang__ #ifdef __clang__
# pragma clang system_header # pragma clang system_header
...@@ -330,7 +330,10 @@ namespace Catch { ...@@ -330,7 +330,10 @@ namespace Catch {
// Check if byte is available and usable // Check if byte is available and usable
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
# include <cstddef>
# if __cpp_lib_byte > 0
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
# endif
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
// Check if variant is available and usable // Check if variant is available and usable
...@@ -1105,7 +1108,7 @@ struct AutoReg : NonCopyable { ...@@ -1105,7 +1108,7 @@ struct AutoReg : NonCopyable {
int index = 0; \ int index = 0; \
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
using expander = int[];\ using expander = int[];\
(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
...@@ -1151,7 +1154,7 @@ struct AutoReg : NonCopyable { ...@@ -1151,7 +1154,7 @@ struct AutoReg : NonCopyable {
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */\ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */\
} \ } \
}; \ }; \
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
...@@ -1195,7 +1198,7 @@ struct AutoReg : NonCopyable { ...@@ -1195,7 +1198,7 @@ struct AutoReg : NonCopyable {
void reg_tests() { \ void reg_tests() { \
int index = 0; \ int index = 0; \
using expander = int[]; \ using expander = int[]; \
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */\ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\
} \ } \
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
...@@ -1229,7 +1232,7 @@ struct AutoReg : NonCopyable { ...@@ -1229,7 +1232,7 @@ struct AutoReg : NonCopyable {
int index = 0; \ int index = 0; \
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
using expander = int[];\ using expander = int[];\
(void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
...@@ -1278,7 +1281,7 @@ struct AutoReg : NonCopyable { ...@@ -1278,7 +1281,7 @@ struct AutoReg : NonCopyable {
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
...@@ -1325,7 +1328,7 @@ struct AutoReg : NonCopyable { ...@@ -1325,7 +1328,7 @@ struct AutoReg : NonCopyable {
void reg_tests(){\ void reg_tests(){\
int index = 0;\ int index = 0;\
using expander = int[];\ using expander = int[];\
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++, 0)... };/* NOLINT */ \ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \
}\ }\
};\ };\
static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
...@@ -1829,8 +1832,8 @@ namespace Catch { ...@@ -1829,8 +1832,8 @@ namespace Catch {
#endif #endif
namespace Detail { namespace Detail {
template<typename InputIterator> template<typename InputIterator, typename Sentinel = InputIterator>
std::string rangeToString(InputIterator first, InputIterator last) { std::string rangeToString(InputIterator first, Sentinel last) {
ReusableStringStream rss; ReusableStringStream rss;
rss << "{ "; rss << "{ ";
if (first != last) { if (first != last) {
...@@ -15238,7 +15241,7 @@ namespace Catch { ...@@ -15238,7 +15241,7 @@ namespace Catch {
} }
Version const& libraryVersion() { Version const& libraryVersion() {
static Version version( 2, 13, 0, "", 0 ); static Version version( 2, 13, 1, "", 0 );
return version; return version;
} }
......
...@@ -126,7 +126,7 @@ function get_abseil_cpp() ...@@ -126,7 +126,7 @@ function get_abseil_cpp()
function get_catch() function get_catch()
{ {
GIT_REPO="https://github.com/catchorg/Catch2.git" GIT_REPO="https://github.com/catchorg/Catch2.git"
GIT_TAG="v2.13.0" GIT_TAG="v2.13.1"
DEST="deps/catch" DEST="deps/catch"
get_dep "${GIT_REPO}" "${GIT_TAG}" "${DEST}" get_dep "${GIT_REPO}" "${GIT_TAG}" "${DEST}"
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论