mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-12 00:15:39 +02:00
Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d14b7563c2 | ||
![]() |
a3d3a633b2 | ||
![]() |
8d4796309f | ||
![]() |
552589f25b | ||
![]() |
95c849f613 | ||
![]() |
352853ed7e | ||
![]() |
b11175548a | ||
![]() |
d38f782995 | ||
![]() |
dc8a8e6371 | ||
![]() |
9d1858b195 | ||
![]() |
1d1f8dc992 | ||
![]() |
1466686ade | ||
![]() |
93db01c647 | ||
![]() |
2e285b9579 | ||
![]() |
d2ddb997a7 | ||
![]() |
865d5f59b4 | ||
![]() |
05cd05743a | ||
![]() |
950ccf4749 | ||
![]() |
cf4b7eead9 | ||
![]() |
7b6e49d795 | ||
![]() |
0c5df42c28 | ||
![]() |
4e57661919 | ||
![]() |
5a8f9c84dd | ||
![]() |
f988b4eb35 | ||
![]() |
c8d765a575 | ||
![]() |
da783abee9 | ||
![]() |
c0267e5c20 | ||
![]() |
bb84f0788a | ||
![]() |
e84768fff1 | ||
![]() |
31673ee0ca | ||
![]() |
34d7a33574 | ||
![]() |
082c3b84bc | ||
![]() |
ef2e112561 | ||
![]() |
a90305f857 | ||
![]() |
543c9d3a67 | ||
![]() |
ca8470fbad | ||
![]() |
355b3f9952 |
120
.travis.yml
120
.travis.yml
@@ -1,6 +1,10 @@
|
||||
language: cpp
|
||||
sudo: false
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /dev-appveyor.*/
|
||||
|
||||
common_sources: &all_sources
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty
|
||||
@@ -17,145 +21,140 @@ matrix:
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'clang-3.5']
|
||||
env: COMPILER='clang++-3.5' VALGRIND=1
|
||||
packages: ['clang-3.5']
|
||||
env: COMPILER='clang++-3.5'
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'clang-3.6']
|
||||
env: COMPILER='clang++-3.6' VALGRIND=1
|
||||
packages: ['clang-3.6']
|
||||
env: COMPILER='clang++-3.6'
|
||||
|
||||
# Travis's containers do not seem to have Clang 3.7 in apt, no matter what sources I add.
|
||||
# - os: linux
|
||||
# compiler: clang
|
||||
# addons:
|
||||
# apt:
|
||||
# sources: *all_sources
|
||||
# packages: ['valgrind', 'clang-3.7']
|
||||
# env: COMPILER='clang++-3.7' VALGRIND=1
|
||||
# Clang 3.7 is intentionally skipped as we cannot get it easily on
|
||||
# TravisCI container
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'clang-3.8']
|
||||
env: COMPILER='clang++-3.8' VALGRIND=1
|
||||
packages: ['lcov', 'clang-3.8']
|
||||
env: COMPILER='clang++-3.8'
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['clang-3.9', 'valgrind', 'lcov']
|
||||
env: COMPILER='clang++-3.9' VALGRIND=1
|
||||
packages: ['clang-3.9']
|
||||
env: COMPILER='clang++-3.9'
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['clang-4.0', 'valgrind', 'lcov']
|
||||
env: COMPILER='clang++-4.0' VALGRIND=1
|
||||
packages: ['clang-4.0']
|
||||
env: COMPILER='clang++-4.0'
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['clang-5.0', 'valgrind', 'lcov']
|
||||
env: COMPILER='clang++-5.0' VALGRIND=1
|
||||
packages: ['clang-5.0']
|
||||
env: COMPILER='clang++-5.0'
|
||||
|
||||
# 2/ Linux GCC Builds
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['valgrind', 'lcov', 'g++-4.8']
|
||||
env: COMPILER='g++-4.8' VALGRIND=1
|
||||
sources: *all_sources
|
||||
packages: ['g++-4.8']
|
||||
env: COMPILER='g++-4.8'
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'g++-4.9']
|
||||
env: COMPILER='g++-4.9' VALGRIND=1
|
||||
packages: ['g++-4.9']
|
||||
env: COMPILER='g++-4.9'
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'g++-5']
|
||||
env: COMPILER='g++-5' VALGRIND=1
|
||||
packages: ['g++-5']
|
||||
env: COMPILER='g++-5'
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons: &gcc6
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'g++-6']
|
||||
env: COMPILER='g++-6' VALGRIND=1
|
||||
packages: ['g++-6']
|
||||
env: COMPILER='g++-6'
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons: &gcc7
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'g++-7']
|
||||
env: COMPILER='g++-7' VALGRIND=1
|
||||
packages: ['g++-7']
|
||||
env: COMPILER='g++-7'
|
||||
|
||||
# 3b/ Linux C++14 Clang builds
|
||||
# Note that we need newer libstdc++ for C++14 support
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
packages: ['clang-3.8', 'valgrind', 'lcov', 'libstdc++-6-dev']
|
||||
packages: ['clang-3.8', 'libstdc++-6-dev']
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty
|
||||
env: COMPILER='clang++-3.8' CPP14=1 VALGRIND=1
|
||||
env: COMPILER='clang++-3.8' CPP14=1
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['clang-3.9', 'valgrind', 'lcov', 'libstdc++-6-dev']
|
||||
env: COMPILER='clang++-3.9' CPP14=1 VALGRIND=1
|
||||
packages: ['clang-3.9', 'libstdc++-6-dev']
|
||||
env: COMPILER='clang++-3.9' CPP14=1
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['clang-4.0', 'valgrind', 'lcov', 'libstdc++-6-dev']
|
||||
env: COMPILER='clang++-4.0' CPP14=1 VALGRIND=1
|
||||
packages: ['clang-4.0', 'libstdc++-6-dev']
|
||||
env: COMPILER='clang++-4.0' CPP14=1
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['clang-5.0', 'valgrind', 'lcov', 'libstdc++-6-dev']
|
||||
env: COMPILER='clang++-5.0' CPP14=1 VALGRIND=1
|
||||
packages: ['clang-5.0', 'libstdc++-6-dev']
|
||||
env: COMPILER='clang++-5.0' CPP14=1
|
||||
|
||||
|
||||
# 4a/ Linux C++14 GCC builds
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons: *gcc6
|
||||
env: COMPILER='g++-6' CPP14=1 VALGRIND=1
|
||||
env: COMPILER='g++-6' CPP14=1
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons: *gcc7
|
||||
env: COMPILER='g++-7' CPP14=1 VALGRIND=1
|
||||
env: COMPILER='g++-7' CPP14=1
|
||||
|
||||
# 5/ OSX Clang Builds
|
||||
- os: osx
|
||||
@@ -181,8 +180,39 @@ matrix:
|
||||
- os: osx
|
||||
osx_image: xcode9.1
|
||||
compiler: clang
|
||||
env: COMPILER='clang++' USE_CPP14=1
|
||||
env: COMPILER='clang++' CPP14=1
|
||||
|
||||
# 6/ Special builds -- examples, coverage, valgrind, etc.
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['lcov', 'g++-7']
|
||||
env: COMPILER='g++-7' CPP14=1 EXAMPLES=1 COVERAGE=1
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
addons:
|
||||
apt:
|
||||
packages: ['clang-3.8', 'lcov']
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty
|
||||
env: COMPILER='clang++-3.8' EXAMPLES=1 COVERAGE=1
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: *all_sources
|
||||
packages: ['valgrind', 'lcov', 'g++-7']
|
||||
env: COMPILER='g++-7' CPP14=1 VALGRIND=1
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode9.1
|
||||
compiler: clang
|
||||
env: COMPILER='clang++' CPP14=1 EXAMPLES=1 COVERAGE=1
|
||||
|
||||
install:
|
||||
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
||||
@@ -204,7 +234,7 @@ before_script:
|
||||
|
||||
- |
|
||||
# Use Debug builds for running Valgrind and building examples
|
||||
cmake -H. -BBuild-Debug -DCMAKE_BUILD_TYPE=Debug -Wdev -DUSE_CPP14=${CPP14} -DCATCH_USE_VALGRIND=${VALGRIND} -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_COVERAGE=ON
|
||||
cmake -H. -BBuild-Debug -DCMAKE_BUILD_TYPE=Debug -Wdev -DUSE_CPP14=${CPP14} -DCATCH_USE_VALGRIND=${VALGRIND} -DCATCH_BUILD_EXAMPLES=${EXAMPLES} -DCATCH_ENABLE_COVERAGE=${COVERAGE}
|
||||
# Don't bother with release build for coverage build
|
||||
cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -Wdev -DUSE_CPP14=${CPP14}
|
||||
|
||||
@@ -215,7 +245,9 @@ script:
|
||||
make -j 2
|
||||
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
# Coverage collection does not work for OS X atm
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
echo "${TRAVIS_OS_NAME}";
|
||||
echo "${COVERAGE}";
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ "${COVERAGE}" == "1" ]]; then
|
||||
make gcov
|
||||
make lcov
|
||||
bash <(curl -s https://codecov.io/bash) -X gcov || echo "Codecov did not collect coverage reports"
|
||||
|
@@ -6,7 +6,7 @@ if(NOT DEFINED PROJECT_NAME)
|
||||
set(NOT_SUBPROJECT ON)
|
||||
endif()
|
||||
|
||||
project(Catch2 LANGUAGES CXX VERSION 2.1.2)
|
||||
project(Catch2 LANGUAGES CXX VERSION 2.2.0)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
@@ -357,18 +357,29 @@ if (BUILD_TESTING AND NOT_SUBPROJECT)
|
||||
add_test(NAME RunTests COMMAND $<TARGET_FILE:SelfTest>)
|
||||
|
||||
add_test(NAME ListTests COMMAND $<TARGET_FILE:SelfTest> --list-tests --verbosity high)
|
||||
set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
|
||||
set_tests_properties(ListTests PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "[0-9]+ test cases"
|
||||
FAIL_REGULAR_EXPRESSION "Hidden Test"
|
||||
)
|
||||
|
||||
add_test(NAME ListTags COMMAND $<TARGET_FILE:SelfTest> --list-tags)
|
||||
set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")
|
||||
set_tests_properties(ListTags PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "[0-9]+ tags"
|
||||
FAIL_REGULAR_EXPRESSION "[.]")
|
||||
|
||||
add_test(NAME ListReporters COMMAND $<TARGET_FILE:SelfTest> --list-reporters)
|
||||
set_tests_properties(ListReporters PROPERTIES PASS_REGULAR_EXPRESSION "Available reporters:")
|
||||
|
||||
add_test(NAME ListTestNamesOnly COMMAND $<TARGET_FILE:SelfTest> --list-test-names-only)
|
||||
set_tests_properties(ListTestNamesOnly PROPERTIES PASS_REGULAR_EXPRESSION "Regex string matcher")
|
||||
set_tests_properties(ListTestNamesOnly PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "Regex string matcher"
|
||||
FAIL_REGULAR_EXPRESSION "Hidden Test")
|
||||
|
||||
add_test(NAME NoAssertions COMMAND $<TARGET_FILE:SelfTest> -w NoAssertions)
|
||||
set_tests_properties(NoAssertions PROPERTIES PASS_REGULAR_EXPRESSION "No assertions in test case")
|
||||
|
||||
add_test(NAME NoTest COMMAND $<TARGET_FILE:SelfTest> -w NoTests "___nonexistent_test___")
|
||||
set_tests_properties(NoTest PROPERTIES PASS_REGULAR_EXPRESSION "No test cases matched")
|
||||
|
||||
# AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable
|
||||
add_test(NAME ApprovalTests COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/approvalTests.py $<TARGET_FILE:SelfTest>)
|
||||
@@ -434,9 +445,10 @@ install(EXPORT Catch2Config
|
||||
# install Catch2ConfigVersion.cmake file to handle versions in find_package
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
write_basic_package_version_file(Catch2ConfigVersion.cmake
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_BINARY_DIR}/Catch2ConfigVersion.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
|
||||
DESTINATION ${CATCH_CMAKE_CONFIG_DESTINATION})
|
||||
|
@@ -5,9 +5,9 @@
|
||||
[](https://travis-ci.org/catchorg/Catch2)
|
||||
[](https://ci.appveyor.com/project/catchorg/catch2)
|
||||
[](https://codecov.io/gh/catchorg/Catch2)
|
||||
[](https://wandbox.org/permlink/6O2wo5BOvVeUeKQe)
|
||||
[](https://wandbox.org/permlink/vOtfjd7LKmcj4JqD)
|
||||
|
||||
<a href="https://github.com/catchorg/Catch2/releases/download/v2.1.2/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.2.0/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
|
||||
|
||||
## Catch2 is released!
|
||||
|
||||
|
41
appveyor.yml
41
appveyor.yml
@@ -19,18 +19,51 @@ environment:
|
||||
|
||||
- additional_flags: "/D_UNICODE /DUNICODE"
|
||||
wmain: 1
|
||||
coverage: 0
|
||||
|
||||
# Have a coverage dimension
|
||||
- additional_flags: ""
|
||||
wmain: 0
|
||||
coverage: 1
|
||||
|
||||
# Have an examples dimension
|
||||
- additional_flags: ""
|
||||
wmain: 0
|
||||
examples: 1
|
||||
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- os: Visual Studio 2015
|
||||
additional_flags: "/permissive- /std:c++latest"
|
||||
|
||||
init:
|
||||
- git config --global core.autocrlf input
|
||||
- os: Visual Studio 2015
|
||||
additional_flags: "/D_UNICODE /DUNICODE"
|
||||
|
||||
# Exclude unwanted coverage configurations
|
||||
- coverage: 1
|
||||
platform: Win32
|
||||
|
||||
- coverage: 1
|
||||
os: Visual Studio 2015
|
||||
|
||||
- coverage: 1
|
||||
configuration: Release
|
||||
|
||||
# Exclude unwanted examples configurations
|
||||
- examples: 1
|
||||
platform: Win32
|
||||
|
||||
- examples: 1
|
||||
os: Visual Studio 2015
|
||||
|
||||
- examples: 1
|
||||
configuration: Release
|
||||
|
||||
|
||||
install:
|
||||
- ps: if (($env:CONFIGURATION) -eq "Debug" ) { python -m pip install codecov }
|
||||
- ps: if (($env:CONFIGURATION) -eq "Debug" ) { .\misc\installOpenCppCoverage.ps1 }
|
||||
- ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { python -m pip install codecov }
|
||||
- ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { .\misc\installOpenCppCoverage.ps1 }
|
||||
|
||||
# Win32 and x64 are CMake-compatible solution platform names.
|
||||
# This allows us to pass %PLATFORM% to CMake -A.
|
||||
|
@@ -6,6 +6,10 @@ coverage:
|
||||
project:
|
||||
default:
|
||||
threshold: 2%
|
||||
patch:
|
||||
default:
|
||||
target: 80%
|
||||
|
||||
|
||||
codecov:
|
||||
branch: master
|
||||
|
@@ -4,7 +4,7 @@ from conans import ConanFile
|
||||
|
||||
class CatchConan(ConanFile):
|
||||
name = "Catch"
|
||||
version = "2.1.2"
|
||||
version = "2.2.0"
|
||||
description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD"
|
||||
author = "philsquared"
|
||||
generators = "cmake"
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).
|
||||
|
||||
Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there are a rich set of auxilliary macros as well. We'll describe all of these here.
|
||||
Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there are a rich set of auxiliary macros as well. We'll describe all of these here.
|
||||
|
||||
Most of these macros come in two forms:
|
||||
|
||||
|
@@ -78,7 +78,7 @@ Wildcards consist of the `*` character at the beginning and/or end of test case
|
||||
|
||||
Test specs are case insensitive.
|
||||
|
||||
If a spec is prefixed with `exclude:` or the `~` character then the pattern matches an exclusion. This means that tests matching the pattern are excluded from the set - even if a prior inclusion spec included them. Subsequent inclusion specs will take precendence, however.
|
||||
If a spec is prefixed with `exclude:` or the `~` character then the pattern matches an exclusion. This means that tests matching the pattern are excluded from the set - even if a prior inclusion spec included them. Subsequent inclusion specs will take precedence, however.
|
||||
Inclusions and exclusions are evaluated in left-to-right order.
|
||||
|
||||
Test case examples:
|
||||
@@ -94,7 +94,7 @@ a* ~ab* abc Matches all tests that start with 'a', except those that
|
||||
</pre>
|
||||
|
||||
Names within square brackets are interpreted as tags.
|
||||
A series of tags form an AND expression wheras a comma-separated sequence forms an OR expression. e.g.:
|
||||
A series of tags form an AND expression whereas a comma-separated sequence forms an OR expression. e.g.:
|
||||
|
||||
<pre>[one][two],[three]</pre>
|
||||
This matches all tests tagged `[one]` and `[two]`, as well as all tests tagged `[three]`
|
||||
@@ -192,9 +192,16 @@ This option transforms tabs and newline characters into ```\t``` and ```\n``` re
|
||||
## Warnings
|
||||
<pre>-w, --warn <warning name></pre>
|
||||
|
||||
Enables reporting of warnings (only one, at time of this writing). If a warning is issued it fails the test.
|
||||
Enables reporting of suspicious test states. There are currently two
|
||||
available warnings
|
||||
|
||||
```
|
||||
NoAssertions // Fail test case / leaf section if no assertions
|
||||
// (e.g. `REQUIRE`) is encountered.
|
||||
NoTests // Return non-zero exit code when no test cases were run
|
||||
// Also calls reporter's noMatchingTestCases method
|
||||
```
|
||||
|
||||
The ony available warning, presently, is ```NoAssertions```. This warning fails a test case, or (leaf) section if no assertions (```REQUIRE```/ ```CHECK``` etc) are encountered.
|
||||
|
||||
<a id="reporting-timings"></a>
|
||||
## Reporting timings
|
||||
@@ -262,7 +269,7 @@ either before running any tests, after running all tests - or both, depending on
|
||||
|
||||
When running benchmarks the clock resolution is estimated. Benchmarks are then run for exponentially increasing
|
||||
numbers of iterations until some multiple of the estimated resolution is exceed. By default that multiple is 100, but
|
||||
it can be overriden here.
|
||||
it can be overridden here.
|
||||
|
||||
<a id="usage"></a>
|
||||
## Usage
|
||||
|
@@ -7,6 +7,8 @@
|
||||
[Terminal colour](#terminal-colour)<br>
|
||||
[Console width](#console-width)<br>
|
||||
[stdout](#stdout)<br>
|
||||
[Fallback stringifier](#fallback-stringifier)<br>
|
||||
[Default reporter](#default-reporter)<br>
|
||||
[Other toggles](#other-toggles)<br>
|
||||
[Windows header clutter](#windows-header-clutter)<br>
|
||||
[Enabling stringification](#enabling-stringification)<br>
|
||||
@@ -24,7 +26,7 @@ Although Catch is header only it still, internally, maintains a distinction betw
|
||||
|
||||
# Reporter / Listener interfaces
|
||||
|
||||
CATCH_CONFIG_EXTERNAL_INTERFACES // Brings in neccessary headers for Reporter/Listener implementation
|
||||
CATCH_CONFIG_EXTERNAL_INTERFACES // Brings in necessary headers for Reporter/Listener implementation
|
||||
|
||||
Brings in various parts of Catch that are required for user defined Reporters and Listeners. This means that new Reporters and Listeners can be defined in this file as well as in the main file.
|
||||
|
||||
@@ -73,6 +75,40 @@ Catch does not use ```std::cout```, ```std::cerr``` and ```std::clog``` directly
|
||||
This can be useful on certain platforms that do not provide the standard iostreams, such as certain embedded systems.
|
||||
|
||||
|
||||
## Fallback stringifier
|
||||
|
||||
By default Catch's stringification machinery falls back to a "{?}". To
|
||||
let projects reuse their own existing stringification machinery, this
|
||||
fallback can be overridden by defining `CATCH_CONFIG_FALLBACK_STRINGIFIER`
|
||||
to a name of a function that should perform the stringification instead.
|
||||
|
||||
The provided function must return std::string and must accept any type
|
||||
(e.g. via overloading).
|
||||
|
||||
_Note that if the provided function does not handle a type and this type
|
||||
requires to be stringified, the compilation will fail._
|
||||
|
||||
|
||||
## Default reporter
|
||||
|
||||
Catch's default reporter can be changed by defining macro
|
||||
`CATCH_CONFIG_DEFAULT_REPORTER` to string literal naming the desired
|
||||
default reporter.
|
||||
|
||||
This means that defining `CATCH_CONFIG_DEFAULT_REPORTER` to `"console"`
|
||||
is equivalent with the out-of-the-box experience.
|
||||
|
||||
|
||||
## C++17 toggles
|
||||
|
||||
CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS // Use std::uncaught_exceptions instead of std::uncaught_exception
|
||||
|
||||
Catch contains basic compiler/standard detection and attempts to use
|
||||
some C++17 features whenever appropriate. This automatic detection
|
||||
can be manually overridden in both directions, that is, a feature
|
||||
can be enabled by defining the macro in the table above, and disabled
|
||||
by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`.
|
||||
|
||||
|
||||
## Other toggles
|
||||
|
||||
@@ -84,6 +120,7 @@ This can be useful on certain platforms that do not provide the standard iostrea
|
||||
CATCH_CONFIG_WINDOWS_CRTDBG // Enable leak checking using Windows's CRT Debug Heap
|
||||
CATCH_CONFIG_DISABLE_STRINGIFICATION // Disable stringifying the original expression
|
||||
CATCH_CONFIG_DISABLE // Disables assertions and test case registration
|
||||
CATCH_CONFIG_WCHAR // Enables use of wchart_t
|
||||
|
||||
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.
|
||||
|
||||
@@ -91,12 +128,15 @@ Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC,
|
||||
|
||||
`CATCH_CONFIG_WINDOWS_CRTDBG` is off by default. If enabled, Windows's CRT is used to check for memory leaks, and displays them after the tests finish running.
|
||||
|
||||
`CATCH_CONFIG_WCHAR` is on by default, but can be disabled. Currently
|
||||
it is only used in support for DJGPP cross-compiler.
|
||||
|
||||
These toggles can be disabled by using `_NO_` form of the toggle, e.g. `CATCH_CONFIG_NO_WINDOWS_SEH`.
|
||||
|
||||
### `CATCH_CONFIG_FAST_COMPILE`
|
||||
Defining this flag speeds up compilation of test files by ~20%, by making 2 changes:
|
||||
* The `-b` (`--break`) flag no longer makes Catch break into debugger in the same stack frame as the failed test, but rather in a stack frame *below*.
|
||||
* Non-exception family of macros ({`REQUIRE`,`CHECK`}{`_`,`_FALSE`, `_FALSE`}, no longer use local try-cache block. This disables exception translation, but should not lead to false negatives.
|
||||
* Non-exception family of macros ({`REQUIRE`,`CHECK`}{`_`,`_FALSE`, `_THAT`}, no longer use local try-catch block. This disables exception translation, but should not lead to false negatives.
|
||||
|
||||
`CATCH_CONFIG_FAST_COMPILE` has to be either defined, or not defined, in all translation units that are linked into single test binary, or the behaviour of setting `-b` flag and throwing unexpected exceptions will be unpredictable.
|
||||
|
||||
|
@@ -44,7 +44,7 @@ _Note that you should not use any assertion macros within a Listener!_
|
||||
|
||||
## Events that can be hooked
|
||||
|
||||
The following are the methods that can be overriden in the Listener:
|
||||
The following are the methods that can be overridden in the Listener:
|
||||
|
||||
```c++
|
||||
// The whole test run, starting and ending
|
||||
|
@@ -96,6 +96,14 @@ with expansion:
|
||||
""\" == ""\"
|
||||
```
|
||||
|
||||
### Visual Studio 2015 -- Alignment compilation error (C2718)
|
||||
|
||||
VS 2015 has a known bug, where `declval<T>` can cause compilation error
|
||||
if `T` has alignment requirements that it cannot meet.
|
||||
|
||||
|
||||
A workaround is to explicitly specialize `Catch::is_range` for given
|
||||
type (this avoids code path that uses `declval<T>` in a SFINAE context).
|
||||
|
||||
|
||||
### Visual Studio 2015 -- Wrong line number reported in debug mode
|
||||
|
@@ -1,18 +1,18 @@
|
||||
<a id="top"></a>
|
||||
# Open Source projects using Catch
|
||||
|
||||
Catch is great for open source. With its [liberal license](../LICENSE.txt) and single-header, dependency-free, distribution
|
||||
Catch is great for open source. With its [liberal license](../LICENSE.txt) and single-header, dependency-free, distribution
|
||||
it's easy to just drop the header into your project and start writing tests - what's not to like?
|
||||
|
||||
As a result Catch is now being used in many Open Source projects, including some quite well known ones.
|
||||
This page is an attempt to track those projects. Obviously it can never be complete.
|
||||
This effort largely relies on the maintainers of the projects themselves updating this page and submitting a PR
|
||||
(or, if you prefer contact one of the maintainers of Catch directly, use the
|
||||
(or, if you prefer contact one of the maintainers of Catch directly, use the
|
||||
[forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum)), or raise an [issue](https://github.com/philsquared/Catch/issues) to let us know).
|
||||
Of course users of those projects might want to update this page too. That's fine - as long you're confident the project maintainers won't mind.
|
||||
If you're an Open Source project maintainer and see your project listed here but would rather it wasn't -
|
||||
If you're an Open Source project maintainer and see your project listed here but would rather it wasn't -
|
||||
just let us know via any of the previously mentioned means - although I'm sure there won't be many who feel that way.
|
||||
|
||||
|
||||
Listing a project here does not imply endorsement and the plan is to keep these ordered alphabetically to avoid an implication of relative importance.
|
||||
|
||||
## Libraries & Frameworks
|
||||
@@ -21,7 +21,7 @@ Listing a project here does not imply endorsement and the plan is to keep these
|
||||
Boost Asio style bindings for ZeroMQ
|
||||
|
||||
### [ChakraCore](https://github.com/Microsoft/ChakraCore)
|
||||
The core part of the Chakra Javascript engine that powers Microsoft Edge
|
||||
The core part of the Chakra JavaScript engine that powers Microsoft Edge
|
||||
|
||||
### [ChaiScript](https://github.com/ChaiScript/ChaiScript)
|
||||
A, header-only, embedded scripting language designed from the ground up to directly target C++ and take advantage of modern C++ development techniques
|
||||
@@ -91,6 +91,9 @@ MAME originally stood for Multiple Arcade Machine Emulator
|
||||
### [Newsbeuter](https://github.com/akrennmair/newsbeuter)
|
||||
Newsbeuter is an open-source RSS/Atom feed reader for text terminals.
|
||||
|
||||
### [SpECTRE](https://github.com/sxs-collaboration/spectre)
|
||||
SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.
|
||||
|
||||
### [Standardese](https://github.com/foonathan/standardese)
|
||||
Standardese aims to be a nextgen Doxygen
|
||||
|
||||
|
@@ -30,7 +30,7 @@ int main( int argc, char* argv[] ) {
|
||||
|
||||
## Amending the config
|
||||
|
||||
If you still want Catch to process the command line, but you want to programatically tweak the config, you can do so in one of two ways:
|
||||
If you still want Catch to process the command line, but you want to programmatically tweak the config, you can do so in one of two ways:
|
||||
|
||||
```c++
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
|
@@ -1,5 +1,25 @@
|
||||
<a id="top"></a>
|
||||
|
||||
# 2.2.0
|
||||
|
||||
## Fixes
|
||||
* Hidden tests are not listed by default when listing tests (#1175)
|
||||
* This makes `catch_discover_tests` CMake script work better
|
||||
* Fixed regression that meant `<windows.h>` could potentially not be included properly (#1197)
|
||||
* Fixed installing `Catch2ConfigVersion.cmake` when Catch2 is a subproject.
|
||||
|
||||
## Improvements
|
||||
* Added an option to warn (+ exit with error) when no tests were ran (#1158)
|
||||
* Use as `-w NoTests`
|
||||
* Added provisional support for Emscripten (#1114)
|
||||
* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/master/docs/configuration.md#fallback-stringifier) (#1024)
|
||||
* This allows project's own stringification machinery to be easily reused for Catch
|
||||
* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178)
|
||||
* The embedded version of Clara was bumped to v1.1.3
|
||||
* Various minor performance improvements
|
||||
* Added support for DJGPP DOS crosscompiler (#1206)
|
||||
|
||||
|
||||
# 2.1.2
|
||||
|
||||
## Fixes
|
||||
@@ -379,8 +399,8 @@ Cygwin issue with `gettimeofday` - `#define` was not early enough
|
||||
* Cygwin compatibility fixes
|
||||
* Signal handling is no longer compiled by default.
|
||||
* Usage of `gettimeofday` inside Catch should no longer cause compilation errors.
|
||||
* Improved `-Wparentheses` supression for gcc (#674)
|
||||
* When compiled with gcc 4.8 or newer, the supression is localized to assertions only
|
||||
* Improved `-Wparentheses` suppression for gcc (#674)
|
||||
* When compiled with gcc 4.8 or newer, the suppression is localized to assertions only
|
||||
* Otherwise it is supressed for the whole TU
|
||||
* Fixed test spec parser issue (with escapes in multiple names)
|
||||
|
||||
@@ -399,7 +419,7 @@ Xml:
|
||||
* C-escape control characters instead of XML encoding them (which requires XML 1.1)
|
||||
* Revert XML output to XML 1.0
|
||||
* Can provide stylesheet references by extending the XML reporter
|
||||
* Added description and tags attribites to XML Reporter
|
||||
* Added description and tags attributes to XML Reporter
|
||||
* Tags are closed and the stream flushed more eagerly to avoid stdout interpolation
|
||||
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<a id="top"></a>
|
||||
# How to release
|
||||
|
||||
When enough changes have accumulated, it is time to release new version of Catch. This document describes the proces in doing so, that no steps are forgotten. Note that all referenced scripts can be found in the `scripts/` directory.
|
||||
When enough changes have accumulated, it is time to release new version of Catch. This document describes the process in doing so, that no steps are forgotten. Note that all referenced scripts can be found in the `scripts/` directory.
|
||||
|
||||
## Neccessary steps
|
||||
## Necessary steps
|
||||
|
||||
These steps are neccessary and have to be performed before each new release. They serve to make sure that the new release is correct and linked-to from the standard places.
|
||||
These steps are necessary and have to be performed before each new release. They serve to make sure that the new release is correct and linked-to from the standard places.
|
||||
|
||||
|
||||
### Approval testing
|
||||
@@ -54,7 +54,7 @@ The following steps are optional, and do not have to be performed when releasing
|
||||
|
||||
### vcpkg update
|
||||
|
||||
Catch is maintaining its own port in Microsoft's package manager [vcpkg](https://github.com/Microsoft/vcpkg). This means that when new version of Catch is released, it should be posted there as well. `updateVcpkgPackage.py` can do a lot of neccessary work for you, it creates a branch and commits neccessary changes. You should review these changes, push and open a PR against vcpkg's upstream.
|
||||
Catch is maintaining its own port in Microsoft's package manager [vcpkg](https://github.com/Microsoft/vcpkg). This means that when new version of Catch is released, it should be posted there as well. `updateVcpkgPackage.py` can do a lot of necessary work for you, it creates a branch and commits necessary changes. You should review these changes, push and open a PR against vcpkg's upstream.
|
||||
|
||||
Note that the script assumes you have your fork of vcpkg checked out in a directory next to the directory where you have checked out Catch, like so:
|
||||
```
|
||||
|
@@ -10,8 +10,8 @@
|
||||
#define TWOBLUECUBES_CATCH_HPP_INCLUDED
|
||||
|
||||
#define CATCH_VERSION_MAJOR 2
|
||||
#define CATCH_VERSION_MINOR 1
|
||||
#define CATCH_VERSION_PATCH 2
|
||||
#define CATCH_VERSION_MINOR 2
|
||||
#define CATCH_VERSION_PATCH 0
|
||||
|
||||
#ifdef __clang__
|
||||
# pragma clang system_header
|
||||
|
45
include/external/clara.hpp
vendored
45
include/external/clara.hpp
vendored
@@ -5,7 +5,7 @@
|
||||
//
|
||||
// See https://github.com/philsquared/Clara for more details
|
||||
|
||||
// Clara v1.1.2
|
||||
// Clara v1.1.3
|
||||
|
||||
#ifndef CATCH_CLARA_HPP_INCLUDED
|
||||
#define CATCH_CLARA_HPP_INCLUDED
|
||||
@@ -18,6 +18,15 @@
|
||||
#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CLARA_CONFIG_CONSOLE_WIDTH
|
||||
#endif
|
||||
|
||||
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
|
||||
#ifdef __has_include
|
||||
#if __has_include(<optional>) && __cplusplus >= 201703L
|
||||
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// ----------- #included from clara_textflow.hpp -----------
|
||||
|
||||
// TextFlowCpp
|
||||
@@ -389,11 +398,9 @@ namespace detail {
|
||||
std::vector<std::string> m_args;
|
||||
|
||||
public:
|
||||
Args( int argc, char *argv[] ) {
|
||||
m_exeName = argv[0];
|
||||
for( int i = 1; i < argc; ++i )
|
||||
m_args.push_back( argv[i] );
|
||||
}
|
||||
Args( int argc, char const* const* argv )
|
||||
: m_exeName(argv[0]),
|
||||
m_args(argv + 1, argv + argc) {}
|
||||
|
||||
Args( std::initializer_list<std::string> args )
|
||||
: m_exeName( *args.begin() ),
|
||||
@@ -580,15 +587,13 @@ namespace detail {
|
||||
|
||||
protected:
|
||||
void enforceOk() const override {
|
||||
// !TBD: If no exceptions, std::terminate here or something
|
||||
switch( m_type ) {
|
||||
case ResultBase::LogicError:
|
||||
throw std::logic_error( m_errorMessage );
|
||||
case ResultBase::RuntimeError:
|
||||
throw std::runtime_error( m_errorMessage );
|
||||
case ResultBase::Ok:
|
||||
break;
|
||||
}
|
||||
|
||||
// Errors shouldn't reach this point, but if they do
|
||||
// the actual error message will be in m_errorMessage
|
||||
assert( m_type != ResultBase::LogicError );
|
||||
assert( m_type != ResultBase::RuntimeError );
|
||||
if( m_type != ResultBase::Ok )
|
||||
std::abort();
|
||||
}
|
||||
|
||||
std::string m_errorMessage; // Only populated if resultType is an error
|
||||
@@ -658,6 +663,16 @@ namespace detail {
|
||||
return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
|
||||
return ParserResult::ok( ParseResultType::Matched );
|
||||
}
|
||||
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
||||
template<typename T>
|
||||
inline auto convertInto( std::string const &source, std::optional<T>& target ) -> ParserResult {
|
||||
T temp;
|
||||
auto result = convertInto( source, temp );
|
||||
if( result )
|
||||
target = temp;
|
||||
return result;
|
||||
}
|
||||
#endif // CLARA_CONFIG_OPTIONAL_TYPE
|
||||
|
||||
struct NonCopyable {
|
||||
NonCopyable() = default;
|
||||
|
@@ -65,9 +65,9 @@ namespace Catch {
|
||||
expr = m_info.capturedExpression;
|
||||
else {
|
||||
expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
|
||||
expr += m_info.macroName.c_str();
|
||||
expr += m_info.macroName;
|
||||
expr += "( ";
|
||||
expr += m_info.capturedExpression.c_str();
|
||||
expr += m_info.capturedExpression;
|
||||
expr += " )";
|
||||
}
|
||||
return expr;
|
||||
|
@@ -13,7 +13,7 @@ namespace Catch {
|
||||
using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
|
||||
|
||||
// This is the general overload that takes a any string matcher
|
||||
// There is another overload, in catch_assertinhandler.h/.cpp, that only takes a string and infers
|
||||
// There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
|
||||
// the Equals matcher (so the header does not mention matchers)
|
||||
void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) {
|
||||
std::string exceptionMessage = Catch::translateActiveException();
|
||||
|
@@ -20,9 +20,19 @@ namespace Catch {
|
||||
using namespace clara;
|
||||
|
||||
auto const setWarning = [&]( std::string const& warning ) {
|
||||
if( warning != "NoAssertions" )
|
||||
auto warningSet = [&]() {
|
||||
if( warning == "NoAssertions" )
|
||||
return WarnAbout::NoAssertions;
|
||||
|
||||
if ( warning == "NoTests" )
|
||||
return WarnAbout::NoTests;
|
||||
|
||||
return WarnAbout::Nothing;
|
||||
}();
|
||||
|
||||
if (warningSet == WarnAbout::Nothing)
|
||||
return ParserResult::runtimeError( "Unrecognised warning: '" + warning + "'" );
|
||||
config.warnings = static_cast<WarnAbout::What>( config.warnings | WarnAbout::NoAssertions );
|
||||
config.warnings = static_cast<WarnAbout::What>( config.warnings | warningSet );
|
||||
return ParserResult::ok( ParseResultType::Matched );
|
||||
};
|
||||
auto const loadTestNamesFromFile = [&]( std::string const& filename ) {
|
||||
|
@@ -59,14 +59,16 @@
|
||||
#endif // __clang__
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Assume that non-Windows platforms support posix signals by default
|
||||
#if !defined(CATCH_PLATFORM_WINDOWS)
|
||||
#define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// We know some environments not to support full POSIX signals
|
||||
#if defined(__CYGWIN__) || defined(__QNX__)
|
||||
|
||||
# if !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
|
||||
# endif
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
|
||||
#define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
|
||||
#endif
|
||||
|
||||
#ifdef __OS400__
|
||||
@@ -105,6 +107,13 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// DJGPP
|
||||
#ifdef __DJGPP__
|
||||
# define CATCH_INTERNAL_CONFIG_NO_WCHAR
|
||||
#endif // __DJGPP__
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Use of __COUNTER__ is suppressed during code analysis in
|
||||
// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly
|
||||
// handled by it.
|
||||
@@ -121,11 +130,15 @@
|
||||
# define CATCH_CONFIG_WINDOWS_SEH
|
||||
#endif
|
||||
// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
|
||||
#if !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
# define CATCH_CONFIG_POSIX_SIGNALS
|
||||
#endif
|
||||
// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions.
|
||||
#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR)
|
||||
# define CATCH_CONFIG_WCHAR
|
||||
#endif
|
||||
|
||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_INTERNAL_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
|
@@ -15,12 +15,16 @@ namespace Catch {
|
||||
: m_data( data ),
|
||||
m_stream( openStream() )
|
||||
{
|
||||
if( !data.testsOrTags.empty() ) {
|
||||
TestSpecParser parser( ITagAliasRegistry::get() );
|
||||
TestSpecParser parser(ITagAliasRegistry::get());
|
||||
if (data.testsOrTags.empty()) {
|
||||
parser.parse("~[.]"); // All not hidden tests
|
||||
}
|
||||
else {
|
||||
m_hasTestFilters = true;
|
||||
for( auto const& testOrTags : data.testsOrTags )
|
||||
parser.parse( testOrTags );
|
||||
m_testSpec = parser.testSpec();
|
||||
}
|
||||
m_testSpec = parser.testSpec();
|
||||
}
|
||||
|
||||
std::string const& Config::getFilename() const {
|
||||
@@ -35,9 +39,11 @@ namespace Catch {
|
||||
std::string Config::getProcessName() const { return m_data.processName; }
|
||||
|
||||
std::vector<std::string> const& Config::getReporterNames() const { return m_data.reporterNames; }
|
||||
std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
|
||||
std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
|
||||
|
||||
TestSpec const& Config::testSpec() const { return m_testSpec; }
|
||||
bool Config::hasTestFilters() const { return m_hasTestFilters; }
|
||||
|
||||
bool Config::showHelp() const { return m_data.showHelp; }
|
||||
|
||||
@@ -46,7 +52,8 @@ namespace Catch {
|
||||
std::ostream& Config::stream() const { return m_stream->stream(); }
|
||||
std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
|
||||
bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
|
||||
bool Config::warnAboutMissingAssertions() const { return m_data.warnings & WarnAbout::NoAssertions; }
|
||||
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
||||
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
||||
ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
|
||||
RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
|
||||
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
||||
|
@@ -78,9 +78,11 @@ namespace Catch {
|
||||
std::string getProcessName() const;
|
||||
|
||||
std::vector<std::string> const& getReporterNames() const;
|
||||
std::vector<std::string> const& getTestsOrTags() const;
|
||||
std::vector<std::string> const& getSectionsToRun() const override;
|
||||
|
||||
virtual TestSpec const& testSpec() const override;
|
||||
bool hasTestFilters() const override;
|
||||
|
||||
bool showHelp() const;
|
||||
|
||||
@@ -90,6 +92,7 @@ namespace Catch {
|
||||
std::string name() const override;
|
||||
bool includeSuccessfulResults() const override;
|
||||
bool warnAboutMissingAssertions() const override;
|
||||
bool warnAboutNoTests() const override;
|
||||
ShowDurations::OrNot showDurations() const override;
|
||||
RunTests::InWhatOrder runOrder() const override;
|
||||
unsigned int rngSeed() const override;
|
||||
@@ -107,6 +110,7 @@ namespace Catch {
|
||||
|
||||
std::unique_ptr<IStream const> m_stream;
|
||||
TestSpec m_testSpec;
|
||||
bool m_hasTestFilters = false;
|
||||
};
|
||||
|
||||
} // end namespace Catch
|
||||
|
@@ -169,7 +169,12 @@ namespace {
|
||||
#ifdef CATCH_PLATFORM_MAC
|
||||
!isDebuggerActive() &&
|
||||
#endif
|
||||
isatty(STDOUT_FILENO);
|
||||
#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
|
||||
isatty(STDOUT_FILENO)
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
;
|
||||
}
|
||||
IColourImpl* platformColourInstance() {
|
||||
ErrnoGuard guard;
|
||||
|
@@ -9,21 +9,23 @@
|
||||
#include "catch_debug_console.h"
|
||||
#include "catch_stream.h"
|
||||
#include "catch_platform.h"
|
||||
#include "catch_windows_h_proxy.h"
|
||||
|
||||
#ifdef CATCH_PLATFORM_WINDOWS
|
||||
|
||||
#include "catch_windows_h_proxy.h"
|
||||
|
||||
namespace Catch {
|
||||
void writeToDebugConsole( std::string const& text ) {
|
||||
::OutputDebugStringA( text.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
namespace Catch {
|
||||
void writeToDebugConsole( std::string const& text ) {
|
||||
// !TBD: Need a version for Mac/ XCode and other IDEs
|
||||
Catch::cout() << text;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // Platform
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
#ifndef __OBJC__
|
||||
|
||||
#if defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
||||
// Standard C/C++ Win32 Unicode wmain entry point
|
||||
extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
||||
#else
|
||||
|
@@ -11,10 +11,9 @@
|
||||
#include "catch_stream.h"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <iosfwd>
|
||||
|
||||
#define CATCH_PREPARE_EXCEPTION( type, msg ) \
|
||||
type( static_cast<std::ostringstream&&>( Catch::ReusableStringStream().get() << msg ).str() )
|
||||
type( ( Catch::ReusableStringStream() << msg ).str() )
|
||||
#define CATCH_INTERNAL_ERROR( msg ) \
|
||||
throw CATCH_PREPARE_EXCEPTION( std::logic_error, CATCH_INTERNAL_LINEINFO << ": Internal Catch error: " << msg);
|
||||
#define CATCH_ERROR( msg ) \
|
||||
|
@@ -17,24 +17,18 @@
|
||||
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
#endif
|
||||
|
||||
#if (defined(CATCH_PLATFORM_WINDOWS) && defined(CATCH_CONFIG_WINDOWS_SEH)) || defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
#if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS )
|
||||
|
||||
namespace {
|
||||
// Report the error condition
|
||||
void reportFatal( char const * const message ) {
|
||||
Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
|
||||
#endif // signals/SEH handling
|
||||
|
||||
# if !defined ( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
void FatalConditionHandler::reset() {}
|
||||
}
|
||||
|
||||
# else // CATCH_CONFIG_WINDOWS_SEH is defined
|
||||
#if defined( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
struct SignalDefs { DWORD id; const char* name; };
|
||||
@@ -74,7 +68,6 @@ namespace Catch {
|
||||
|
||||
void FatalConditionHandler::reset() {
|
||||
if (isSet) {
|
||||
// Unregister handler and restore the old guarantee
|
||||
RemoveVectoredExceptionHandler(exceptionHandlerHandle);
|
||||
SetThreadStackGuarantee(&guaranteeSize);
|
||||
exceptionHandlerHandle = nullptr;
|
||||
@@ -93,20 +86,7 @@ PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr;
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_WINDOWS_SEH
|
||||
|
||||
#else // Not Windows - assumed to be POSIX compatible //////////////////////////
|
||||
|
||||
# if !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
|
||||
namespace Catch {
|
||||
void FatalConditionHandler::reset() {}
|
||||
}
|
||||
|
||||
|
||||
# else // CATCH_CONFIG_POSIX_SIGNALS is defined
|
||||
|
||||
#include <signal.h>
|
||||
#elif defined( CATCH_CONFIG_POSIX_SIGNALS )
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@@ -178,9 +158,13 @@ namespace Catch {
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_POSIX_SIGNALS
|
||||
#else
|
||||
|
||||
#endif // not Windows
|
||||
namespace Catch {
|
||||
void FatalConditionHandler::reset() {}
|
||||
}
|
||||
|
||||
#endif // signals/SEH handling
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# pragma GCC diagnostic pop
|
||||
|
@@ -9,23 +9,12 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include "catch_platform.h"
|
||||
#include "catch_compiler_capabilities.h"
|
||||
|
||||
|
||||
#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
|
||||
#include "catch_windows_h_proxy.h"
|
||||
|
||||
# if !defined ( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
void reset();
|
||||
};
|
||||
}
|
||||
|
||||
# else // CATCH_CONFIG_WINDOWS_SEH is defined
|
||||
#if defined( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@@ -44,20 +33,7 @@ namespace Catch {
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_WINDOWS_SEH
|
||||
|
||||
#else // Not Windows - assumed to be POSIX compatible //////////////////////////
|
||||
|
||||
# if !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
|
||||
namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
void reset();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# else // CATCH_CONFIG_POSIX_SIGNALS is defined
|
||||
#elif defined ( CATCH_CONFIG_POSIX_SIGNALS )
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
@@ -66,7 +42,7 @@ namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
|
||||
static bool isSet;
|
||||
static struct sigaction oldSigActions[];// [sizeof(signalDefs) / sizeof(SignalDefs)];
|
||||
static struct sigaction oldSigActions[];
|
||||
static stack_t oldSigStack;
|
||||
static char altStackMem[];
|
||||
|
||||
@@ -79,8 +55,15 @@ namespace Catch {
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_POSIX_SIGNALS
|
||||
|
||||
#endif // not Windows
|
||||
#else
|
||||
|
||||
namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
void reset();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
|
||||
|
@@ -25,7 +25,8 @@ namespace Catch {
|
||||
|
||||
struct WarnAbout { enum What {
|
||||
Nothing = 0x00,
|
||||
NoAssertions = 0x01
|
||||
NoAssertions = 0x01,
|
||||
NoTests = 0x02
|
||||
}; };
|
||||
|
||||
struct ShowDurations { enum OrNot {
|
||||
@@ -62,10 +63,12 @@ namespace Catch {
|
||||
virtual bool includeSuccessfulResults() const = 0;
|
||||
virtual bool shouldDebugBreak() const = 0;
|
||||
virtual bool warnAboutMissingAssertions() const = 0;
|
||||
virtual bool warnAboutNoTests() const = 0;
|
||||
virtual int abortAfter() const = 0;
|
||||
virtual bool showInvisibles() const = 0;
|
||||
virtual ShowDurations::OrNot showDurations() const = 0;
|
||||
virtual TestSpec const& testSpec() const = 0;
|
||||
virtual bool hasTestFilters() const = 0;
|
||||
virtual RunTests::InWhatOrder runOrder() const = 0;
|
||||
virtual unsigned int rngSeed() const = 0;
|
||||
virtual int benchmarkResolutionMultiple() const = 0;
|
||||
|
@@ -28,11 +28,10 @@ namespace Catch {
|
||||
|
||||
std::size_t listTests( Config const& config ) {
|
||||
TestSpec testSpec = config.testSpec();
|
||||
if( config.testSpec().hasFilters() )
|
||||
if( config.hasTestFilters() )
|
||||
Catch::cout() << "Matching test cases:\n";
|
||||
else {
|
||||
Catch::cout() << "All available test cases:\n";
|
||||
testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
|
||||
}
|
||||
|
||||
auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
|
||||
@@ -54,7 +53,7 @@ namespace Catch {
|
||||
Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
|
||||
}
|
||||
|
||||
if( !config.testSpec().hasFilters() )
|
||||
if( !config.hasTestFilters() )
|
||||
Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
|
||||
else
|
||||
Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
|
||||
@@ -63,8 +62,6 @@ namespace Catch {
|
||||
|
||||
std::size_t listTestsNamesOnly( Config const& config ) {
|
||||
TestSpec testSpec = config.testSpec();
|
||||
if( !config.testSpec().hasFilters() )
|
||||
testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
|
||||
std::size_t matchedTests = 0;
|
||||
std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
|
||||
for( auto const& testCaseInfo : matchedTestCases ) {
|
||||
@@ -94,11 +91,10 @@ namespace Catch {
|
||||
|
||||
std::size_t listTags( Config const& config ) {
|
||||
TestSpec testSpec = config.testSpec();
|
||||
if( config.testSpec().hasFilters() )
|
||||
if( config.hasTestFilters() )
|
||||
Catch::cout() << "Tags for matching test cases:\n";
|
||||
else {
|
||||
Catch::cout() << "All available tags:\n";
|
||||
testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
|
||||
}
|
||||
|
||||
std::map<std::string, TagInfo> tagCounts;
|
||||
|
@@ -57,7 +57,7 @@ namespace Catch {
|
||||
m_context(getCurrentMutableContext()),
|
||||
m_config(_config),
|
||||
m_reporter(std::move(reporter)),
|
||||
m_lastAssertionInfo{ "", SourceLineInfo("",0), "", ResultDisposition::Normal },
|
||||
m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
|
||||
m_includeSuccessfulResults( m_config->includeSuccessfulResults() )
|
||||
{
|
||||
m_context.setRunner(this);
|
||||
@@ -84,7 +84,7 @@ namespace Catch {
|
||||
std::string redirectedCout;
|
||||
std::string redirectedCerr;
|
||||
|
||||
TestCaseInfo testInfo = testCase.getTestCaseInfo();
|
||||
auto const& testInfo = testCase.getTestCaseInfo();
|
||||
|
||||
m_reporter->testCaseStarting(testInfo);
|
||||
|
||||
@@ -292,7 +292,7 @@ namespace Catch {
|
||||
Counts prevAssertions = m_totals.assertions;
|
||||
double duration = 0;
|
||||
m_shouldReportUnexpected = true;
|
||||
m_lastAssertionInfo = { "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal };
|
||||
m_lastAssertionInfo = { "TEST_CASE"_sr, testCaseInfo.lineInfo, StringRef(), ResultDisposition::Normal };
|
||||
|
||||
seedRng(*m_config);
|
||||
|
||||
|
@@ -18,6 +18,8 @@
|
||||
#include "catch_random_number_generator.h"
|
||||
#include "catch_startup_exception_registry.h"
|
||||
#include "catch_text.h"
|
||||
#include "catch_stream.h"
|
||||
#include "catch_windows_h_proxy.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iomanip>
|
||||
@@ -69,8 +71,6 @@ namespace Catch {
|
||||
context.testGroupStarting(config->name(), 1, 1);
|
||||
|
||||
TestSpec testSpec = config->testSpec();
|
||||
if (!testSpec.hasFilters())
|
||||
testSpec = TestSpecParser(ITagAliasRegistry::get()).parse("~[.]").testSpec(); // All not hidden tests
|
||||
|
||||
auto const& allTestCases = getAllTestCasesSorted(*config);
|
||||
for (auto const& testCase : allTestCases) {
|
||||
@@ -80,6 +80,20 @@ namespace Catch {
|
||||
context.reporter().skipTest(testCase);
|
||||
}
|
||||
|
||||
if (config->warnAboutNoTests() && totals.testCases.total() == 0) {
|
||||
ReusableStringStream testConfig;
|
||||
|
||||
bool first = true;
|
||||
for (const auto& input : config->getTestsOrTags()) {
|
||||
if (!first) { testConfig << ' '; }
|
||||
first = false;
|
||||
testConfig << input;
|
||||
}
|
||||
|
||||
context.reporter().noMatchingTestCases(testConfig.str());
|
||||
totals.error = -1;
|
||||
}
|
||||
|
||||
context.testGroupEnded(config->name(), totals, 1, 1);
|
||||
return totals;
|
||||
}
|
||||
@@ -119,7 +133,7 @@ namespace Catch {
|
||||
if ( !exceptions.empty() ) {
|
||||
m_startupExceptions = true;
|
||||
Colour colourGuard( Colour::Red );
|
||||
Catch::cerr() << "Errors occured during startup!" << '\n';
|
||||
Catch::cerr() << "Errors occurred during startup!" << '\n';
|
||||
// iterate over all exceptions and notify user
|
||||
for ( const auto& ex_ptr : exceptions ) {
|
||||
try {
|
||||
@@ -151,7 +165,7 @@ namespace Catch {
|
||||
<< std::left << std::setw(16) << "version: " << libraryVersion() << std::endl;
|
||||
}
|
||||
|
||||
int Session::applyCommandLine( int argc, char* argv[] ) {
|
||||
int Session::applyCommandLine( int argc, char const * const * argv ) {
|
||||
if( m_startupExceptions )
|
||||
return 1;
|
||||
|
||||
@@ -188,7 +202,7 @@ namespace Catch {
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
#if defined(WIN32) && defined(UNICODE)
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE)
|
||||
int Session::run( int argc, wchar_t* const argv[] ) {
|
||||
|
||||
char **utf8Argv = new char *[ argc ];
|
||||
@@ -259,10 +273,11 @@ namespace Catch {
|
||||
if( Option<std::size_t> listed = list( config() ) )
|
||||
return static_cast<int>( *listed );
|
||||
|
||||
auto totals = runTests( m_config );
|
||||
// Note that on unices only the lower 8 bits are usually used, clamping
|
||||
// the return value to 255 prevents false negative when some multiple
|
||||
// of 256 tests has failed
|
||||
return (std::min)( MaxExitCode, static_cast<int>( runTests( m_config ).assertions.failed ) );
|
||||
return (std::min)( { MaxExitCode, totals.error, static_cast<int>( totals.assertions.failed ) } );
|
||||
}
|
||||
catch( std::exception& ex ) {
|
||||
Catch::cerr() << ex.what() << std::endl;
|
||||
|
@@ -25,12 +25,12 @@ namespace Catch {
|
||||
void showHelp() const;
|
||||
void libIdentify();
|
||||
|
||||
int applyCommandLine( int argc, char* argv[] );
|
||||
int applyCommandLine( int argc, char const * const * argv );
|
||||
|
||||
void useConfigData( ConfigData const& configData );
|
||||
|
||||
int run( int argc, char* argv[] );
|
||||
#if defined(WIN32) && defined(UNICODE)
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE)
|
||||
int run( int argc, wchar_t* const argv[] );
|
||||
#endif
|
||||
int run();
|
||||
|
@@ -43,7 +43,7 @@ namespace Catch {
|
||||
const_cast<StringRef*>( this )->takeOwnership();
|
||||
return m_start;
|
||||
}
|
||||
auto StringRef::data() const noexcept -> char const* {
|
||||
auto StringRef::currentData() const noexcept -> char const* {
|
||||
return m_start;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,12 @@ namespace Catch {
|
||||
}
|
||||
|
||||
auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
|
||||
return os << str.c_str();
|
||||
return os.write(str.currentData(), str.size());
|
||||
}
|
||||
|
||||
auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& {
|
||||
lhs.append(rhs.currentData(), rhs.size());
|
||||
return lhs;
|
||||
}
|
||||
|
||||
} // namespace Catch
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <iosfwd>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
||||
class StringData;
|
||||
|
||||
/// A non-owning string class (similar to the forthcoming std::string_view)
|
||||
@@ -31,13 +31,13 @@ namespace Catch {
|
||||
|
||||
char const* m_start;
|
||||
size_type m_size;
|
||||
|
||||
|
||||
char* m_data = nullptr;
|
||||
|
||||
|
||||
void takeOwnership();
|
||||
|
||||
static constexpr char const* const s_empty = "";
|
||||
|
||||
|
||||
public: // construction/ assignment
|
||||
StringRef() noexcept
|
||||
: StringRef( s_empty, 0 )
|
||||
@@ -83,13 +83,13 @@ namespace Catch {
|
||||
operator std::string() const;
|
||||
|
||||
void swap( StringRef& other ) noexcept;
|
||||
|
||||
|
||||
public: // operators
|
||||
auto operator == ( StringRef const& other ) const noexcept -> bool;
|
||||
auto operator != ( StringRef const& other ) const noexcept -> bool;
|
||||
|
||||
|
||||
auto operator[] ( size_type index ) const noexcept -> char;
|
||||
|
||||
|
||||
public: // named queries
|
||||
auto empty() const noexcept -> bool {
|
||||
return m_size == 0;
|
||||
@@ -100,22 +100,27 @@ namespace Catch {
|
||||
|
||||
auto numberOfCharacters() const noexcept -> size_type;
|
||||
auto c_str() const -> char const*;
|
||||
|
||||
|
||||
public: // substrings and searches
|
||||
auto substr( size_type start, size_type size ) const noexcept -> StringRef;
|
||||
|
||||
// Returns the current start pointer.
|
||||
// Note that the pointer can change when if the StringRef is a substring
|
||||
auto currentData() const noexcept -> char const*;
|
||||
|
||||
private: // ownership queries - may not be consistent between calls
|
||||
auto isOwned() const noexcept -> bool;
|
||||
auto isSubstring() const noexcept -> bool;
|
||||
auto data() const noexcept -> char const*;
|
||||
};
|
||||
|
||||
auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> std::string;
|
||||
auto operator + ( StringRef const& lhs, char const* rhs ) -> std::string;
|
||||
auto operator + ( char const* lhs, StringRef const& rhs ) -> std::string;
|
||||
|
||||
auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
|
||||
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
||||
|
||||
|
||||
inline auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
return StringRef( rawChars, size );
|
||||
}
|
||||
|
@@ -48,8 +48,7 @@ namespace Catch {
|
||||
|
||||
TestCase makeTestCase( ITestInvoker* _testCase,
|
||||
std::string const& _className,
|
||||
std::string const& _name,
|
||||
std::string const& _descOrTags,
|
||||
NameAndTags const& nameAndTags,
|
||||
SourceLineInfo const& _lineInfo )
|
||||
{
|
||||
bool isHidden = false;
|
||||
@@ -58,6 +57,7 @@ namespace Catch {
|
||||
std::vector<std::string> tags;
|
||||
std::string desc, tag;
|
||||
bool inTag = false;
|
||||
std::string _descOrTags = nameAndTags.tags;
|
||||
for (char c : _descOrTags) {
|
||||
if( !inTag ) {
|
||||
if( c == '[' )
|
||||
@@ -85,8 +85,8 @@ namespace Catch {
|
||||
tags.push_back( "." );
|
||||
}
|
||||
|
||||
TestCaseInfo info( _name, _className, desc, tags, _lineInfo );
|
||||
return TestCase( _testCase, info );
|
||||
TestCaseInfo info( nameAndTags.name, _className, desc, tags, _lineInfo );
|
||||
return TestCase( _testCase, std::move(info) );
|
||||
}
|
||||
|
||||
void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
|
||||
@@ -147,7 +147,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
|
||||
TestCase::TestCase( ITestInvoker* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {}
|
||||
TestCase::TestCase( ITestInvoker* testCase, TestCaseInfo&& info ) : TestCaseInfo( std::move(info) ), test( testCase ) {}
|
||||
|
||||
|
||||
TestCase TestCase::withName( std::string const& _newName ) const {
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED
|
||||
|
||||
#include "catch_common.h"
|
||||
#include "catch_test_registry.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -61,7 +62,7 @@ namespace Catch {
|
||||
class TestCase : public TestCaseInfo {
|
||||
public:
|
||||
|
||||
TestCase( ITestInvoker* testCase, TestCaseInfo const& info );
|
||||
TestCase( ITestInvoker* testCase, TestCaseInfo&& info );
|
||||
|
||||
TestCase withName( std::string const& _newName ) const;
|
||||
|
||||
@@ -78,8 +79,7 @@ namespace Catch {
|
||||
|
||||
TestCase makeTestCase( ITestInvoker* testCase,
|
||||
std::string const& className,
|
||||
std::string const& name,
|
||||
std::string const& description,
|
||||
NameAndTags const& nameAndTags,
|
||||
SourceLineInfo const& lineInfo );
|
||||
}
|
||||
|
||||
|
@@ -96,7 +96,7 @@ namespace Catch {
|
||||
m_testAsFunction();
|
||||
}
|
||||
|
||||
std::string extractClassName( std::string const& classOrQualifiedMethodName ) {
|
||||
std::string extractClassName( StringRef const& classOrQualifiedMethodName ) {
|
||||
std::string className = classOrQualifiedMethodName;
|
||||
if( startsWith( className, '&' ) )
|
||||
{
|
||||
|
@@ -22,7 +22,7 @@ namespace Catch {
|
||||
class TestCase;
|
||||
struct IConfig;
|
||||
|
||||
std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases );
|
||||
std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases );
|
||||
bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
|
||||
|
||||
void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions );
|
||||
@@ -58,7 +58,7 @@ namespace Catch {
|
||||
};
|
||||
|
||||
|
||||
std::string extractClassName( std::string const& classOrQualifiedMethodName );
|
||||
std::string extractClassName( StringRef const& classOrQualifiedMethodName );
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -15,23 +15,22 @@ namespace Catch {
|
||||
return new(std::nothrow) TestInvokerAsFunction( testAsFunction );
|
||||
}
|
||||
|
||||
NameAndTags::NameAndTags( StringRef name_ , StringRef tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
|
||||
NameAndTags::NameAndTags( StringRef const& name_ , StringRef const& tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
|
||||
|
||||
AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept {
|
||||
AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept {
|
||||
try {
|
||||
getMutableRegistryHub()
|
||||
.registerTest(
|
||||
makeTestCase(
|
||||
invoker,
|
||||
extractClassName( classOrMethod ),
|
||||
nameAndTags.name,
|
||||
nameAndTags.tags,
|
||||
nameAndTags,
|
||||
lineInfo));
|
||||
} catch (...) {
|
||||
// Do not throw when constructing global objects, instead register the exception to be processed later
|
||||
getMutableRegistryHub().registerStartupException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AutoReg::~AutoReg() = default;
|
||||
}
|
||||
|
@@ -35,13 +35,13 @@ auto makeTestInvoker( void (C::*testAsMethod)() ) noexcept -> ITestInvoker* {
|
||||
}
|
||||
|
||||
struct NameAndTags {
|
||||
NameAndTags( StringRef name_ = StringRef(), StringRef tags_ = StringRef() ) noexcept;
|
||||
NameAndTags( StringRef const& name_ = StringRef(), StringRef const& tags_ = StringRef() ) noexcept;
|
||||
StringRef name;
|
||||
StringRef tags;
|
||||
};
|
||||
|
||||
struct AutoReg : NonCopyable {
|
||||
AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept;
|
||||
AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept;
|
||||
~AutoReg();
|
||||
};
|
||||
|
||||
|
@@ -116,6 +116,7 @@ std::string StringMaker<std::string>::convert(const std::string& str) {
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
|
||||
std::string s;
|
||||
s.reserve(wstr.size());
|
||||
@@ -124,6 +125,7 @@ std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
|
||||
}
|
||||
return ::Catch::Detail::stringify(s);
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string StringMaker<char const*>::convert(char const* str) {
|
||||
if (str) {
|
||||
@@ -139,6 +141,7 @@ std::string StringMaker<char*>::convert(char* str) {
|
||||
return{ "{null string}" };
|
||||
}
|
||||
}
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
|
||||
if (str) {
|
||||
return ::Catch::Detail::stringify(std::wstring{ str });
|
||||
@@ -153,6 +156,7 @@ std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
|
||||
return{ "{null string}" };
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
std::string StringMaker<int>::convert(int value) {
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <string>
|
||||
#include "catch_compiler_capabilities.h"
|
||||
#include "catch_stream.h"
|
||||
|
||||
#ifdef __OBJC__
|
||||
@@ -61,8 +62,13 @@ namespace Catch {
|
||||
std::string convertUnknownEnumToString( E e );
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<!std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& ) {
|
||||
typename std::enable_if<!std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& value ) {
|
||||
#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
|
||||
(void)value;
|
||||
return Detail::unprintableString;
|
||||
#else
|
||||
return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
|
||||
#endif
|
||||
}
|
||||
template<typename T>
|
||||
typename std::enable_if<std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& value ) {
|
||||
@@ -114,10 +120,12 @@ namespace Catch {
|
||||
struct StringMaker<std::string> {
|
||||
static std::string convert(const std::string& str);
|
||||
};
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
template<>
|
||||
struct StringMaker<std::wstring> {
|
||||
static std::string convert(const std::wstring& wstr);
|
||||
};
|
||||
#endif
|
||||
|
||||
template<>
|
||||
struct StringMaker<char const *> {
|
||||
@@ -127,6 +135,7 @@ namespace Catch {
|
||||
struct StringMaker<char *> {
|
||||
static std::string convert(char * str);
|
||||
};
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
template<>
|
||||
struct StringMaker<wchar_t const *> {
|
||||
static std::string convert(wchar_t const * str);
|
||||
@@ -135,6 +144,7 @@ namespace Catch {
|
||||
struct StringMaker<wchar_t *> {
|
||||
static std::string convert(wchar_t * str);
|
||||
};
|
||||
#endif
|
||||
|
||||
template<int SZ>
|
||||
struct StringMaker<char[SZ]> {
|
||||
|
@@ -32,7 +32,7 @@ namespace Catch {
|
||||
|
||||
Totals delta( Totals const& prevTotals ) const;
|
||||
|
||||
|
||||
int error = 0;
|
||||
Counts assertions;
|
||||
Counts testCases;
|
||||
};
|
||||
|
@@ -37,7 +37,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
Version const& libraryVersion() {
|
||||
static Version version( 2, 1, 2, "", 0 );
|
||||
static Version version( 2, 2, 0, "", 0 );
|
||||
return version;
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ namespace Catch {
|
||||
~TAPReporter() override;
|
||||
|
||||
static std::string getDescription() {
|
||||
return "Reports test results in TAP format, suitable for test harneses";
|
||||
return "Reports test results in TAP format, suitable for test harnesses";
|
||||
}
|
||||
|
||||
ReporterPreferences getPreferences() const override {
|
||||
|
@@ -1,12 +1,26 @@
|
||||
@REM # In debug build, we want to
|
||||
@REM # 1) Prebuild memcheck redirecter
|
||||
@REM # 2) Regenerate single header include for examples
|
||||
@REM # 3) Enable building examples
|
||||
|
||||
@REM # Possibilities:
|
||||
@REM # Debug build + coverage
|
||||
@REM # Debug build + examples
|
||||
@REM # Debug build + ---
|
||||
@REM # Release build
|
||||
if "%CONFIGURATION%"=="Debug" (
|
||||
python scripts\generateSingleHeader.py
|
||||
cmake -Hmisc -Bbuild-misc -A%PLATFORM%
|
||||
cmake --build build-misc
|
||||
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=ON -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind
|
||||
if "%coverage%"=="1" (
|
||||
@REM # coverage needs to build the special helper as well as the main
|
||||
cmake -Hmisc -Bbuild-misc -A%PLATFORM%
|
||||
cmake --build build-misc
|
||||
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind
|
||||
) else (
|
||||
@REM # We know that coverage is 0
|
||||
if "%examples%"=="1" (
|
||||
@REM # Examples live off the single header, so it needs to be regenerated
|
||||
python scripts\generateSingleHeader.py
|
||||
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=ON
|
||||
) else (
|
||||
@REM # This is just a plain debug build
|
||||
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain%
|
||||
)
|
||||
)
|
||||
)
|
||||
if "%CONFIGURATION%"=="Release" (
|
||||
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain%
|
||||
|
@@ -1,8 +1,12 @@
|
||||
cd Build
|
||||
if "%CONFIGURATION%"=="Debug" (
|
||||
ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck
|
||||
python ..\misc\appveyorMergeCoverageScript.py
|
||||
codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN%
|
||||
if "%coverage%"=="1" (
|
||||
ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck
|
||||
python ..\misc\appveyorMergeCoverageScript.py
|
||||
codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN%
|
||||
) else (
|
||||
ctest -j 2 -C %CONFIGURATION%
|
||||
)
|
||||
)
|
||||
if "%CONFIGURATION%"=="Release" (
|
||||
ctest -j 2 -C %CONFIGURATION%
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Downloads are done from the oficial github release page links
|
||||
$downloadUrl = "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.6.1/OpenCppCoverageSetup-x64-0.9.6.1.exe"
|
||||
# Downloads are done from the official github release page links
|
||||
$downloadUrl = "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.7.0/OpenCppCoverageSetup-x64-0.9.7.0.exe"
|
||||
$installerPath = [System.IO.Path]::Combine($Env:USERPROFILE, "Downloads", "OpenCppCoverageSetup.exe")
|
||||
|
||||
if(-Not (Test-Path $installerPath)) {
|
||||
|
@@ -53,7 +53,7 @@
|
||||
:test-result: PASS Inequality checks that should succeed
|
||||
:test-result: PASS Less-than inequalities with different epsilons
|
||||
:test-result: PASS Long strings can be wrapped
|
||||
:test-result: PASS Long text is truncted
|
||||
:test-result: PASS Long text is truncated
|
||||
:test-result: PASS ManuallyRegistered
|
||||
:test-result: PASS Matchers can be (AllOf) composed with the && operator
|
||||
:test-result: PASS Matchers can be (AnyOf) composed with the || operator
|
||||
|
@@ -9,6 +9,7 @@ Compilation.tests.cpp:<line number>: passed: t1 < t2 for: {?} < {?}
|
||||
Compilation.tests.cpp:<line number>: passed: t1 > t2 for: {?} > {?}
|
||||
Compilation.tests.cpp:<line number>: passed: t1 <= t2 for: {?} <= {?}
|
||||
Compilation.tests.cpp:<line number>: passed: t1 >= t2 for: {?} >= {?}
|
||||
Misc.tests.cpp:<line number>: passed:
|
||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42' with 1 message: 'expected exception'
|
||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42'; expression was: thisThrows() with 1 message: 'expected exception'
|
||||
Exception.tests.cpp:<line number>: passed: thisThrows() with 1 message: 'answer := 42'
|
||||
@@ -235,9 +236,9 @@ Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs(1., 0.99) for: 0.0 not
|
||||
Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs(1., 0.99) for: 0.0 not is within 0.99 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: NAN, !WithinAbs(NAN, 0) for: nanf not is within 0.0 of nan
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: std::nextafter(1., 2.), WithinULP(1., 1) for: 1.0 is within 1 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: std::nextafter(1., 0.), WithinULP(1., 1) for: 1.0 is within 1 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: std::nextafter(1., 2.), !WithinULP(1., 0) for: 1.0 not is within 0 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: nextafter(1., 2.), WithinULP(1., 1) for: 1.0 is within 1 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: nextafter(1., 0.), WithinULP(1., 1) for: 1.0 is within 1 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: nextafter(1., 2.), !WithinULP(1., 0) for: 1.0 not is within 0 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: -0., WithinULP(0., 0) for: -0.0 is within 0 ULPs of 0.0
|
||||
Matchers.tests.cpp:<line number>: passed: NAN, !WithinULP(NAN, 123) for: nanf not is within 123 ULPs of nanf
|
||||
@@ -255,9 +256,9 @@ Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs(1.f, 0.99f) for: 0.0f
|
||||
Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs(-0.f, 0) for: 0.0f is within 0.0 of -0.0
|
||||
Matchers.tests.cpp:<line number>: passed: NAN, !WithinAbs(NAN, 0) for: nanf not is within 0.0 of nan
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: std::nextafter(1.f, 2.f), WithinULP(1.f, 1) for: 1.0f is within 1 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: std::nextafter(1.f, 0.f), WithinULP(1.f, 1) for: 1.0f is within 1 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: std::nextafter(1.f, 2.f), !WithinULP(1.f, 0) for: 1.0f not is within 0 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: nextafter(1.f, 2.f), WithinULP(1.f, 1) for: 1.0f is within 1 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: nextafter(1.f, 0.f), WithinULP(1.f, 1) for: 1.0f is within 1 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: nextafter(1.f, 2.f), !WithinULP(1.f, 0) for: 1.0f not is within 0 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.0f
|
||||
Matchers.tests.cpp:<line number>: passed: -0.f, WithinULP(0.f, 0) for: -0.0f is within 0 ULPs of 0.0f
|
||||
Matchers.tests.cpp:<line number>: passed: NAN, !WithinULP(NAN, 123) for: nanf not is within 123 ULPs of nanf
|
||||
@@ -514,13 +515,17 @@ CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak == false for: f
|
||||
CmdLine.tests.cpp:<line number>: passed: config.abortAfter == -1 for: -1 == -1
|
||||
CmdLine.tests.cpp:<line number>: passed: config.noThrow == false for: false == false
|
||||
CmdLine.tests.cpp:<line number>: passed: config.reporterNames.empty() for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false
|
||||
CmdLine.tests.cpp:<line number>: passed: result for: {?}
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("notIncluded")) == false for: false == false
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("test1")) for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: result for: {?}
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("test1")) == false for: false == false
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: result for: {?}
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("test1")) == false for: false == false
|
||||
CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(fakeTestCase("alwaysIncluded")) for: true
|
||||
CmdLine.tests.cpp:<line number>: passed: cli.parse({"test", "-r", "console"}) for: {?}
|
||||
@@ -622,18 +627,21 @@ String.tests.cpp:<line number>: passed: isOwned( s ) == false for: false == fals
|
||||
String.tests.cpp:<line number>: passed: s.c_str() == rawChars for: "hello" == "hello"
|
||||
String.tests.cpp:<line number>: passed: isOwned( s ) == false for: false == false
|
||||
String.tests.cpp:<line number>: passed: original == "original"
|
||||
String.tests.cpp:<line number>: failed: isSubstring( original ) for: false
|
||||
String.tests.cpp:<line number>: passed: isSubstring( original ) for: true
|
||||
String.tests.cpp:<line number>: passed: isOwned( original ) == false for: false == false
|
||||
String.tests.cpp:<line number>: passed: isSubstring( original ) == false for: false == false
|
||||
String.tests.cpp:<line number>: passed: isOwned( original ) for: true
|
||||
String.tests.cpp:<line number>: passed: ss.empty() == false for: false == false
|
||||
String.tests.cpp:<line number>: passed: ss.size() == 5 for: 5 == 5
|
||||
String.tests.cpp:<line number>: passed: std::strcmp( ss.c_str(), "hello" ) == 0 for: 0 == 0
|
||||
String.tests.cpp:<line number>: passed: ss == "hello" for: hello == "hello"
|
||||
String.tests.cpp:<line number>: passed: isSubstring( ss ) for: true
|
||||
String.tests.cpp:<line number>: passed: isOwned( ss ) == false for: false == false
|
||||
String.tests.cpp:<line number>: passed: rawChars == data( s ) for: "hello world!" == "hello world!"
|
||||
String.tests.cpp:<line number>: passed: rawChars == s.currentData() for: "hello world!" == "hello world!"
|
||||
String.tests.cpp:<line number>: passed: ss.c_str() != rawChars for: "hello" != "hello world!"
|
||||
String.tests.cpp:<line number>: passed: isSubstring( ss ) == false for: false == false
|
||||
String.tests.cpp:<line number>: passed: isOwned( ss ) for: true
|
||||
String.tests.cpp:<line number>: passed: data( ss ) != data( s ) for: "hello" != "hello world!"
|
||||
String.tests.cpp:<line number>: passed: ss.currentData() != s.currentData() for: "hello" != "hello world!"
|
||||
String.tests.cpp:<line number>: passed: ss.size() == 6 for: 6 == 6
|
||||
String.tests.cpp:<line number>: passed: std::strcmp( ss.c_str(), "world!" ) == 0 for: 0 == 0
|
||||
String.tests.cpp:<line number>: passed: s.c_str() == s2.c_str() for: "hello world!" == "hello world!"
|
||||
@@ -692,6 +700,7 @@ VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions'
|
||||
Tricky.tests.cpp:<line number>: passed: 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472
|
||||
Message.tests.cpp:<line number>: failed - but was ok: 1 == 2
|
||||
Misc.tests.cpp:<line number>: passed: with 1 message: 'oops!'
|
||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'For some reason someone is throwing a string literal!'
|
||||
PartTracker.tests.cpp:<line number>: passed: testCase.isOpen() for: true
|
||||
PartTracker.tests.cpp:<line number>: passed: s1.isOpen() for: true
|
||||
PartTracker.tests.cpp:<line number>: passed: s1.isSuccessfullyCompleted() for: true
|
||||
@@ -977,19 +986,6 @@ ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pr ) =
|
||||
==
|
||||
"{ { "green", 55 } }"
|
||||
Tricky.tests.cpp:<line number>: failed: std::string( "first" ) == "second" for: "first" == "second"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" for: "StringMaker<has_maker>"
|
||||
==
|
||||
"StringMaker<has_maker>"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" for: "StringMaker<has_maker_and_operator>"
|
||||
==
|
||||
"StringMaker<has_maker_and_operator>"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" for: "operator<<( has_operator )"
|
||||
==
|
||||
"operator<<( has_operator )"
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" for: "op<<(streamable_range)"
|
||||
==
|
||||
"op<<(streamable_range)"
|
||||
@@ -997,7 +993,17 @@ ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(string
|
||||
==
|
||||
"stringmaker(streamable_range)"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" for: "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(disabled_range{}) == "{?}" for: "{?}" == "{?}"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" for: "{ !!! }" == "{ !!! }"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" for: "StringMaker<has_maker>"
|
||||
==
|
||||
"StringMaker<has_maker>"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" for: "StringMaker<has_maker_and_operator>"
|
||||
==
|
||||
"StringMaker<has_maker_and_operator>"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(item) == "{ !!! }" for: "{ !!! }" == "{ !!! }"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" for: "operator<<( has_operator )"
|
||||
==
|
||||
"operator<<( has_operator )"
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" for: "{ StringMaker<has_maker> }"
|
||||
==
|
||||
"{ StringMaker<has_maker> }"
|
||||
@@ -1007,6 +1013,11 @@ ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) =
|
||||
ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" for: "{ operator<<( has_operator ) }"
|
||||
==
|
||||
"{ operator<<( has_operator ) }"
|
||||
Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'Why would you throw a std::string?'
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load""
|
||||
EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == "E2/V0" for: "E2/V0" == "E2/V0"
|
||||
EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e1) == "E2/V1" for: "E2/V1" == "E2/V1"
|
||||
EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e3) == "Unknown enum value 10" for: "Unknown enum value 10"
|
||||
@@ -1069,5 +1080,5 @@ Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
|
||||
Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
|
||||
Misc.tests.cpp:<line number>: passed:
|
||||
Misc.tests.cpp:<line number>: passed:
|
||||
Failed 61 test cases, failed 120 assertions.
|
||||
Failed 62 test cases, failed 121 assertions.
|
||||
|
||||
|
@@ -738,6 +738,16 @@ with expansion:
|
||||
}
|
||||
"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Thrown string literals are translated
|
||||
-------------------------------------------------------------------------------
|
||||
Exception.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Exception.tests.cpp:<line number>: FAILED:
|
||||
due to unexpected exception with message:
|
||||
For some reason someone is throwing a string literal!
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Unexpected exceptions can be translated
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -1063,7 +1073,17 @@ Tricky.tests.cpp:<line number>: FAILED:
|
||||
with expansion:
|
||||
"first" == "second"
|
||||
|
||||
===============================================================================
|
||||
test cases: 198 | 147 passed | 47 failed | 4 failed as expected
|
||||
assertions: 999 | 873 passed | 105 failed | 21 failed as expected
|
||||
-------------------------------------------------------------------------------
|
||||
thrown std::strings are translated
|
||||
-------------------------------------------------------------------------------
|
||||
Exception.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Exception.tests.cpp:<line number>: FAILED:
|
||||
due to unexpected exception with message:
|
||||
Why would you throw a std::string?
|
||||
|
||||
===============================================================================
|
||||
test cases: 202 | 149 passed | 49 failed | 4 failed as expected
|
||||
assertions: 1007 | 879 passed | 107 failed | 21 failed as expected
|
||||
|
||||
|
@@ -93,6 +93,15 @@ PASSED:
|
||||
with expansion:
|
||||
{?} >= {?}
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1175 - Hidden Test
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#748 - captures with unexpected exceptions
|
||||
outside assertions
|
||||
@@ -1864,19 +1873,19 @@ with expansion:
|
||||
|
||||
Matchers.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE_THAT( std::nextafter(1., 2.), WithinULP(1., 1) )
|
||||
REQUIRE_THAT( nextafter(1., 2.), WithinULP(1., 1) )
|
||||
with expansion:
|
||||
1.0 is within 1 ULPs of 1.0
|
||||
|
||||
Matchers.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE_THAT( std::nextafter(1., 0.), WithinULP(1., 1) )
|
||||
REQUIRE_THAT( nextafter(1., 0.), WithinULP(1., 1) )
|
||||
with expansion:
|
||||
1.0 is within 1 ULPs of 1.0
|
||||
|
||||
Matchers.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE_THAT( std::nextafter(1., 2.), !WithinULP(1., 0) )
|
||||
REQUIRE_THAT( nextafter(1., 2.), !WithinULP(1., 0) )
|
||||
with expansion:
|
||||
1.0 not is within 0 ULPs of 1.0
|
||||
|
||||
@@ -2004,19 +2013,19 @@ with expansion:
|
||||
|
||||
Matchers.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE_THAT( std::nextafter(1.f, 2.f), WithinULP(1.f, 1) )
|
||||
REQUIRE_THAT( nextafter(1.f, 2.f), WithinULP(1.f, 1) )
|
||||
with expansion:
|
||||
1.0f is within 1 ULPs of 1.0f
|
||||
|
||||
Matchers.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE_THAT( std::nextafter(1.f, 0.f), WithinULP(1.f, 1) )
|
||||
REQUIRE_THAT( nextafter(1.f, 0.f), WithinULP(1.f, 1) )
|
||||
with expansion:
|
||||
1.0f is within 1 ULPs of 1.0f
|
||||
|
||||
Matchers.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE_THAT( std::nextafter(1.f, 2.f), !WithinULP(1.f, 0) )
|
||||
REQUIRE_THAT( nextafter(1.f, 2.f), !WithinULP(1.f, 0) )
|
||||
with expansion:
|
||||
1.0f not is within 0 ULPs of 1.0f
|
||||
|
||||
@@ -3965,6 +3974,12 @@ PASSED:
|
||||
with expansion:
|
||||
true
|
||||
|
||||
CmdLine.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
CHECK_FALSE( cfg.hasTestFilters() )
|
||||
with expansion:
|
||||
!false
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Process can be configured on command line
|
||||
test lists
|
||||
@@ -3979,6 +3994,12 @@ PASSED:
|
||||
with expansion:
|
||||
{?}
|
||||
|
||||
CmdLine.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( cfg.hasTestFilters() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
CmdLine.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( cfg.testSpec().matches(fakeTestCase("notIncluded")) == false )
|
||||
@@ -4005,6 +4026,12 @@ PASSED:
|
||||
with expansion:
|
||||
{?}
|
||||
|
||||
CmdLine.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( cfg.hasTestFilters() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
CmdLine.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false )
|
||||
@@ -4031,6 +4058,12 @@ PASSED:
|
||||
with expansion:
|
||||
{?}
|
||||
|
||||
CmdLine.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( cfg.hasTestFilters() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
CmdLine.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( cfg.testSpec().matches(fakeTestCase("test1")) == false )
|
||||
@@ -4965,10 +4998,29 @@ String.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( original == "original" )
|
||||
|
||||
String.tests.cpp:<line number>: FAILED:
|
||||
String.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( isSubstring( original ) )
|
||||
with expansion:
|
||||
false
|
||||
true
|
||||
|
||||
String.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( isOwned( original ) == false )
|
||||
with expansion:
|
||||
false == false
|
||||
|
||||
String.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( isSubstring( original ) == false )
|
||||
with expansion:
|
||||
false == false
|
||||
|
||||
String.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( isOwned( original ) )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
StringRef
|
||||
@@ -5024,7 +5076,7 @@ with expansion:
|
||||
|
||||
String.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( rawChars == data( s ) )
|
||||
REQUIRE( rawChars == s.currentData() )
|
||||
with expansion:
|
||||
"hello world!" == "hello world!"
|
||||
|
||||
@@ -5048,7 +5100,7 @@ with expansion:
|
||||
|
||||
String.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( data( ss ) != data( s ) )
|
||||
REQUIRE( ss.currentData() != s.currentData() )
|
||||
with expansion:
|
||||
"hello" != "hello world!"
|
||||
|
||||
@@ -5453,6 +5505,16 @@ PASSED:
|
||||
with message:
|
||||
oops!
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Thrown string literals are translated
|
||||
-------------------------------------------------------------------------------
|
||||
Exception.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Exception.tests.cpp:<line number>: FAILED:
|
||||
due to unexpected exception with message:
|
||||
For some reason someone is throwing a string literal!
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Tracker
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -7829,6 +7891,40 @@ Tricky.tests.cpp:<line number>: FAILED:
|
||||
with expansion:
|
||||
"first" == "second"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify ranges
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" )
|
||||
with expansion:
|
||||
"op<<(streamable_range)"
|
||||
==
|
||||
"op<<(streamable_range)"
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" )
|
||||
with expansion:
|
||||
"stringmaker(streamable_range)"
|
||||
==
|
||||
"stringmaker(streamable_range)"
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" )
|
||||
with expansion:
|
||||
"{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" )
|
||||
with expansion:
|
||||
"{ !!! }" == "{ !!! }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify( has_maker )
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -7844,7 +7940,7 @@ with expansion:
|
||||
"StringMaker<has_maker>"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify( has_maker_and_toString )
|
||||
stringify( has_maker_and_operator )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
@@ -7857,6 +7953,18 @@ with expansion:
|
||||
==
|
||||
"StringMaker<has_maker_and_operator>"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify( has_neither )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" )
|
||||
with expansion:
|
||||
"{ !!! }" == "{ !!! }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify( has_operator )
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -7871,6 +7979,58 @@ with expansion:
|
||||
==
|
||||
"operator<<( has_operator )"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify( vectors<has_maker> )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" )
|
||||
with expansion:
|
||||
"{ StringMaker<has_maker> }"
|
||||
==
|
||||
"{ StringMaker<has_maker> }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify( vectors<has_maker_and_operator> )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" )
|
||||
with expansion:
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
==
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stringify( vectors<has_operator> )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" )
|
||||
with expansion:
|
||||
"{ operator<<( has_operator ) }"
|
||||
==
|
||||
"{ operator<<( has_operator ) }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
thrown std::strings are translated
|
||||
-------------------------------------------------------------------------------
|
||||
Exception.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Exception.tests.cpp:<line number>: FAILED:
|
||||
due to unexpected exception with message:
|
||||
Why would you throw a std::string?
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
toString on const wchar_t const pointer returns the string contents
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -7919,82 +8079,6 @@ PASSED:
|
||||
with expansion:
|
||||
""wide load"" == ""wide load""
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
toString streamable range
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" )
|
||||
with expansion:
|
||||
"op<<(streamable_range)"
|
||||
==
|
||||
"op<<(streamable_range)"
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" )
|
||||
with expansion:
|
||||
"stringmaker(streamable_range)"
|
||||
==
|
||||
"stringmaker(streamable_range)"
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" )
|
||||
with expansion:
|
||||
"{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{?}" )
|
||||
with expansion:
|
||||
"{?}" == "{?}"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
toString( vectors<has_maker> )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" )
|
||||
with expansion:
|
||||
"{ StringMaker<has_maker> }"
|
||||
==
|
||||
"{ StringMaker<has_maker> }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
toString( vectors<has_maker_and_operator> )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" )
|
||||
with expansion:
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
==
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
toString( vectors<has_operator> )
|
||||
-------------------------------------------------------------------------------
|
||||
ToStringWhich.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
ToStringWhich.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" )
|
||||
with expansion:
|
||||
"{ operator<<( has_operator ) }"
|
||||
==
|
||||
"{ operator<<( has_operator ) }"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
toString(enum class w/operator<<)
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -8466,6 +8550,6 @@ Misc.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 198 | 133 passed | 61 failed | 4 failed as expected
|
||||
assertions: 1010 | 869 passed | 120 failed | 21 failed as expected
|
||||
test cases: 202 | 136 passed | 62 failed | 4 failed as expected
|
||||
assertions: 1021 | 879 passed | 121 failed | 21 failed as expected
|
||||
|
||||
|
@@ -93,6 +93,15 @@ PASSED:
|
||||
with expansion:
|
||||
{?} >= {?}
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#1175 - Hidden Test
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Misc.tests.cpp:<line number>:
|
||||
PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#748 - captures with unexpected exceptions
|
||||
outside assertions
|
||||
@@ -299,6 +308,6 @@ with expansion:
|
||||
!true
|
||||
|
||||
===============================================================================
|
||||
test cases: 11 | 8 passed | 1 failed | 2 failed as expected
|
||||
assertions: 34 | 27 passed | 4 failed | 3 failed as expected
|
||||
test cases: 12 | 9 passed | 1 failed | 2 failed as expected
|
||||
assertions: 35 | 28 passed | 4 failed | 3 failed as expected
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuitesloose text artifact
|
||||
>
|
||||
<testsuite name="<exe-name>" errors="15" failures="106" tests="1011" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<testsuite name="<exe-name>" errors="17" failures="105" tests="1022" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="#1027" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="#1147" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="#1175 - Hidden Test" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}">
|
||||
<error type="TEST_CASE">
|
||||
expected exception
|
||||
@@ -545,11 +546,7 @@ Matchers.tests.cpp:<line number>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/Empty string" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/From string literal" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/From string literal/c_str() does not cause copy" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/From sub-string" time="{duration}">
|
||||
<failure message="false" type="REQUIRE">
|
||||
String.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/From sub-string" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/Substrings/zero-based substring" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/Substrings/c_str() causes copy" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="StringRef/Substrings/non-zero-based substring" time="{duration}"/>
|
||||
@@ -584,6 +581,12 @@ Misc.tests.cpp:<line number>
|
||||
<testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="The NO_FAIL macro reports a failure but does not fail the test" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="This test 'should' fail but doesn't" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="Thrown string literals are translated" time="{duration}">
|
||||
<error type="TEST_CASE">
|
||||
For some reason someone is throwing a string literal!
|
||||
Exception.tests.cpp:<line number>
|
||||
</error>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="Tracker" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="Tracker/successfully close one section" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="Tracker/fail one section" time="{duration}"/>
|
||||
@@ -819,17 +822,24 @@ Message.tests.cpp:<line number>
|
||||
Tricky.tests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="stringify ranges" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( has_maker )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( has_maker_and_toString )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( has_maker_and_operator )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( has_neither )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( has_operator )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( vectors<has_maker> )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( vectors<has_maker_and_operator> )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="stringify( vectors<has_operator> )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="thrown std::strings are translated" time="{duration}">
|
||||
<error type="TEST_CASE">
|
||||
Why would you throw a std::string?
|
||||
Exception.tests.cpp:<line number>
|
||||
</error>
|
||||
</testcase>
|
||||
<testcase classname="<exe-name>.global" name="toString on const wchar_t const pointer returns the string contents" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString on const wchar_t pointer returns the string contents" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString on wchar_t const pointer returns the string contents" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString on wchar_t returns the string contents" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString streamable range" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString( vectors<has_maker> )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString( vectors<has_maker_and_operator> )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString( vectors<has_operator> )" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString(enum class w/operator<<)" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString(enum class)" time="{duration}"/>
|
||||
<testcase classname="<exe-name>.global" name="toString(enum w/operator<<)" time="{duration}"/>
|
||||
|
@@ -93,6 +93,9 @@
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="#1175 - Hidden Test" tags="[.]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
<Section name="outside assertions" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
<Info>
|
||||
@@ -2118,7 +2121,7 @@
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
std::nextafter(1., 2.), WithinULP(1., 1)
|
||||
nextafter(1., 2.), WithinULP(1., 1)
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0 is within 1 ULPs of 1.0
|
||||
@@ -2126,7 +2129,7 @@
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
std::nextafter(1., 0.), WithinULP(1., 1)
|
||||
nextafter(1., 0.), WithinULP(1., 1)
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0 is within 1 ULPs of 1.0
|
||||
@@ -2134,7 +2137,7 @@
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
std::nextafter(1., 2.), !WithinULP(1., 0)
|
||||
nextafter(1., 2.), !WithinULP(1., 0)
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0 not is within 0 ULPs of 1.0
|
||||
@@ -2293,7 +2296,7 @@
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
std::nextafter(1.f, 2.f), WithinULP(1.f, 1)
|
||||
nextafter(1.f, 2.f), WithinULP(1.f, 1)
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0f is within 1 ULPs of 1.0f
|
||||
@@ -2301,7 +2304,7 @@
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
std::nextafter(1.f, 0.f), WithinULP(1.f, 1)
|
||||
nextafter(1.f, 0.f), WithinULP(1.f, 1)
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0f is within 1 ULPs of 1.0f
|
||||
@@ -2309,7 +2312,7 @@
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
std::nextafter(1.f, 2.f), !WithinULP(1.f, 0)
|
||||
nextafter(1.f, 2.f), !WithinULP(1.f, 0)
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0f not is within 0 ULPs of 1.0f
|
||||
@@ -4624,7 +4627,15 @@
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="6" failures="0" expectedFailures="0"/>
|
||||
<Expression success="true" type="CHECK_FALSE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
!(cfg.hasTestFilters())
|
||||
</Original>
|
||||
<Expanded>
|
||||
!false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="7" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="test lists" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Section name="1 test" description="Specify one test case using" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
@@ -4636,6 +4647,14 @@
|
||||
{?}
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cfg.hasTestFilters()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cfg.testSpec().matches(fakeTestCase("notIncluded")) == false
|
||||
@@ -4652,9 +4671,9 @@
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="test lists" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Section name="Specify one test case exclusion using exclude:" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
@@ -4666,6 +4685,14 @@
|
||||
{?}
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cfg.hasTestFilters()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cfg.testSpec().matches(fakeTestCase("test1")) == false
|
||||
@@ -4682,9 +4709,9 @@
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="test lists" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Section name="Specify one test case exclusion using ~" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
@@ -4696,6 +4723,14 @@
|
||||
{?}
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cfg.hasTestFilters()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Original>
|
||||
cfg.testSpec().matches(fakeTestCase("test1")) == false
|
||||
@@ -4712,9 +4747,9 @@
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="reporter" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
<Section name="-r/console" filename="projects/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
|
||||
@@ -5681,15 +5716,39 @@ Message from section two
|
||||
original == "original"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="false" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
isSubstring( original )
|
||||
</Original>
|
||||
<Expanded>
|
||||
false
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="1" expectedFailures="0"/>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
isOwned( original ) == false
|
||||
</Original>
|
||||
<Expanded>
|
||||
false == false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
isSubstring( original ) == false
|
||||
</Original>
|
||||
<Expanded>
|
||||
false == false
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
isOwned( original )
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="5" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Section name="zero-based substring" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
@@ -5749,7 +5808,7 @@ Message from section two
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
rawChars == data( s )
|
||||
rawChars == s.currentData()
|
||||
</Original>
|
||||
<Expanded>
|
||||
"hello world!" == "hello world!"
|
||||
@@ -5781,7 +5840,7 @@ Message from section two
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
data( ss ) != data( s )
|
||||
ss.currentData() != s.currentData()
|
||||
</Original>
|
||||
<Expanded>
|
||||
"hello" != "hello world!"
|
||||
@@ -6019,7 +6078,7 @@ Message from section two
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResult success="false"/>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
|
||||
@@ -6215,6 +6274,12 @@ Message from section two
|
||||
<TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<OverallResult success="false"/>
|
||||
</TestCase>
|
||||
<TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
<Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
For some reason someone is throwing a string literal!
|
||||
</Exception>
|
||||
<OverallResult success="false"/>
|
||||
</TestCase>
|
||||
<TestCase name="Tracker" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" >
|
||||
<Original>
|
||||
@@ -8694,6 +8759,45 @@ loose text artifact
|
||||
</Expression>
|
||||
<OverallResult success="false"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify ranges" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"op<<(streamable_range)"
|
||||
==
|
||||
"op<<(streamable_range)"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"stringmaker(streamable_range)"
|
||||
==
|
||||
"stringmaker(streamable_range)"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(disabled_range{}) == "{ !!! }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ !!! }" == "{ !!! }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify( has_maker )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
@@ -8707,7 +8811,7 @@ loose text artifact
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify( has_maker_and_toString )" tags="[.][toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<TestCase name="stringify( has_maker_and_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>"
|
||||
@@ -8720,6 +8824,17 @@ loose text artifact
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify( has_neither )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(item) == "{ !!! }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ !!! }" == "{ !!! }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify( has_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
@@ -8733,6 +8848,51 @@ loose text artifact
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify( vectors<has_maker> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ StringMaker<has_maker> }"
|
||||
==
|
||||
"{ StringMaker<has_maker> }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify( vectors<has_maker_and_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
==
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="stringify( vectors<has_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ operator<<( has_operator ) }"
|
||||
==
|
||||
"{ operator<<( has_operator ) }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="thrown std::strings are translated" tags="[!throws][.][failing]" filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
<Exception filename="projects/<exe-name>/UsageTests/Exception.tests.cpp" >
|
||||
Why would you throw a std::string?
|
||||
</Exception>
|
||||
<OverallResult success="false"/>
|
||||
</TestCase>
|
||||
<TestCase name="toString on const wchar_t const pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<Original>
|
||||
@@ -8777,84 +8937,6 @@ loose text artifact
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="toString streamable range" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"op<<(streamable_range)"
|
||||
==
|
||||
"op<<(streamable_range)"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"stringmaker(streamable_range)"
|
||||
==
|
||||
"stringmaker(streamable_range)"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify(disabled_range{}) == "{?}"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{?}" == "{?}"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="toString( vectors<has_maker> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ StringMaker<has_maker> }"
|
||||
==
|
||||
"{ StringMaker<has_maker> }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="toString( vectors<has_maker_and_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
==
|
||||
"{ StringMaker<has_maker_and_operator> }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="toString( vectors<has_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
|
||||
<Original>
|
||||
::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"{ operator<<( has_operator ) }"
|
||||
==
|
||||
"{ operator<<( has_operator ) }"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<TestCase name="toString(enum class w/operator<<)" tags="[enum][enumClass][toString]" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
|
||||
<Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/EnumToString.tests.cpp" >
|
||||
<Original>
|
||||
@@ -9323,7 +9405,7 @@ loose text artifact
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<OverallResults successes="869" failures="121" expectedFailures="21"/>
|
||||
<OverallResults successes="879" failures="122" expectedFailures="21"/>
|
||||
</Group>
|
||||
<OverallResults successes="869" failures="120" expectedFailures="21"/>
|
||||
<OverallResults successes="879" failures="121" expectedFailures="21"/>
|
||||
</Catch>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
# pragma clang diagnostic ignored "-Wc++98-compat"
|
||||
#endif
|
||||
|
||||
inline Catch::TestCase fakeTestCase( const char* name, const char* desc = "" ){ return Catch::makeTestCase( nullptr, "", name, desc, CATCH_INTERNAL_LINEINFO ); }
|
||||
inline Catch::TestCase fakeTestCase(const char* name, const char* desc = "") { return Catch::makeTestCase(nullptr, "", { name, desc }, CATCH_INTERNAL_LINEINFO); }
|
||||
|
||||
TEST_CASE( "Parse test names and tags" ) {
|
||||
|
||||
@@ -289,6 +289,9 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
|
||||
CHECK(config.abortAfter == -1);
|
||||
CHECK(config.noThrow == false);
|
||||
CHECK(config.reporterNames.empty());
|
||||
|
||||
Catch::Config cfg(config);
|
||||
CHECK_FALSE(cfg.hasTestFilters());
|
||||
}
|
||||
|
||||
SECTION("test lists") {
|
||||
@@ -297,6 +300,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
|
||||
CHECK(result);
|
||||
|
||||
Catch::Config cfg(config);
|
||||
REQUIRE(cfg.hasTestFilters());
|
||||
REQUIRE(cfg.testSpec().matches(fakeTestCase("notIncluded")) == false);
|
||||
REQUIRE(cfg.testSpec().matches(fakeTestCase("test1")));
|
||||
}
|
||||
@@ -305,6 +309,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
|
||||
CHECK(result);
|
||||
|
||||
Catch::Config cfg(config);
|
||||
REQUIRE(cfg.hasTestFilters());
|
||||
REQUIRE(cfg.testSpec().matches(fakeTestCase("test1")) == false);
|
||||
REQUIRE(cfg.testSpec().matches(fakeTestCase("alwaysIncluded")));
|
||||
}
|
||||
@@ -314,6 +319,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
|
||||
CHECK(result);
|
||||
|
||||
Catch::Config cfg(config);
|
||||
REQUIRE(cfg.hasTestFilters());
|
||||
REQUIRE(cfg.testSpec().matches(fakeTestCase("test1")) == false);
|
||||
REQUIRE(cfg.testSpec().matches(fakeTestCase("alwaysIncluded")));
|
||||
}
|
||||
|
@@ -14,9 +14,6 @@ namespace Catch {
|
||||
static auto isSubstring( StringRef const& stringRef ) -> bool {
|
||||
return stringRef.isSubstring();
|
||||
}
|
||||
static auto data( StringRef const& stringRef ) -> char const* {
|
||||
return stringRef.data();
|
||||
}
|
||||
};
|
||||
|
||||
auto isOwned( StringRef const& stringRef ) -> bool {
|
||||
@@ -25,14 +22,11 @@ namespace Catch {
|
||||
auto isSubstring( StringRef const& stringRef ) -> bool {
|
||||
return StringRefTestAccess::isSubstring( stringRef );
|
||||
}
|
||||
auto data( StringRef const& stringRef ) -> char const* {
|
||||
return StringRefTestAccess::data( stringRef );
|
||||
}
|
||||
} // namespace Catch2
|
||||
|
||||
namespace Catch {
|
||||
inline auto toString( Catch::StringRef const& stringRef ) -> std::string {
|
||||
return std::string( data( stringRef ), stringRef.size() );
|
||||
return std::string( stringRef.currentData(), stringRef.size() );
|
||||
}
|
||||
} // namespace Catch
|
||||
|
||||
@@ -53,7 +47,7 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
|
||||
REQUIRE( s.size() == 5 );
|
||||
REQUIRE( isSubstring( s ) == false );
|
||||
|
||||
auto rawChars = data( s );
|
||||
auto rawChars = s.currentData();
|
||||
REQUIRE( std::strcmp( rawChars, "hello" ) == 0 );
|
||||
|
||||
SECTION( "c_str() does not cause copy" ) {
|
||||
@@ -74,7 +68,6 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
|
||||
|
||||
REQUIRE( isSubstring( original ) == false );
|
||||
REQUIRE( isOwned( original ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -92,14 +85,14 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
|
||||
REQUIRE( isSubstring( ss ) );
|
||||
REQUIRE( isOwned( ss ) == false );
|
||||
|
||||
auto rawChars = data( ss );
|
||||
REQUIRE( rawChars == data( s ) ); // same pointer value
|
||||
auto rawChars = ss.currentData();
|
||||
REQUIRE( rawChars == s.currentData() ); // same pointer value
|
||||
REQUIRE( ss.c_str() != rawChars );
|
||||
|
||||
REQUIRE( isSubstring( ss ) == false );
|
||||
REQUIRE( isOwned( ss ) );
|
||||
|
||||
REQUIRE( data( ss ) != data( s ) ); // different pointer value
|
||||
REQUIRE( ss.currentData() != s.currentData() ); // different pointer value
|
||||
}
|
||||
|
||||
SECTION( "non-zero-based substring") {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4702) // Unreachable code -- uncoditional throws and so on
|
||||
#pragma warning(disable:4702) // Unreachable code -- unconditional throws and so on
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
@@ -154,6 +154,15 @@ TEST_CASE( "Unexpected exceptions can be translated", "[.][failing][!throws]" )
|
||||
throw double( 3.14 );
|
||||
}
|
||||
|
||||
TEST_CASE("Thrown string literals are translated", "[.][failing][!throws]") {
|
||||
throw "For some reason someone is throwing a string literal!";
|
||||
}
|
||||
|
||||
TEST_CASE("thrown std::strings are translated", "[.][failing][!throws]") {
|
||||
throw std::string{ "Why would you throw a std::string?" };
|
||||
}
|
||||
|
||||
|
||||
#ifndef CATCH_CONFIG_DISABLE_MATCHERS
|
||||
|
||||
TEST_CASE( "Exception messages can be tested for", "[!throws]" ) {
|
||||
|
@@ -77,6 +77,20 @@ namespace { namespace MatchersTests {
|
||||
|
||||
using namespace Catch::Matchers;
|
||||
|
||||
#ifdef __DJGPP__
|
||||
float nextafter(float from, float to)
|
||||
{
|
||||
return ::nextafterf(from, to);
|
||||
}
|
||||
|
||||
double nextafter(double from, double to)
|
||||
{
|
||||
return ::nextafter(from, to);
|
||||
}
|
||||
#else
|
||||
using std::nextafter;
|
||||
#endif
|
||||
|
||||
TEST_CASE("String matchers", "[matchers]") {
|
||||
REQUIRE_THAT(testStringForMatching(), Contains("string"));
|
||||
REQUIRE_THAT(testStringForMatching(), Contains("string", Catch::CaseSensitive::No));
|
||||
@@ -130,12 +144,16 @@ namespace { namespace MatchersTests {
|
||||
(defined(_GLIBCXX_RELEASE) && \
|
||||
_GLIBCXX_RELEASE > 4))))
|
||||
|
||||
// DJGPP meets the above condition but <regex> does not work properly anyway
|
||||
#ifndef __DJGPP__
|
||||
REQUIRE_THAT(testStringForMatching(), Matches("this string contains 'abc' as a substring"));
|
||||
REQUIRE_THAT(testStringForMatching(),
|
||||
Matches("this string CONTAINS 'abc' as a substring", Catch::CaseSensitive::No));
|
||||
REQUIRE_THAT(testStringForMatching(), Matches("^this string contains 'abc' as a substring$"));
|
||||
REQUIRE_THAT(testStringForMatching(), Matches("^.* 'abc' .*$"));
|
||||
REQUIRE_THAT(testStringForMatching(), Matches("^.* 'ABC' .*$", Catch::CaseSensitive::No));
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
REQUIRE_THAT(testStringForMatching2(), !Matches("this string contains 'abc' as a substring"));
|
||||
@@ -307,9 +325,9 @@ namespace { namespace MatchersTests {
|
||||
SECTION("ULPs") {
|
||||
REQUIRE_THAT(1.f, WithinULP(1.f, 0));
|
||||
|
||||
REQUIRE_THAT(std::nextafter(1.f, 2.f), WithinULP(1.f, 1));
|
||||
REQUIRE_THAT(std::nextafter(1.f, 0.f), WithinULP(1.f, 1));
|
||||
REQUIRE_THAT(std::nextafter(1.f, 2.f), !WithinULP(1.f, 0));
|
||||
REQUIRE_THAT(nextafter(1.f, 2.f), WithinULP(1.f, 1));
|
||||
REQUIRE_THAT(nextafter(1.f, 0.f), WithinULP(1.f, 1));
|
||||
REQUIRE_THAT(nextafter(1.f, 2.f), !WithinULP(1.f, 0));
|
||||
|
||||
REQUIRE_THAT(1.f, WithinULP(1.f, 0));
|
||||
REQUIRE_THAT(-0.f, WithinULP(0.f, 0));
|
||||
@@ -344,9 +362,9 @@ namespace { namespace MatchersTests {
|
||||
SECTION("ULPs") {
|
||||
REQUIRE_THAT(1., WithinULP(1., 0));
|
||||
|
||||
REQUIRE_THAT(std::nextafter(1., 2.), WithinULP(1., 1));
|
||||
REQUIRE_THAT(std::nextafter(1., 0.), WithinULP(1., 1));
|
||||
REQUIRE_THAT(std::nextafter(1., 2.), !WithinULP(1., 0));
|
||||
REQUIRE_THAT(nextafter(1., 2.), WithinULP(1., 1));
|
||||
REQUIRE_THAT(nextafter(1., 0.), WithinULP(1., 1));
|
||||
REQUIRE_THAT(nextafter(1., 2.), !WithinULP(1., 0));
|
||||
|
||||
REQUIRE_THAT(1., WithinULP(1., 0));
|
||||
REQUIRE_THAT(-0., WithinULP(0., 0));
|
||||
|
@@ -290,6 +290,7 @@ TEST_CASE( "Tabs and newlines show in output", "[.][whitespace][failing]" ) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
TEST_CASE( "toString on const wchar_t const pointer returns the string contents", "[toString]" ) {
|
||||
const wchar_t * const s = L"wide load";
|
||||
std::string result = ::Catch::Detail::stringify( s );
|
||||
@@ -313,6 +314,7 @@ TEST_CASE( "toString on wchar_t returns the string contents", "[toString]" ) {
|
||||
std::string result = ::Catch::Detail::stringify( s );
|
||||
CHECK( result == "\"wide load\"" );
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_CASE( "long long" ) {
|
||||
long long l = std::numeric_limits<long long>::max();
|
||||
@@ -348,4 +350,9 @@ TEST_CASE( "#961 -- Dynamically created sections should all be reported", "[.]"
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "#1175 - Hidden Test", "[.]" ) {
|
||||
// Just for checking that hidden test is not listed by default
|
||||
SUCCEED();
|
||||
}
|
||||
|
||||
}} // namespace MiscTests
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
||||
// vedctor
|
||||
// vector
|
||||
TEST_CASE( "vector<int> -> toString", "[toString][vector]" )
|
||||
{
|
||||
std::vector<int> vv;
|
||||
|
@@ -1,13 +1,25 @@
|
||||
#include "catch.hpp"
|
||||
/*
|
||||
Demonstrate which version of toString/StringMaker is being used
|
||||
for various types
|
||||
*/
|
||||
* Demonstrate which version of toString/StringMaker is being used
|
||||
* for various types
|
||||
*/
|
||||
|
||||
// Replace fallback stringifier for this TU
|
||||
// We should avoid ODR violations because these specific types aren't
|
||||
// present in different TUs
|
||||
#include <string>
|
||||
template <typename T>
|
||||
std::string fallbackStringifier(T const&) {
|
||||
return "{ !!! }";
|
||||
}
|
||||
|
||||
#define CATCH_CONFIG_FALLBACK_STRINGIFIER fallbackStringifier
|
||||
#include "catch.hpp"
|
||||
|
||||
|
||||
struct has_operator { };
|
||||
struct has_maker {};
|
||||
struct has_maker_and_operator {};
|
||||
struct has_neither {};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const has_operator&) {
|
||||
os << "operator<<( has_operator )";
|
||||
@@ -47,33 +59,35 @@ TEST_CASE( "stringify( has_maker )", "[toString]" ) {
|
||||
}
|
||||
|
||||
// Call the stringmaker
|
||||
TEST_CASE( "stringify( has_maker_and_toString )", "[.][toString]" ) {
|
||||
TEST_CASE( "stringify( has_maker_and_operator )", "[toString]" ) {
|
||||
has_maker_and_operator item;
|
||||
REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" );
|
||||
}
|
||||
|
||||
TEST_CASE("stringify( has_neither )", "[toString]") {
|
||||
has_neither item;
|
||||
REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" );
|
||||
}
|
||||
|
||||
|
||||
// Vectors...
|
||||
|
||||
// Don't run this in approval tests as it is sensitive to two phase lookup differences
|
||||
TEST_CASE( "toString( vectors<has_operator> )", "[toString]" ) {
|
||||
TEST_CASE( "stringify( vectors<has_operator> )", "[toString]" ) {
|
||||
std::vector<has_operator> v(1);
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" );
|
||||
}
|
||||
|
||||
TEST_CASE( "toString( vectors<has_maker> )", "[toString]" ) {
|
||||
TEST_CASE( "stringify( vectors<has_maker> )", "[toString]" ) {
|
||||
std::vector<has_maker> v(1);
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" );
|
||||
}
|
||||
|
||||
|
||||
// Don't run this in approval tests as it is sensitive to two phase lookup differences
|
||||
TEST_CASE( "toString( vectors<has_maker_and_operator> )", "[toString]" ) {
|
||||
TEST_CASE( "stringify( vectors<has_maker_and_operator> )", "[toString]" ) {
|
||||
std::vector<has_maker_and_operator> v(1);
|
||||
REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" );
|
||||
}
|
||||
|
||||
// Conversion should go
|
||||
// StringMaker specialization, operator<<, range/enum detection, unprintable
|
||||
// Range-based conversion should only be used if other possibilities fail
|
||||
struct int_iterator {
|
||||
using iterator_category = std::input_iterator_tag;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
@@ -138,9 +152,9 @@ struct is_range<disabled_range> {
|
||||
};
|
||||
}
|
||||
|
||||
TEST_CASE("toString streamable range", "[toString]") {
|
||||
TEST_CASE("stringify ranges", "[toString]") {
|
||||
REQUIRE(::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)");
|
||||
REQUIRE(::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)");
|
||||
REQUIRE(::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }");
|
||||
REQUIRE(::Catch::Detail::stringify(disabled_range{}) == "{?}");
|
||||
REQUIRE(::Catch::Detail::stringify(disabled_range{}) == "{ !!! }");
|
||||
}
|
||||
|
@@ -61,9 +61,9 @@ FILE_2 description
|
||||
.\" .Sh DIAGNOSTICS \" May not be needed
|
||||
.\" .Bl -diag
|
||||
.\" .It Diagnostic Tag
|
||||
.\" Diagnostic informtion here.
|
||||
.\" Diagnostic information here.
|
||||
.\" .It Diagnostic Tag
|
||||
.\" Diagnostic informtion here.
|
||||
.\" Diagnostic information here.
|
||||
.\" .El
|
||||
.Sh SEE ALSO
|
||||
.\" List links in ascending order by section, alphabetically within a section.
|
||||
|
@@ -127,7 +127,7 @@ def tagAndCollect(lines, id_tag=True, back_links=False, exclude_h=None):
|
||||
A list of 3-value sublists, where the first value
|
||||
represents the heading, the second value the string
|
||||
that was inserted assigned to the IDs in the anchor tags,
|
||||
and the third value is an integer that reprents the headline level.
|
||||
and the third value is an integer that represents the headline level.
|
||||
E.g.,
|
||||
[['some header lvl3', 'some-header-lvl3', 3], ...]
|
||||
|
||||
@@ -282,7 +282,7 @@ def markdownToclify(
|
||||
input_file: str
|
||||
Path to the markdown input file.
|
||||
|
||||
output_file: str (defaul: None)
|
||||
output_file: str (default: None)
|
||||
Path to the markdown output file.
|
||||
|
||||
min_toc_len: int (default: 2)
|
||||
@@ -420,7 +420,7 @@ def updateDocumentToCMain():
|
||||
default=minTocEntries,
|
||||
type=int,
|
||||
metavar='N',
|
||||
help='the minimum number of entries to create a table of contents for [{deflt}]'.format(deflt=minTocEntries))
|
||||
help='the minimum number of entries to create a table of contents for [{default}]'.format(default=minTocEntries))
|
||||
|
||||
parser.add_argument(
|
||||
'--remove-toc',
|
||||
|
@@ -89,7 +89,7 @@ def git_push(path_to_repo):
|
||||
# Make sure we branch off master
|
||||
subprocess.call('git checkout master', shell=True)
|
||||
|
||||
# Update repo to current master, so we don't work off old version of the portsfile
|
||||
# Update repo to current master, so we don't work off old version of the portfile
|
||||
subprocess.call('git pull Microsoft master', shell=True)
|
||||
subprocess.call('git push', shell=True)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Catch v2.1.2
|
||||
* Generated: 2018-02-09 17:05:21.506253
|
||||
* Catch v2.2.0
|
||||
* Generated: 2018-03-07 10:56:32.217228
|
||||
* ----------------------------------------------------------
|
||||
* This file has been merged from multiple headers. Please don't edit it directly
|
||||
* Copyright (c) 2018 Two Blue Cubes Ltd. All rights reserved.
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
|
||||
#define CATCH_VERSION_MAJOR 2
|
||||
#define CATCH_VERSION_MINOR 1
|
||||
#define CATCH_VERSION_PATCH 2
|
||||
#define CATCH_VERSION_MINOR 2
|
||||
#define CATCH_VERSION_PATCH 0
|
||||
|
||||
#ifdef __clang__
|
||||
# pragma clang system_header
|
||||
@@ -147,14 +147,16 @@ namespace Catch {
|
||||
|
||||
#endif // __clang__
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Assume that non-Windows platforms support posix signals by default
|
||||
#if !defined(CATCH_PLATFORM_WINDOWS)
|
||||
#define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// We know some environments not to support full POSIX signals
|
||||
#if defined(__CYGWIN__) || defined(__QNX__)
|
||||
|
||||
# if !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
|
||||
# endif
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
|
||||
#define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
|
||||
#endif
|
||||
|
||||
#ifdef __OS400__
|
||||
@@ -192,6 +194,13 @@ namespace Catch {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// DJGPP
|
||||
#ifdef __DJGPP__
|
||||
# define CATCH_INTERNAL_CONFIG_NO_WCHAR
|
||||
#endif // __DJGPP__
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Use of __COUNTER__ is suppressed during code analysis in
|
||||
// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly
|
||||
// handled by it.
|
||||
@@ -208,11 +217,15 @@ namespace Catch {
|
||||
# define CATCH_CONFIG_WINDOWS_SEH
|
||||
#endif
|
||||
// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
|
||||
#if !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
# define CATCH_CONFIG_POSIX_SIGNALS
|
||||
#endif
|
||||
// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions.
|
||||
#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR)
|
||||
# define CATCH_CONFIG_WCHAR
|
||||
#endif
|
||||
|
||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_INTERNAL_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
@@ -443,16 +456,20 @@ namespace Catch {
|
||||
public: // substrings and searches
|
||||
auto substr( size_type start, size_type size ) const noexcept -> StringRef;
|
||||
|
||||
// Returns the current start pointer.
|
||||
// Note that the pointer can change when if the StringRef is a substring
|
||||
auto currentData() const noexcept -> char const*;
|
||||
|
||||
private: // ownership queries - may not be consistent between calls
|
||||
auto isOwned() const noexcept -> bool;
|
||||
auto isSubstring() const noexcept -> bool;
|
||||
auto data() const noexcept -> char const*;
|
||||
};
|
||||
|
||||
auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> std::string;
|
||||
auto operator + ( StringRef const& lhs, char const* rhs ) -> std::string;
|
||||
auto operator + ( char const* lhs, StringRef const& rhs ) -> std::string;
|
||||
|
||||
auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
|
||||
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
||||
|
||||
inline auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
@@ -484,13 +501,13 @@ auto makeTestInvoker( void (C::*testAsMethod)() ) noexcept -> ITestInvoker* {
|
||||
}
|
||||
|
||||
struct NameAndTags {
|
||||
NameAndTags( StringRef name_ = StringRef(), StringRef tags_ = StringRef() ) noexcept;
|
||||
NameAndTags( StringRef const& name_ = StringRef(), StringRef const& tags_ = StringRef() ) noexcept;
|
||||
StringRef name;
|
||||
StringRef tags;
|
||||
};
|
||||
|
||||
struct AutoReg : NonCopyable {
|
||||
AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept;
|
||||
AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept;
|
||||
~AutoReg();
|
||||
};
|
||||
|
||||
@@ -753,8 +770,13 @@ namespace Catch {
|
||||
std::string convertUnknownEnumToString( E e );
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<!std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& ) {
|
||||
typename std::enable_if<!std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& value ) {
|
||||
#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
|
||||
(void)value;
|
||||
return Detail::unprintableString;
|
||||
#else
|
||||
return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
|
||||
#endif
|
||||
}
|
||||
template<typename T>
|
||||
typename std::enable_if<std::is_enum<T>::value, std::string>::type convertUnstreamable( T const& value ) {
|
||||
@@ -805,10 +827,12 @@ namespace Catch {
|
||||
struct StringMaker<std::string> {
|
||||
static std::string convert(const std::string& str);
|
||||
};
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
template<>
|
||||
struct StringMaker<std::wstring> {
|
||||
static std::string convert(const std::wstring& wstr);
|
||||
};
|
||||
#endif
|
||||
|
||||
template<>
|
||||
struct StringMaker<char const *> {
|
||||
@@ -818,6 +842,7 @@ namespace Catch {
|
||||
struct StringMaker<char *> {
|
||||
static std::string convert(char * str);
|
||||
};
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
template<>
|
||||
struct StringMaker<wchar_t const *> {
|
||||
static std::string convert(wchar_t const * str);
|
||||
@@ -826,6 +851,7 @@ namespace Catch {
|
||||
struct StringMaker<wchar_t *> {
|
||||
static std::string convert(wchar_t * str);
|
||||
};
|
||||
#endif
|
||||
|
||||
template<int SZ>
|
||||
struct StringMaker<char[SZ]> {
|
||||
@@ -1739,6 +1765,7 @@ namespace Catch {
|
||||
|
||||
Totals delta( Totals const& prevTotals ) const;
|
||||
|
||||
int error = 0;
|
||||
Counts assertions;
|
||||
Counts testCases;
|
||||
};
|
||||
@@ -2696,7 +2723,7 @@ namespace Catch {
|
||||
class TestCase : public TestCaseInfo {
|
||||
public:
|
||||
|
||||
TestCase( ITestInvoker* testCase, TestCaseInfo const& info );
|
||||
TestCase( ITestInvoker* testCase, TestCaseInfo&& info );
|
||||
|
||||
TestCase withName( std::string const& _newName ) const;
|
||||
|
||||
@@ -2713,8 +2740,7 @@ namespace Catch {
|
||||
|
||||
TestCase makeTestCase( ITestInvoker* testCase,
|
||||
std::string const& className,
|
||||
std::string const& name,
|
||||
std::string const& description,
|
||||
NameAndTags const& nameAndTags,
|
||||
SourceLineInfo const& lineInfo );
|
||||
}
|
||||
|
||||
@@ -3144,7 +3170,8 @@ namespace Catch {
|
||||
|
||||
struct WarnAbout { enum What {
|
||||
Nothing = 0x00,
|
||||
NoAssertions = 0x01
|
||||
NoAssertions = 0x01,
|
||||
NoTests = 0x02
|
||||
}; };
|
||||
|
||||
struct ShowDurations { enum OrNot {
|
||||
@@ -3181,10 +3208,12 @@ namespace Catch {
|
||||
virtual bool includeSuccessfulResults() const = 0;
|
||||
virtual bool shouldDebugBreak() const = 0;
|
||||
virtual bool warnAboutMissingAssertions() const = 0;
|
||||
virtual bool warnAboutNoTests() const = 0;
|
||||
virtual int abortAfter() const = 0;
|
||||
virtual bool showInvisibles() const = 0;
|
||||
virtual ShowDurations::OrNot showDurations() const = 0;
|
||||
virtual TestSpec const& testSpec() const = 0;
|
||||
virtual bool hasTestFilters() const = 0;
|
||||
virtual RunTests::InWhatOrder runOrder() const = 0;
|
||||
virtual unsigned int rngSeed() const = 0;
|
||||
virtual int benchmarkResolutionMultiple() const = 0;
|
||||
@@ -3262,9 +3291,11 @@ namespace Catch {
|
||||
std::string getProcessName() const;
|
||||
|
||||
std::vector<std::string> const& getReporterNames() const;
|
||||
std::vector<std::string> const& getTestsOrTags() const;
|
||||
std::vector<std::string> const& getSectionsToRun() const override;
|
||||
|
||||
virtual TestSpec const& testSpec() const override;
|
||||
bool hasTestFilters() const override;
|
||||
|
||||
bool showHelp() const;
|
||||
|
||||
@@ -3274,6 +3305,7 @@ namespace Catch {
|
||||
std::string name() const override;
|
||||
bool includeSuccessfulResults() const override;
|
||||
bool warnAboutMissingAssertions() const override;
|
||||
bool warnAboutNoTests() const override;
|
||||
ShowDurations::OrNot showDurations() const override;
|
||||
RunTests::InWhatOrder runOrder() const override;
|
||||
unsigned int rngSeed() const override;
|
||||
@@ -3291,6 +3323,7 @@ namespace Catch {
|
||||
|
||||
std::unique_ptr<IStream const> m_stream;
|
||||
TestSpec m_testSpec;
|
||||
bool m_hasTestFilters = false;
|
||||
};
|
||||
|
||||
} // end namespace Catch
|
||||
@@ -4638,9 +4671,6 @@ namespace Catch {
|
||||
|
||||
// start catch_fatal_condition.h
|
||||
|
||||
#include <string>
|
||||
|
||||
#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
|
||||
// start catch_windows_h_proxy.h
|
||||
|
||||
|
||||
@@ -4671,16 +4701,7 @@ namespace Catch {
|
||||
#endif // defined(CATCH_PLATFORM_WINDOWS)
|
||||
|
||||
// end catch_windows_h_proxy.h
|
||||
|
||||
# if !defined ( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
void reset();
|
||||
};
|
||||
}
|
||||
|
||||
# else // CATCH_CONFIG_WINDOWS_SEH is defined
|
||||
#if defined( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@@ -4699,19 +4720,7 @@ namespace Catch {
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_WINDOWS_SEH
|
||||
|
||||
#else // Not Windows - assumed to be POSIX compatible //////////////////////////
|
||||
|
||||
# if !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
|
||||
namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
void reset();
|
||||
};
|
||||
}
|
||||
|
||||
# else // CATCH_CONFIG_POSIX_SIGNALS is defined
|
||||
#elif defined ( CATCH_CONFIG_POSIX_SIGNALS )
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
@@ -4720,7 +4729,7 @@ namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
|
||||
static bool isSet;
|
||||
static struct sigaction oldSigActions[];// [sizeof(signalDefs) / sizeof(SignalDefs)];
|
||||
static struct sigaction oldSigActions[];
|
||||
static stack_t oldSigStack;
|
||||
static char altStackMem[];
|
||||
|
||||
@@ -4733,9 +4742,15 @@ namespace Catch {
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_POSIX_SIGNALS
|
||||
#else
|
||||
|
||||
#endif // not Windows
|
||||
namespace Catch {
|
||||
struct FatalConditionHandler {
|
||||
void reset();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// end catch_fatal_condition.h
|
||||
#include <string>
|
||||
@@ -5016,9 +5031,9 @@ namespace Catch {
|
||||
expr = m_info.capturedExpression;
|
||||
else {
|
||||
expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
|
||||
expr += m_info.macroName.c_str();
|
||||
expr += m_info.macroName;
|
||||
expr += "( ";
|
||||
expr += m_info.capturedExpression.c_str();
|
||||
expr += m_info.capturedExpression;
|
||||
expr += " )";
|
||||
}
|
||||
return expr;
|
||||
@@ -5081,7 +5096,7 @@ namespace Catch {
|
||||
using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
|
||||
|
||||
// This is the general overload that takes a any string matcher
|
||||
// There is another overload, in catch_assertinhandler.h/.cpp, that only takes a string and infers
|
||||
// There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
|
||||
// the Equals matcher (so the header does not mention matchers)
|
||||
void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) {
|
||||
std::string exceptionMessage = Catch::translateActiveException();
|
||||
@@ -5119,7 +5134,7 @@ namespace Catch {
|
||||
//
|
||||
// See https://github.com/philsquared/Clara for more details
|
||||
|
||||
// Clara v1.1.2
|
||||
// Clara v1.1.3
|
||||
|
||||
|
||||
#ifndef CATCH_CLARA_CONFIG_CONSOLE_WIDTH
|
||||
@@ -5130,6 +5145,14 @@ namespace Catch {
|
||||
#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CLARA_CONFIG_CONSOLE_WIDTH
|
||||
#endif
|
||||
|
||||
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
|
||||
#ifdef __has_include
|
||||
#if __has_include(<optional>) && __cplusplus >= 201703L
|
||||
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ----------- #included from clara_textflow.hpp -----------
|
||||
|
||||
// TextFlowCpp
|
||||
@@ -5495,11 +5518,9 @@ namespace detail {
|
||||
std::vector<std::string> m_args;
|
||||
|
||||
public:
|
||||
Args( int argc, char *argv[] ) {
|
||||
m_exeName = argv[0];
|
||||
for( int i = 1; i < argc; ++i )
|
||||
m_args.push_back( argv[i] );
|
||||
}
|
||||
Args( int argc, char const* const* argv )
|
||||
: m_exeName(argv[0]),
|
||||
m_args(argv + 1, argv + argc) {}
|
||||
|
||||
Args( std::initializer_list<std::string> args )
|
||||
: m_exeName( *args.begin() ),
|
||||
@@ -5685,15 +5706,13 @@ namespace detail {
|
||||
|
||||
protected:
|
||||
void enforceOk() const override {
|
||||
// !TBD: If no exceptions, std::terminate here or something
|
||||
switch( m_type ) {
|
||||
case ResultBase::LogicError:
|
||||
throw std::logic_error( m_errorMessage );
|
||||
case ResultBase::RuntimeError:
|
||||
throw std::runtime_error( m_errorMessage );
|
||||
case ResultBase::Ok:
|
||||
break;
|
||||
}
|
||||
|
||||
// Errors shouldn't reach this point, but if they do
|
||||
// the actual error message will be in m_errorMessage
|
||||
assert( m_type != ResultBase::LogicError );
|
||||
assert( m_type != ResultBase::RuntimeError );
|
||||
if( m_type != ResultBase::Ok )
|
||||
std::abort();
|
||||
}
|
||||
|
||||
std::string m_errorMessage; // Only populated if resultType is an error
|
||||
@@ -5763,6 +5782,16 @@ namespace detail {
|
||||
return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
|
||||
return ParserResult::ok( ParseResultType::Matched );
|
||||
}
|
||||
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
||||
template<typename T>
|
||||
inline auto convertInto( std::string const &source, std::optional<T>& target ) -> ParserResult {
|
||||
T temp;
|
||||
auto result = convertInto( source, temp );
|
||||
if( result )
|
||||
target = temp;
|
||||
return result;
|
||||
}
|
||||
#endif // CLARA_CONFIG_OPTIONAL_TYPE
|
||||
|
||||
struct NonCopyable {
|
||||
NonCopyable() = default;
|
||||
@@ -6366,9 +6395,19 @@ namespace Catch {
|
||||
using namespace clara;
|
||||
|
||||
auto const setWarning = [&]( std::string const& warning ) {
|
||||
if( warning != "NoAssertions" )
|
||||
auto warningSet = [&]() {
|
||||
if( warning == "NoAssertions" )
|
||||
return WarnAbout::NoAssertions;
|
||||
|
||||
if ( warning == "NoTests" )
|
||||
return WarnAbout::NoTests;
|
||||
|
||||
return WarnAbout::Nothing;
|
||||
}();
|
||||
|
||||
if (warningSet == WarnAbout::Nothing)
|
||||
return ParserResult::runtimeError( "Unrecognised warning: '" + warning + "'" );
|
||||
config.warnings = static_cast<WarnAbout::What>( config.warnings | WarnAbout::NoAssertions );
|
||||
config.warnings = static_cast<WarnAbout::What>( config.warnings | warningSet );
|
||||
return ParserResult::ok( ParseResultType::Matched );
|
||||
};
|
||||
auto const loadTestNamesFromFile = [&]( std::string const& filename ) {
|
||||
@@ -6569,10 +6608,9 @@ namespace Catch {
|
||||
// start catch_enforce.h
|
||||
|
||||
#include <stdexcept>
|
||||
#include <iosfwd>
|
||||
|
||||
#define CATCH_PREPARE_EXCEPTION( type, msg ) \
|
||||
type( static_cast<std::ostringstream&&>( Catch::ReusableStringStream().get() << msg ).str() )
|
||||
type( ( Catch::ReusableStringStream() << msg ).str() )
|
||||
#define CATCH_INTERNAL_ERROR( msg ) \
|
||||
throw CATCH_PREPARE_EXCEPTION( std::logic_error, CATCH_INTERNAL_LINEINFO << ": Internal Catch error: " << msg);
|
||||
#define CATCH_ERROR( msg ) \
|
||||
@@ -6587,12 +6625,16 @@ namespace Catch {
|
||||
: m_data( data ),
|
||||
m_stream( openStream() )
|
||||
{
|
||||
if( !data.testsOrTags.empty() ) {
|
||||
TestSpecParser parser( ITagAliasRegistry::get() );
|
||||
TestSpecParser parser(ITagAliasRegistry::get());
|
||||
if (data.testsOrTags.empty()) {
|
||||
parser.parse("~[.]"); // All not hidden tests
|
||||
}
|
||||
else {
|
||||
m_hasTestFilters = true;
|
||||
for( auto const& testOrTags : data.testsOrTags )
|
||||
parser.parse( testOrTags );
|
||||
m_testSpec = parser.testSpec();
|
||||
}
|
||||
m_testSpec = parser.testSpec();
|
||||
}
|
||||
|
||||
std::string const& Config::getFilename() const {
|
||||
@@ -6607,9 +6649,11 @@ namespace Catch {
|
||||
std::string Config::getProcessName() const { return m_data.processName; }
|
||||
|
||||
std::vector<std::string> const& Config::getReporterNames() const { return m_data.reporterNames; }
|
||||
std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
|
||||
std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
|
||||
|
||||
TestSpec const& Config::testSpec() const { return m_testSpec; }
|
||||
bool Config::hasTestFilters() const { return m_hasTestFilters; }
|
||||
|
||||
bool Config::showHelp() const { return m_data.showHelp; }
|
||||
|
||||
@@ -6618,7 +6662,8 @@ namespace Catch {
|
||||
std::ostream& Config::stream() const { return m_stream->stream(); }
|
||||
std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
|
||||
bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
|
||||
bool Config::warnAboutMissingAssertions() const { return m_data.warnings & WarnAbout::NoAssertions; }
|
||||
bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
|
||||
bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
|
||||
ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
|
||||
RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
|
||||
unsigned int Config::rngSeed() const { return m_data.rngSeed; }
|
||||
@@ -6802,7 +6847,12 @@ namespace {
|
||||
#ifdef CATCH_PLATFORM_MAC
|
||||
!isDebuggerActive() &&
|
||||
#endif
|
||||
isatty(STDOUT_FILENO);
|
||||
#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
|
||||
isatty(STDOUT_FILENO)
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
;
|
||||
}
|
||||
IColourImpl* platformColourInstance() {
|
||||
ErrnoGuard guard;
|
||||
@@ -6936,13 +6986,16 @@ namespace Catch {
|
||||
::OutputDebugStringA( text.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
namespace Catch {
|
||||
void writeToDebugConsole( std::string const& text ) {
|
||||
// !TBD: Need a version for Mac/ XCode and other IDEs
|
||||
Catch::cout() << text;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // Platform
|
||||
// end catch_debug_console.cpp
|
||||
// start catch_debugger.cpp
|
||||
@@ -7165,24 +7218,18 @@ namespace Catch {
|
||||
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
#endif
|
||||
|
||||
#if (defined(CATCH_PLATFORM_WINDOWS) && defined(CATCH_CONFIG_WINDOWS_SEH)) || defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
#if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS )
|
||||
|
||||
namespace {
|
||||
// Report the error condition
|
||||
void reportFatal( char const * const message ) {
|
||||
Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
|
||||
#endif // signals/SEH handling
|
||||
|
||||
# if !defined ( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
void FatalConditionHandler::reset() {}
|
||||
}
|
||||
|
||||
# else // CATCH_CONFIG_WINDOWS_SEH is defined
|
||||
#if defined( CATCH_CONFIG_WINDOWS_SEH )
|
||||
|
||||
namespace Catch {
|
||||
struct SignalDefs { DWORD id; const char* name; };
|
||||
@@ -7222,7 +7269,6 @@ namespace Catch {
|
||||
|
||||
void FatalConditionHandler::reset() {
|
||||
if (isSet) {
|
||||
// Unregister handler and restore the old guarantee
|
||||
RemoveVectoredExceptionHandler(exceptionHandlerHandle);
|
||||
SetThreadStackGuarantee(&guaranteeSize);
|
||||
exceptionHandlerHandle = nullptr;
|
||||
@@ -7240,19 +7286,7 @@ PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr;
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_WINDOWS_SEH
|
||||
|
||||
#else // Not Windows - assumed to be POSIX compatible //////////////////////////
|
||||
|
||||
# if !defined(CATCH_CONFIG_POSIX_SIGNALS)
|
||||
|
||||
namespace Catch {
|
||||
void FatalConditionHandler::reset() {}
|
||||
}
|
||||
|
||||
# else // CATCH_CONFIG_POSIX_SIGNALS is defined
|
||||
|
||||
#include <signal.h>
|
||||
#elif defined( CATCH_CONFIG_POSIX_SIGNALS )
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@@ -7321,9 +7355,13 @@ namespace Catch {
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
# endif // CATCH_CONFIG_POSIX_SIGNALS
|
||||
#else
|
||||
|
||||
#endif // not Windows
|
||||
namespace Catch {
|
||||
void FatalConditionHandler::reset() {}
|
||||
}
|
||||
|
||||
#endif // signals/SEH handling
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# pragma GCC diagnostic pop
|
||||
@@ -7605,11 +7643,10 @@ namespace Catch {
|
||||
|
||||
std::size_t listTests( Config const& config ) {
|
||||
TestSpec testSpec = config.testSpec();
|
||||
if( config.testSpec().hasFilters() )
|
||||
if( config.hasTestFilters() )
|
||||
Catch::cout() << "Matching test cases:\n";
|
||||
else {
|
||||
Catch::cout() << "All available test cases:\n";
|
||||
testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
|
||||
}
|
||||
|
||||
auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
|
||||
@@ -7631,7 +7668,7 @@ namespace Catch {
|
||||
Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
|
||||
}
|
||||
|
||||
if( !config.testSpec().hasFilters() )
|
||||
if( !config.hasTestFilters() )
|
||||
Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
|
||||
else
|
||||
Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
|
||||
@@ -7640,8 +7677,6 @@ namespace Catch {
|
||||
|
||||
std::size_t listTestsNamesOnly( Config const& config ) {
|
||||
TestSpec testSpec = config.testSpec();
|
||||
if( !config.testSpec().hasFilters() )
|
||||
testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
|
||||
std::size_t matchedTests = 0;
|
||||
std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
|
||||
for( auto const& testCaseInfo : matchedTestCases ) {
|
||||
@@ -7671,11 +7706,10 @@ namespace Catch {
|
||||
|
||||
std::size_t listTags( Config const& config ) {
|
||||
TestSpec testSpec = config.testSpec();
|
||||
if( config.testSpec().hasFilters() )
|
||||
if( config.hasTestFilters() )
|
||||
Catch::cout() << "Tags for matching test cases:\n";
|
||||
else {
|
||||
Catch::cout() << "All available tags:\n";
|
||||
testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
|
||||
}
|
||||
|
||||
std::map<std::string, TagInfo> tagCounts;
|
||||
@@ -8151,7 +8185,7 @@ namespace Catch {
|
||||
void invoke() const override;
|
||||
};
|
||||
|
||||
std::string extractClassName( std::string const& classOrQualifiedMethodName );
|
||||
std::string extractClassName( StringRef const& classOrQualifiedMethodName );
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -8422,7 +8456,7 @@ namespace Catch {
|
||||
m_context(getCurrentMutableContext()),
|
||||
m_config(_config),
|
||||
m_reporter(std::move(reporter)),
|
||||
m_lastAssertionInfo{ "", SourceLineInfo("",0), "", ResultDisposition::Normal },
|
||||
m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
|
||||
m_includeSuccessfulResults( m_config->includeSuccessfulResults() )
|
||||
{
|
||||
m_context.setRunner(this);
|
||||
@@ -8449,7 +8483,7 @@ namespace Catch {
|
||||
std::string redirectedCout;
|
||||
std::string redirectedCerr;
|
||||
|
||||
TestCaseInfo testInfo = testCase.getTestCaseInfo();
|
||||
auto const& testInfo = testCase.getTestCaseInfo();
|
||||
|
||||
m_reporter->testCaseStarting(testInfo);
|
||||
|
||||
@@ -8656,7 +8690,7 @@ namespace Catch {
|
||||
Counts prevAssertions = m_totals.assertions;
|
||||
double duration = 0;
|
||||
m_shouldReportUnexpected = true;
|
||||
m_lastAssertionInfo = { "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal };
|
||||
m_lastAssertionInfo = { "TEST_CASE"_sr, testCaseInfo.lineInfo, StringRef(), ResultDisposition::Normal };
|
||||
|
||||
seedRng(*m_config);
|
||||
|
||||
@@ -8891,12 +8925,12 @@ namespace Catch {
|
||||
void showHelp() const;
|
||||
void libIdentify();
|
||||
|
||||
int applyCommandLine( int argc, char* argv[] );
|
||||
int applyCommandLine( int argc, char const * const * argv );
|
||||
|
||||
void useConfigData( ConfigData const& configData );
|
||||
|
||||
int run( int argc, char* argv[] );
|
||||
#if defined(WIN32) && defined(UNICODE)
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE)
|
||||
int run( int argc, wchar_t* const argv[] );
|
||||
#endif
|
||||
int run();
|
||||
@@ -8997,8 +9031,6 @@ namespace Catch {
|
||||
context.testGroupStarting(config->name(), 1, 1);
|
||||
|
||||
TestSpec testSpec = config->testSpec();
|
||||
if (!testSpec.hasFilters())
|
||||
testSpec = TestSpecParser(ITagAliasRegistry::get()).parse("~[.]").testSpec(); // All not hidden tests
|
||||
|
||||
auto const& allTestCases = getAllTestCasesSorted(*config);
|
||||
for (auto const& testCase : allTestCases) {
|
||||
@@ -9008,6 +9040,20 @@ namespace Catch {
|
||||
context.reporter().skipTest(testCase);
|
||||
}
|
||||
|
||||
if (config->warnAboutNoTests() && totals.testCases.total() == 0) {
|
||||
ReusableStringStream testConfig;
|
||||
|
||||
bool first = true;
|
||||
for (const auto& input : config->getTestsOrTags()) {
|
||||
if (!first) { testConfig << ' '; }
|
||||
first = false;
|
||||
testConfig << input;
|
||||
}
|
||||
|
||||
context.reporter().noMatchingTestCases(testConfig.str());
|
||||
totals.error = -1;
|
||||
}
|
||||
|
||||
context.testGroupEnded(config->name(), totals, 1, 1);
|
||||
return totals;
|
||||
}
|
||||
@@ -9047,7 +9093,7 @@ namespace Catch {
|
||||
if ( !exceptions.empty() ) {
|
||||
m_startupExceptions = true;
|
||||
Colour colourGuard( Colour::Red );
|
||||
Catch::cerr() << "Errors occured during startup!" << '\n';
|
||||
Catch::cerr() << "Errors occurred during startup!" << '\n';
|
||||
// iterate over all exceptions and notify user
|
||||
for ( const auto& ex_ptr : exceptions ) {
|
||||
try {
|
||||
@@ -9079,7 +9125,7 @@ namespace Catch {
|
||||
<< std::left << std::setw(16) << "version: " << libraryVersion() << std::endl;
|
||||
}
|
||||
|
||||
int Session::applyCommandLine( int argc, char* argv[] ) {
|
||||
int Session::applyCommandLine( int argc, char const * const * argv ) {
|
||||
if( m_startupExceptions )
|
||||
return 1;
|
||||
|
||||
@@ -9116,7 +9162,7 @@ namespace Catch {
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
#if defined(WIN32) && defined(UNICODE)
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE)
|
||||
int Session::run( int argc, wchar_t* const argv[] ) {
|
||||
|
||||
char **utf8Argv = new char *[ argc ];
|
||||
@@ -9187,10 +9233,11 @@ namespace Catch {
|
||||
if( Option<std::size_t> listed = list( config() ) )
|
||||
return static_cast<int>( *listed );
|
||||
|
||||
auto totals = runTests( m_config );
|
||||
// Note that on unices only the lower 8 bits are usually used, clamping
|
||||
// the return value to 255 prevents false negative when some multiple
|
||||
// of 256 tests has failed
|
||||
return (std::min)( MaxExitCode, static_cast<int>( runTests( m_config ).assertions.failed ) );
|
||||
return (std::min)( { MaxExitCode, totals.error, static_cast<int>( totals.assertions.failed ) } );
|
||||
}
|
||||
catch( std::exception& ex ) {
|
||||
Catch::cerr() << ex.what() << std::endl;
|
||||
@@ -9525,7 +9572,7 @@ namespace Catch {
|
||||
const_cast<StringRef*>( this )->takeOwnership();
|
||||
return m_start;
|
||||
}
|
||||
auto StringRef::data() const noexcept -> char const* {
|
||||
auto StringRef::currentData() const noexcept -> char const* {
|
||||
return m_start;
|
||||
}
|
||||
|
||||
@@ -9594,7 +9641,12 @@ namespace Catch {
|
||||
}
|
||||
|
||||
auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
|
||||
return os << str.c_str();
|
||||
return os.write(str.currentData(), str.size());
|
||||
}
|
||||
|
||||
auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& {
|
||||
lhs.append(rhs.currentData(), rhs.size());
|
||||
return lhs;
|
||||
}
|
||||
|
||||
} // namespace Catch
|
||||
@@ -9709,8 +9761,7 @@ namespace Catch {
|
||||
|
||||
TestCase makeTestCase( ITestInvoker* _testCase,
|
||||
std::string const& _className,
|
||||
std::string const& _name,
|
||||
std::string const& _descOrTags,
|
||||
NameAndTags const& nameAndTags,
|
||||
SourceLineInfo const& _lineInfo )
|
||||
{
|
||||
bool isHidden = false;
|
||||
@@ -9719,6 +9770,7 @@ namespace Catch {
|
||||
std::vector<std::string> tags;
|
||||
std::string desc, tag;
|
||||
bool inTag = false;
|
||||
std::string _descOrTags = nameAndTags.tags;
|
||||
for (char c : _descOrTags) {
|
||||
if( !inTag ) {
|
||||
if( c == '[' )
|
||||
@@ -9746,8 +9798,8 @@ namespace Catch {
|
||||
tags.push_back( "." );
|
||||
}
|
||||
|
||||
TestCaseInfo info( _name, _className, desc, tags, _lineInfo );
|
||||
return TestCase( _testCase, info );
|
||||
TestCaseInfo info( nameAndTags.name, _className, desc, tags, _lineInfo );
|
||||
return TestCase( _testCase, std::move(info) );
|
||||
}
|
||||
|
||||
void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
|
||||
@@ -9807,7 +9859,7 @@ namespace Catch {
|
||||
return ret;
|
||||
}
|
||||
|
||||
TestCase::TestCase( ITestInvoker* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {}
|
||||
TestCase::TestCase( ITestInvoker* testCase, TestCaseInfo&& info ) : TestCaseInfo( std::move(info) ), test( testCase ) {}
|
||||
|
||||
TestCase TestCase::withName( std::string const& _newName ) const {
|
||||
TestCase other( *this );
|
||||
@@ -9918,7 +9970,7 @@ namespace Catch {
|
||||
m_testAsFunction();
|
||||
}
|
||||
|
||||
std::string extractClassName( std::string const& classOrQualifiedMethodName ) {
|
||||
std::string extractClassName( StringRef const& classOrQualifiedMethodName ) {
|
||||
std::string className = classOrQualifiedMethodName;
|
||||
if( startsWith( className, '&' ) )
|
||||
{
|
||||
@@ -10215,17 +10267,16 @@ namespace Catch {
|
||||
return new(std::nothrow) TestInvokerAsFunction( testAsFunction );
|
||||
}
|
||||
|
||||
NameAndTags::NameAndTags( StringRef name_ , StringRef tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
|
||||
NameAndTags::NameAndTags( StringRef const& name_ , StringRef const& tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
|
||||
|
||||
AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept {
|
||||
AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept {
|
||||
try {
|
||||
getMutableRegistryHub()
|
||||
.registerTest(
|
||||
makeTestCase(
|
||||
invoker,
|
||||
extractClassName( classOrMethod ),
|
||||
nameAndTags.name,
|
||||
nameAndTags.tags,
|
||||
nameAndTags,
|
||||
lineInfo));
|
||||
} catch (...) {
|
||||
// Do not throw when constructing global objects, instead register the exception to be processed later
|
||||
@@ -10529,6 +10580,7 @@ std::string StringMaker<std::string>::convert(const std::string& str) {
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
|
||||
std::string s;
|
||||
s.reserve(wstr.size());
|
||||
@@ -10537,6 +10589,7 @@ std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
|
||||
}
|
||||
return ::Catch::Detail::stringify(s);
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string StringMaker<char const*>::convert(char const* str) {
|
||||
if (str) {
|
||||
@@ -10552,6 +10605,7 @@ std::string StringMaker<char*>::convert(char* str) {
|
||||
return{ "{null string}" };
|
||||
}
|
||||
}
|
||||
#ifdef CATCH_CONFIG_WCHAR
|
||||
std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
|
||||
if (str) {
|
||||
return ::Catch::Detail::stringify(std::wstring{ str });
|
||||
@@ -10566,6 +10620,7 @@ std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
|
||||
return{ "{null string}" };
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string StringMaker<int>::convert(int value) {
|
||||
return ::Catch::Detail::stringify(static_cast<long long>(value));
|
||||
@@ -10751,7 +10806,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
Version const& libraryVersion() {
|
||||
static Version version( 2, 1, 2, "", 0 );
|
||||
static Version version( 2, 2, 0, "", 0 );
|
||||
return version;
|
||||
}
|
||||
|
||||
@@ -12485,7 +12540,7 @@ namespace Catch {
|
||||
|
||||
#ifndef __OBJC__
|
||||
|
||||
#if defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
||||
#if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
||||
// Standard C/C++ Win32 Unicode wmain entry point
|
||||
extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
||||
#else
|
||||
|
@@ -26,7 +26,7 @@ namespace Catch {
|
||||
~TAPReporter() override;
|
||||
|
||||
static std::string getDescription() {
|
||||
return "Reports test results in TAP format, suitable for test harneses";
|
||||
return "Reports test results in TAP format, suitable for test harnesses";
|
||||
}
|
||||
|
||||
ReporterPreferences getPreferences() const override {
|
||||
|
@@ -10,7 +10,7 @@ class CatchConanTest(ConanFile):
|
||||
settings = "os", "compiler", "arch", "build_type"
|
||||
username = getenv("CONAN_USERNAME", "philsquared")
|
||||
channel = getenv("CONAN_CHANNEL", "testing")
|
||||
requires = "Catch/2.1.2@%s/%s" % (username, channel)
|
||||
requires = "Catch/2.2.0@%s/%s" % (username, channel)
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
|
45
third_party/clara.hpp
vendored
45
third_party/clara.hpp
vendored
@@ -5,7 +5,7 @@
|
||||
//
|
||||
// See https://github.com/philsquared/Clara for more details
|
||||
|
||||
// Clara v1.1.2
|
||||
// Clara v1.1.3
|
||||
|
||||
#ifndef CLARA_HPP_INCLUDED
|
||||
#define CLARA_HPP_INCLUDED
|
||||
@@ -18,6 +18,15 @@
|
||||
#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH
|
||||
#endif
|
||||
|
||||
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
|
||||
#ifdef __has_include
|
||||
#if __has_include(<optional>) && __cplusplus >= 201703L
|
||||
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// ----------- #included from clara_textflow.hpp -----------
|
||||
|
||||
// TextFlowCpp
|
||||
@@ -389,11 +398,9 @@ namespace detail {
|
||||
std::vector<std::string> m_args;
|
||||
|
||||
public:
|
||||
Args( int argc, char *argv[] ) {
|
||||
m_exeName = argv[0];
|
||||
for( int i = 1; i < argc; ++i )
|
||||
m_args.push_back( argv[i] );
|
||||
}
|
||||
Args( int argc, char const* const* argv )
|
||||
: m_exeName(argv[0]),
|
||||
m_args(argv + 1, argv + argc) {}
|
||||
|
||||
Args( std::initializer_list<std::string> args )
|
||||
: m_exeName( *args.begin() ),
|
||||
@@ -580,15 +587,13 @@ namespace detail {
|
||||
|
||||
protected:
|
||||
void enforceOk() const override {
|
||||
// !TBD: If no exceptions, std::terminate here or something
|
||||
switch( m_type ) {
|
||||
case ResultBase::LogicError:
|
||||
throw std::logic_error( m_errorMessage );
|
||||
case ResultBase::RuntimeError:
|
||||
throw std::runtime_error( m_errorMessage );
|
||||
case ResultBase::Ok:
|
||||
break;
|
||||
}
|
||||
|
||||
// Errors shouldn't reach this point, but if they do
|
||||
// the actual error message will be in m_errorMessage
|
||||
assert( m_type != ResultBase::LogicError );
|
||||
assert( m_type != ResultBase::RuntimeError );
|
||||
if( m_type != ResultBase::Ok )
|
||||
std::abort();
|
||||
}
|
||||
|
||||
std::string m_errorMessage; // Only populated if resultType is an error
|
||||
@@ -658,6 +663,16 @@ namespace detail {
|
||||
return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
|
||||
return ParserResult::ok( ParseResultType::Matched );
|
||||
}
|
||||
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
||||
template<typename T>
|
||||
inline auto convertInto( std::string const &source, std::optional<T>& target ) -> ParserResult {
|
||||
T temp;
|
||||
auto result = convertInto( source, temp );
|
||||
if( result )
|
||||
target = temp;
|
||||
return result;
|
||||
}
|
||||
#endif // CLARA_CONFIG_OPTIONAL_TYPE
|
||||
|
||||
struct NonCopyable {
|
||||
NonCopyable() = default;
|
||||
|
Reference in New Issue
Block a user