Showing preview only (1,040K chars total). Download the full file or copy to clipboard to get everything.
Repository: hrantzsch/keychain
Branch: master
Commit: 8cad2bdd0073
Files: 14
Total size: 1013.2 KB
Directory structure:
gitextract_bkhq94ol/
├── .clang-format
├── .github/
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── include/
│ └── keychain/
│ └── keychain.h
├── src/
│ ├── keychain_linux.cpp
│ ├── keychain_mac.cpp
│ └── keychain_win.cpp
└── test/
├── CMakeLists.txt
├── catch_amalgamated.cpp
├── catch_amalgamated.hpp
└── tests.cpp
================================================
FILE CONTENTS
================================================
================================================
FILE: .clang-format
================================================
BasedOnStyle: LLVM
IndentWidth: 4
BinPackArguments: false
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 4 * * 0'
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check formatting
run: clang-format --dry-run --Werror include/keychain/*.h src/*.cpp
test:
needs: format
runs-on: ${{ matrix.os.image }}
strategy:
matrix:
include:
- { os: { image: ubuntu-22.04 } }
- { os: { image: ubuntu-24.04 } }
- { os: { image: macos-14 } }
- { os: { image: macos-15 } }
- { os: { image: windows-2022, generator: "Visual Studio 17 2022" }, config: Debug }
- { os: { image: windows-2022, generator: "Visual Studio 17 2022" }, config: Release }
- { os: { image: windows-2025, generator: "Visual Studio 17 2022" }, config: Debug }
- { os: { image: windows-2025, generator: "Visual Studio 17 2022" }, config: Release }
steps:
- uses: actions/checkout@v6
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install dbus-x11 dbus gnome-keyring libsecret-1-dev
- name: Run cmake (Unix)
if: runner.os != 'Windows'
run: cmake . -DBUILD_TESTS=yes -DSIMULATE_FAILURES=yes -DCMAKE_BUILD_TYPE=Release
- name: Run cmake (Windows)
if: runner.os == 'Windows'
run: cmake -G "${{ matrix.os.generator }}" . -DBUILD_TESTS=yes
- name: Build and run tests (Linux)
if: runner.os == 'Linux'
run: |
eval $(DISPLAY=:99.0 dbus-launch --sh-syntax)
echo "somepassword" | gnome-keyring-daemon -r -d --unlock
cmake --build . --target test
- name: Build and run tests (macOS)
if: runner.os == 'macOS'
run: cmake --build . --target test
- name: Build and run tests (Windows)
if: runner.os == 'Windows'
run: cmake --build . --target test --config ${{ matrix.config }}
coverage:
needs: format
permissions:
checks: write
runs-on: ${{ matrix.os.image }}
strategy:
matrix:
os:
- { image: ubuntu-24.04 }
- { image: macos-15 }
steps:
- uses: actions/checkout@v6
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install dbus-x11 dbus gnome-keyring libsecret-1-dev
- name: Install gcovr
run: pip install gcovr==8.6
- name: Run cmake
run: cmake . -DBUILD_TESTS=yes -DCODE_COVERAGE=yes -DSIMULATE_FAILURES=yes -DCMAKE_BUILD_TYPE=Debug
- name: Build and run tests (Linux)
if: runner.os == 'Linux'
run: |
eval $(DISPLAY=:99.0 dbus-launch --sh-syntax)
echo "somepassword" | gnome-keyring-daemon -r -d --unlock
cmake --build . --target test
- name: Build and run tests (macOS)
if: runner.os == 'macOS'
run: cmake --build . --target test
- name: Generate coverage report
run: |
gcovr -r . -f "src/" --markdown -o coverage.md
gcovr -r . -f "src/" --json-summary-pretty -o coverage-summary.json
- name: Coverage summary
env:
IMAGE: ${{ matrix.os.image }}
run: |
echo "## Coverage ($IMAGE)" >> $GITHUB_STEP_SUMMARY
cat coverage.md >> $GITHUB_STEP_SUMMARY
- name: Coverage check
if: github.event_name == 'pull_request'
uses: actions/github-script@v8
env:
IMAGE: ${{ matrix.os.image }}
with:
script: |
const fs = require('fs');
const summary = fs.readFileSync('coverage.md', 'utf8');
const stats = JSON.parse(fs.readFileSync('coverage-summary.json', 'utf8'));
const linePct = stats.line_percent.toFixed(1);
const image = process.env.IMAGE;
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: context.sha,
name: `Coverage (${image})`,
status: 'completed',
conclusion: 'success',
output: {
title: `${linePct}% line coverage`,
summary: summary,
},
});
================================================
FILE: .gitignore
================================================
_build/*
build/*
compile_commands.json
tags
.vscode
keychain.sublime-project
keychain.sublime-workspace
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.12.4)
project(keychain)
option(BUILD_TESTS "Build tests for ${PROJECT_NAME}" OFF)
option(SIMULATE_FAILURES "Enable simulated failures in tests for ${PROJECT_NAME}" OFF)
add_library(${PROJECT_NAME})
target_include_directories(${PROJECT_NAME}
PUBLIC
"include"
PRIVATE
"src"
"include/keychain")
set_target_properties(${PROJECT_NAME}
PROPERTIES PUBLIC_HEADER "include/keychain/keychain.h")
target_compile_features(${PROJECT_NAME}
PUBLIC
cxx_std_14)
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/W2 /WX>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -pedantic -Werror>)
if (WIN32)
target_compile_definitions(${PROJECT_NAME}
PUBLIC
-DKEYCHAIN_WINDOWS=1)
target_sources(${PROJECT_NAME}
PRIVATE
"src/keychain_win.cpp")
target_link_libraries(${PROJECT_NAME}
PRIVATE
crypt32)
elseif (APPLE)
target_compile_definitions(${PROJECT_NAME}
PUBLIC
-DKEYCHAIN_MACOS=1)
target_sources(${PROJECT_NAME}
PRIVATE
"src/keychain_mac.cpp")
find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
find_library(SECURITY_LIBRARY Security REQUIRED)
target_link_libraries(${PROJECT_NAME}
PRIVATE
${COREFOUNDATION_LIBRARY}
${SECURITY_LIBRARY})
else () # assuming Linux
target_compile_definitions(${PROJECT_NAME}
PUBLIC
-DKEYCHAIN_LINUX=1)
target_sources(${PROJECT_NAME}
PRIVATE
"src/keychain_linux.cpp")
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB2 IMPORTED_TARGET glib-2.0)
pkg_check_modules(LIBSECRET IMPORTED_TARGET libsecret-1)
target_link_libraries(${PROJECT_NAME}
PRIVATE
PkgConfig::GLIB2
PkgConfig::LIBSECRET)
endif ()
# Code Coverage Configuration
option(CODE_COVERAGE "Enable coverage reporting" OFF)
if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(${PROJECT_NAME} PRIVATE --coverage -g -O0)
target_link_options(${PROJECT_NAME} PUBLIC --coverage)
endif ()
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/keychain)
if (BUILD_TESTS)
add_subdirectory("test")
if (SIMULATE_FAILURES)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
-DSIMULATE_FAILURES=1)
target_compile_definitions(${PROJECT_NAME}-test
PRIVATE
-DSIMULATE_FAILURES=1)
endif ()
endif ()
================================================
FILE: LICENSE
================================================
Copyright (c) 2019 Hannes Rantzsch, René Meusel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
# Keychain
[](https://github.com/hrantzsch/keychain/actions/workflows/ci.yml)
[](https://conan.io/center/recipes/keychain)
Keychain is a thin cross-platform wrapper to access the operating system's credential storage in C++.
Keychain supports getting, adding/replacing, and deleting passwords on macOS, Linux, and Windows.
On macOS the passwords are managed by the Keychain, on Linux they are managed by the Secret Service API/libsecret, and on Windows they are managed by Credential Vault.
## Usage
```cpp
#include <iostream>
#include <string>
#include "keychain.h"
int main() {
// used to indicate errors
keychain::Error error;
// used to identify the password in the OS credentials storage
const std::string package = "com.example.keychain-app";
const std::string service = "usage-example";
const std::string user = "Admin";
keychain::setPassword(package, service, user, "hunter2", error);
if (error) {
std::cout << error.message << std::endl;
return 1;
}
auto password = keychain::getPassword(package, service, user, error);
// check for specific kinds of errors
if (error.type == keychain::ErrorType::NotFound) {
std::cout << "Password not found." << std::endl;
return 1;
} else if (error) {
std::cout << error.message << std::endl;
return 1;
}
std::cout << "Password: " << password << std::endl;
keychain::deletePassword(package, service, user, error);
if (error) {
std::cout << error.message << std::endl;
return 1;
}
return 0;
}
```
## Installation
### Via Conan
Keychain is available in the [ConanCenter](https://conan.io/center/recipes/keychain) package repository.
If you're using Conan, simply add the desired version to your requirements.
### Building It Manually
After cloning the repository:
```
$ mkdir _build
$ cmake . -DBUILD_TESTS=yes -B _build
$ cmake --build _build --target test
# cmake --install _build
```
On Linux, Keychain depends on `libsecret`:
```
Debian/Ubuntu: sudo apt-get install libsecret-1-dev
Red Hat/CentOS/Fedora: sudo yum install libsecret-devel
Arch Linux: sudo pacman -Sy libsecret
```
## Security Considerations and General Remarks
Please read, or pretend to read, the considerations below carefully.
### Cross-Application Visibility
Neither on Windows nor on Linux any measures are taken to prevent other applications (of the same user) from accessing stored credentials.
MacOS associates an access control list with each Keychain item and prompts the user if an application that is not whitelisted tries to access the item.
However, this does not apply if the default Keychain is the iCloud Keychain.
### Automatic Login
All platforms encrypt stored passwords with the user's login credentials or (on Linux) with a specific password for the keyring.
Be aware that users can configure their login session or keyring to be unlocked automatically without requiring a password.
In this case **passwords will be stored unencrypted** in plaintext or in some otherwise recoverable format.
### Roaming on Windows
On Windows, persisted credentials are visible to all logon sessions of this same user on the same computer and to logon sessions for this user on other computers (via the _roaming user profile_).
Windows allows configuration of this behavior, but Keychain currently does not expose this functionality.
Please feel free to open an issue if you require this feature.
### Blocking Function Calls
Keychain uses synchronous functions of the OS APIs and does not provide any utilities to make these calls asynchronous.
As a result, all functions can easily be blocking—potentially indefinitely—for example if the OS prompts the user to unlock their credentials storage.
Please make sure not to call Keychain functions from your UI thread.
### Checking If a Password Exists
Keychain does not offer a `bool passwordExists(...)` function.
You can use `getPassword` and check if it returns a `NotFound` error.
This can be useful if you want to make sure that you don't override existing passwords.
## Credit
Keychain took a lot of inspiration from [atom/node-keytar](https://github.com/atom/node-keytar) and a variation of Keytar in [vslavik/poedit](https://github.com/vslavik/poedit/tree/master/src/keychain).
================================================
FILE: include/keychain/keychain.h
================================================
/*
* Copyright (c) 2019 Hannes Rantzsch, René Meusel
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef XPLATFORM_KEYCHAIN_WRAPPER_H_
#define XPLATFORM_KEYCHAIN_WRAPPER_H_
#include <string>
/*! \brief A thin wrapper to provide cross-platform access to the operating
* system's credentials storage.
*
* keychain provides the functions getPassword, setPassword, and deletePassword.
*
* All of these functions require three input parameters to identify the
* credential that should be retrieved or manipulated: `package`, `service`, and
* `user`. These identifiers will be mangled differently on each OS to
* correspond to the OS API.
* While none of the supported OSes has specific requirements to the format
* identifiers, the reverse domain name format is recommended for the `package`
* parameter in order to correspond with conventions.
*
* In addition, each function expects an instance of `keychain::Error` as an
* output parameter to indicate success or failure. Note that previous states of
* the Error are ignored and potentially overwritten.
*
* Also note that all three functions are blocking (potentially indefinitely)
* for example if the OS prompts the user to unlock their credentials storage.
*/
namespace keychain {
struct Error;
/*! \brief Retrieve a password
*
* \param package, service, user Used to identify the password to get
* \param err Output parameter communicating success or error details
*
* \return The password, if the function was successful
*/
std::string getPassword(const std::string &package, const std::string &service,
const std::string &user, Error &err);
/*! \brief Insert or update a password
*
* Existing passwords will be overwritten.
*
* \param package, service, user Used to identify the password to set
* \param password The new password
* \param err Output parameter communicating success or error details
*/
void setPassword(const std::string &package, const std::string &service,
const std::string &user, const std::string &password,
Error &err);
/*! \brief Insert or update a password
*
* Trying to delete a password that does not exist will result in a NotFound
* error.
*
* \param package, service, user Used to identify the password to delete
* \param err Output parameter communicating success or error details
*/
void deletePassword(const std::string &package, const std::string &service,
const std::string &user, Error &err);
/*! \brief Check if the keychain is available
*
* This function checks whether the platform's credential store is available
* and functional. On Linux and macOS, this probes the underlying service
* (SecretService or Keychain Services). On Windows, Credential Manager is
* a built-in OS component that is always available, so this is a no-op
* that always returns true.
*
* \param err Output parameter communicating success or error details
* \return true if the credential store is available, false otherwise
*/
bool isAvailable(Error &err);
enum class ErrorType {
// update CATCH_REGISTER_ENUM in tests.cpp when changing this
NoError = 0,
GenericError,
NotFound,
Unavailable,
// OS-specific errors
PasswordTooLong = 10, // Windows only
AccessDenied, // macOS only
};
/*! \brief A struct to collect error information
*
* An instance of this struct is used as an output parameter to indicate success
* or failure.
*/
struct Error {
Error() : type(ErrorType::NoError), code(0) {}
/*! \brief The type or reason of the error
*
* Note that some types of errors can only occur on certain platforms. In
* cases where a platform-specific error occurs on one platform, both
* NoError or some other (more generic) error might occur on others.
*/
ErrorType type;
/*! \brief A human-readable explanatory error message
*
* In most cases this message is obtained from the operating system.
*/
std::string message;
/*! \brief The "native" error code set by the operating system
*
* Even for the same type of error this value will differ across platforms.
*/
int code;
//! \brief Checks if the error type is not NoError
operator bool() const { return ErrorType::NoError != type; }
};
} // namespace keychain
#endif
================================================
FILE: src/keychain_linux.cpp
================================================
/*
* Copyright (c) 2013 GitHub Inc.
* Copyright (c) 2015-2019 Vaclav Slavik
* Copyright (c) 2019 Hannes Rantzsch, René Meusel
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "keychain.h"
#include <libsecret/secret.h>
namespace {
const char *ServiceFieldName = "service";
const char *AccountFieldName = "username";
// disable warnings about missing initializers in SecretSchema
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
SecretSchema makeSchema(const std::string &package) {
return SecretSchema{package.c_str(),
SECRET_SCHEMA_NONE,
{
{ServiceFieldName, SECRET_SCHEMA_ATTRIBUTE_STRING},
{AccountFieldName, SECRET_SCHEMA_ATTRIBUTE_STRING},
{NULL, SecretSchemaAttributeType(0)},
}};
}
std::string makeLabel(const std::string &service, const std::string &user) {
std::string label = service;
if (!user.empty()) {
label += " (" + user + ")";
}
return label;
}
void updateError(keychain::Error &err, GError *error) {
if (error == NULL) {
err = keychain::Error{};
return;
}
err.type = keychain::ErrorType::GenericError;
err.message = error->message;
err.code = error->code;
g_error_free(error);
}
void setErrorNotFound(keychain::Error &err) {
err.type = keychain::ErrorType::NotFound;
err.message = "Password not found.";
err.code = -1; // generic non-zero
}
} // namespace
namespace keychain {
void setPassword(const std::string &package, const std::string &service,
const std::string &user, const std::string &password,
Error &err) {
err = Error{};
const auto schema = makeSchema(package);
const auto label = makeLabel(service, user);
GError *error = NULL;
secret_password_store_sync(&schema,
SECRET_COLLECTION_DEFAULT,
label.c_str(),
password.c_str(),
NULL, // not cancellable
&error,
ServiceFieldName,
service.c_str(),
AccountFieldName,
user.c_str(),
NULL);
if (error != NULL) {
updateError(err, error);
}
}
std::string getPassword(const std::string &package, const std::string &service,
const std::string &user, Error &err) {
err = Error{};
const auto schema = makeSchema(package);
GError *error = NULL;
gchar *raw_passwords = secret_password_lookup_sync(&schema,
NULL, // not cancellable
&error,
ServiceFieldName,
service.c_str(),
AccountFieldName,
user.c_str(),
NULL);
std::string password;
if (error != NULL) {
updateError(err, error);
} else if (raw_passwords == NULL) {
// libsecret reports no error if the password was not found
setErrorNotFound(err);
} else {
password = raw_passwords;
secret_password_free(raw_passwords);
}
return password;
}
void deletePassword(const std::string &package, const std::string &service,
const std::string &user, Error &err) {
err = Error{};
const auto schema = makeSchema(package);
GError *error = NULL;
bool deleted = secret_password_clear_sync(&schema,
NULL, // not cancellable
&error,
ServiceFieldName,
service.c_str(),
AccountFieldName,
user.c_str(),
NULL);
if (error != NULL) {
updateError(err, error);
} else if (!deleted) {
// libsecret reports no error if the password did not exist
setErrorNotFound(err);
}
}
bool isAvailable(Error &err) {
err = Error{};
#ifdef SIMULATE_FAILURES
// TEST HOOK: Simulate failure to create SecretService
if (getenv("KEYCHAIN_TEST_SIMULATED_FAILURE")) {
err.type = ErrorType::Unavailable;
err.message = "Simulated failure: SecretService unavailable";
err.code = -1;
return false;
}
#endif
GError *error = NULL;
SecretService *svc =
secret_service_get_sync((SecretServiceFlags)0, NULL, &error);
if (error != NULL || svc == NULL) {
err.type = ErrorType::Unavailable;
err.message = error ? error->message : "SecretService unavailable";
err.code = error ? error->code : -1;
if (error)
g_error_free(error);
return false;
}
g_object_unref(svc);
return true;
}
} // namespace keychain
================================================
FILE: src/keychain_mac.cpp
================================================
/*
* Copyright (c) 2013 GitHub Inc.
* Copyright (c) 2019 Hannes Rantzsch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include <type_traits>
#include <vector>
#include <Security/Security.h>
#include "keychain.h"
namespace {
/*! \brief Converts a CFString to a std::string
*
* This either uses CFStringGetCStringPtr or (if that fails) CFStringGetCString.
*/
std::string CFStringToStdString(const CFStringRef cfstring) {
const char *ccstr = CFStringGetCStringPtr(cfstring, kCFStringEncodingUTF8);
if (ccstr != nullptr) {
return std::string(ccstr);
}
auto utf16Pairs = CFStringGetLength(cfstring);
auto maxUtf8Bytes =
CFStringGetMaximumSizeForEncoding(utf16Pairs, kCFStringEncodingUTF8);
std::vector<char> cstr(maxUtf8Bytes, '\0');
auto result = CFStringGetCString(
cfstring, cstr.data(), cstr.size(), kCFStringEncodingUTF8);
return result ? std::string(cstr.data()) : std::string();
}
//! \brief Extracts a human readable string from a status code
std::string errorStatusToString(OSStatus status) {
const auto errorMessage = SecCopyErrorMessageString(status, NULL);
std::string errorString;
if (errorMessage) {
errorString = CFStringToStdString(errorMessage);
CFRelease(errorMessage);
}
return errorString;
}
std::string makeServiceName(const std::string &package,
const std::string &service) {
return package + "." + service;
}
/*! \brief Update error information
*
* If status indicates an error condition, set message, code and error type.
* Otherwise, set err to success.
*/
void updateError(keychain::Error &err, OSStatus status) {
if (status == errSecSuccess) {
err = keychain::Error{};
return;
}
err.message = errorStatusToString(status);
err.code = status;
switch (status) {
case errSecItemNotFound:
err.type = keychain::ErrorType::NotFound;
break;
// potential errors in case the user needs to unlock the keychain first
case errSecUserCanceled: // user pressed the Cancel button
case errSecAuthFailed: // too many failed password attempts
case errSecInteractionRequired: // user interaction required but not allowed
err.type = keychain::ErrorType::AccessDenied;
break;
default:
err.type = keychain::ErrorType::GenericError;
}
}
void setGenericError(keychain::Error &err, const std::string &errorMessage) {
err = keychain::Error{};
err.message = errorMessage;
err.type = keychain::ErrorType::GenericError;
err.code = -1;
}
/*! \brief Helper to manage the lifetime of CF-Objects
*
* This helper will CFRelease the managed CF-Object when it goes out of scope.
* It assumes ownership of the managed object, so users should own the object in
* terms of the Core Foundation "Create Rule" when passing it to the
* ScopedCFRef. Consequently, the object should also not be released by anyone
* else, at least not without calling CFRetain first.
* */
template <typename T,
typename = typename std::enable_if<std::is_pointer<T>::value>::type>
class ScopedCFRef {
public:
explicit ScopedCFRef(T ref) : _ref(ref) {}
~ScopedCFRef() { _release(); }
ScopedCFRef(ScopedCFRef &&other) noexcept : _ref(other._ref) {
other._ref = nullptr;
}
ScopedCFRef &operator=(ScopedCFRef &&other) {
if (this != &other) {
_release();
_ref = other._ref;
other._ref = nullptr;
}
return *this;
}
ScopedCFRef(const ScopedCFRef &) = delete;
ScopedCFRef &operator=(const ScopedCFRef &) = delete;
const T get() const { return _ref; }
operator bool() const { return _ref != nullptr; }
private:
void _release() {
if (_ref != nullptr) {
CFRelease(_ref);
_ref = nullptr;
}
}
T _ref;
};
ScopedCFRef<CFStringRef> createCFStringWithCString(const std::string &str,
keychain::Error &err) {
auto result = ScopedCFRef<CFStringRef>(CFStringCreateWithCString(
kCFAllocatorDefault, str.c_str(), kCFStringEncodingUTF8));
if (!result)
setGenericError(err, "Failed to create CFString");
return result;
}
ScopedCFRef<CFMutableDictionaryRef>
createCFMutableDictionary(keychain::Error &err) {
auto result = ScopedCFRef<CFMutableDictionaryRef>(
CFDictionaryCreateMutable(kCFAllocatorDefault,
0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks));
if (!result)
setGenericError(err, "Failed to create CFMutableDictionary");
return result;
}
ScopedCFRef<CFDataRef> createCFData(const std::string &data,
keychain::Error &err) {
auto result = ScopedCFRef<CFDataRef>(
CFDataCreate(kCFAllocatorDefault,
reinterpret_cast<const UInt8 *>(data.c_str()),
data.length()));
if (!result)
setGenericError(err, "Failed to create CFData");
return result;
}
ScopedCFRef<CFMutableDictionaryRef> createQuery(const std::string &serviceName,
const std::string &user,
keychain::Error &err) {
const auto cfServiceName = createCFStringWithCString(serviceName, err);
const auto cfUser = createCFStringWithCString(user, err);
auto query = createCFMutableDictionary(err);
if (err.type != keychain::ErrorType::NoError)
return query;
CFDictionaryAddValue(query.get(), kSecClass, kSecClassGenericPassword);
CFDictionaryAddValue(query.get(), kSecAttrAccount, cfUser.get());
CFDictionaryAddValue(query.get(), kSecAttrService, cfServiceName.get());
return query;
}
} // namespace
namespace keychain {
void setPassword(const std::string &package, const std::string &service,
const std::string &user, const std::string &password,
Error &err) {
err = Error{};
const auto serviceName = makeServiceName(package, service);
const auto cfPassword = createCFData(password, err);
auto query = createQuery(serviceName, user, err);
if (err.type != keychain::ErrorType::NoError)
return;
CFDictionaryAddValue(query.get(), kSecValueData, cfPassword.get());
OSStatus status = SecItemAdd(query.get(), NULL);
if (status == errSecDuplicateItem) {
// password exists -- override
auto attributesToUpdate = createCFMutableDictionary(err);
if (err.type != keychain::ErrorType::NoError)
return;
CFDictionaryAddValue(
attributesToUpdate.get(), kSecValueData, cfPassword.get());
status = SecItemUpdate(query.get(), attributesToUpdate.get());
}
updateError(err, status);
}
std::string getPassword(const std::string &package, const std::string &service,
const std::string &user, Error &err) {
err = Error{};
const auto serviceName = makeServiceName(package, service);
auto query = createQuery(serviceName, user, err);
if (err.type != keychain::ErrorType::NoError)
return "";
CFDictionaryAddValue(query.get(), kSecReturnData, kCFBooleanTrue);
CFTypeRef result = nullptr;
updateError(err, SecItemCopyMatching(query.get(), &result));
const auto cfPassword = ScopedCFRef<CFDataRef>((CFDataRef)result);
if (!cfPassword || err.type != keychain::ErrorType::NoError)
return "";
return std::string(
reinterpret_cast<const char *>(CFDataGetBytePtr(cfPassword.get())),
CFDataGetLength(cfPassword.get()));
}
void deletePassword(const std::string &package, const std::string &service,
const std::string &user, Error &err) {
err = Error{};
const auto serviceName = makeServiceName(package, service);
const auto query = createQuery(serviceName, user, err);
if (err.type != keychain::ErrorType::NoError)
return;
updateError(err, SecItemDelete(query.get()));
}
bool isAvailable(Error &err) {
err = Error{};
auto query = createCFMutableDictionary(err);
if (!query) {
err.type = ErrorType::Unavailable;
err.message = "Failed to create query dictionary";
return false;
}
CFDictionaryAddValue(query.get(), kSecClass, kSecClassGenericPassword);
auto service =
createCFStringWithCString("keychain_availability_check_service", err);
auto account =
createCFStringWithCString("keychain_availability_check_account", err);
if (!service || !account) {
err.type = ErrorType::Unavailable;
err.message = "Failed to create service/account string";
return false;
}
CFDictionaryAddValue(query.get(), kSecAttrService, service.get());
CFDictionaryAddValue(query.get(), kSecAttrAccount, account.get());
CFDictionaryAddValue(query.get(), kSecReturnData, kCFBooleanFalse);
#ifdef SIMULATE_FAILURES
// TEST HOOK: Simulate SecItemCopyMatching failure
if (getenv("KEYCHAIN_TEST_SIMULATED_FAILURE")) {
err.type = ErrorType::Unavailable;
err.message = "Simulated failure: SecItemCopyMatching";
return false;
}
#endif
OSStatus status = SecItemCopyMatching(query.get(), nullptr);
if (status == errSecSuccess || status == errSecItemNotFound) {
return true;
} else {
err.type = ErrorType::Unavailable;
err.message = errorStatusToString(status);
return false;
}
}
} // namespace keychain
================================================
FILE: src/keychain_win.cpp
================================================
/*
* Copyright (c) 2013 GitHub Inc.
* Copyright (c) 2019 Hannes Rantzsch, René Meusel
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
// clang-format off
// make sure windows.h is included before wincred.h
#include "keychain.h"
#include <memory>
#define UNICODE
#include <windows.h>
#include <wincred.h>
#define DWORD_MAX 0xffffffffUL
// clang-format on
namespace {
static const DWORD kCredType = CRED_TYPE_GENERIC;
struct LpwstrDeleter {
void operator()(WCHAR *p) const { delete[] p; }
};
//! Wrapper around a WCHAR pointer a.k.a. LPWStr to take care of memory handling
using ScopedLpwstr = std::unique_ptr<WCHAR, LpwstrDeleter>;
/*! \brief Converts a UTF-8 std::string to wide char
*
* Uses MultiByteToWideChar to convert the input string and wraps the result in
* a ScopedLpwstr. Returns nullptr on failure.
*/
ScopedLpwstr utf8ToWideChar(const std::string &utf8) {
int requiredBufSize = MultiByteToWideChar(
CP_UTF8,
0, // flags must be 0 for UTF-8
utf8.c_str(),
-1, // rely on null-terminated input string
nullptr, // no out-buffer needed
0); // return required buffer size; don't write to out-buffer
// 0 means MultiByteToWideChar did not succeed. Note that even an empty
// string yields 1 on success due to the terminating null character needed
// in the out-buffer.
if (requiredBufSize == 0) {
return nullptr;
}
ScopedLpwstr lwstr(new WCHAR[requiredBufSize]);
int bytesWritten = MultiByteToWideChar(
CP_UTF8, 0, utf8.c_str(), -1, lwstr.get(), requiredBufSize);
if (bytesWritten == 0) {
return nullptr;
}
return lwstr;
}
/*! \brief Converts a wide char pointer to a std::string
*
* Note that this function provides no reliable indication of errors and simply
* returns an empty string in case it fails.
*/
std::string wideCharToAnsi(LPWSTR wChar) {
std::string result;
if (wChar == nullptr) {
return result;
}
int requiredBufSize = WideCharToMultiByte(
CP_ACP,
0, // flags
wChar,
-1, // rely on null-terminated input string
nullptr, // no out-buffer needed
0, // return required buffer size; don't write to out-buffer
nullptr, // use system default for non representable characters
nullptr); // unused output parameter
// 0 indicates error; see comment in utf8ToWideChar.
if (requiredBufSize == 0) {
return result;
}
std::unique_ptr<char[]> buffer(new char[requiredBufSize]);
int bytesWritten = WideCharToMultiByte(
CP_ACP, 0, wChar, -1, buffer.get(), requiredBufSize, nullptr, nullptr);
if (bytesWritten != 0) {
result = std::string(buffer.get());
}
return result;
}
/*! /brief Get an explanatory message for an error code obtained via
* ::GetLastError()
*/
std::string getErrorMessage(DWORD errorCode) {
std::string errMsg;
LPWSTR errBuffer = nullptr;
auto written = ::FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
nullptr, // ignored for the flags we use
errorCode,
0, // figure out LANGID automatically
reinterpret_cast<LPWSTR>(&errBuffer),
0, // figure out out-buffer size automatically
nullptr); // no additional arguments
if (written > 0 && errBuffer != nullptr) {
errMsg = wideCharToAnsi(errBuffer);
LocalFree(errBuffer);
}
return errMsg;
}
void updateError(keychain::Error &err) {
const auto code = ::GetLastError();
if (code == ERROR_SUCCESS) {
err = keychain::Error{};
return;
}
err.message = getErrorMessage(code);
err.code = code;
err.type = err.code == ERROR_NOT_FOUND ? keychain::ErrorType::NotFound
: keychain::ErrorType::GenericError;
}
/*! /brief Create the target name used to lookup and store credentials
*
* The result is wrapped in a ScopedLpwstr.
*/
ScopedLpwstr makeTargetName(const std::string &package,
const std::string &service, const std::string &user,
keychain::Error &err) {
auto result = utf8ToWideChar(package + "." + service + '/' + user);
if (!result) {
updateError(err);
// make really sure that we set an error code if we will return nullptr
if (!err) {
err.type = keychain::ErrorType::GenericError;
err.message = "Failed to create credential target name.";
err.code = -1; // generic non-zero
}
}
return result;
}
} // namespace
namespace keychain {
void setPassword(const std::string &package, const std::string &service,
const std::string &user, const std::string &password,
Error &err) {
err = Error{};
auto target_name = makeTargetName(package, service, user, err);
if (err) {
return;
}
ScopedLpwstr user_name(utf8ToWideChar(user));
if (!user_name) {
updateError(err);
return;
}
if (password.size() > CRED_MAX_CREDENTIAL_BLOB_SIZE ||
password.size() > DWORD_MAX) {
err.type = ErrorType::PasswordTooLong;
err.message = "Password too long.";
err.code = -1; // generic non-zero
return;
}
CREDENTIAL cred = {};
cred.Type = kCredType;
cred.TargetName = target_name.get();
cred.UserName = user_name.get();
cred.CredentialBlobSize = static_cast<DWORD>(password.size());
cred.CredentialBlob = (LPBYTE)(password.data());
cred.Persist = CRED_PERSIST_ENTERPRISE;
if (::CredWrite(&cred, 0) == FALSE) {
updateError(err);
}
}
std::string getPassword(const std::string &package, const std::string &service,
const std::string &user, Error &err) {
err = Error{};
std::string password;
auto target_name = makeTargetName(package, service, user, err);
if (err) {
return password;
}
CREDENTIAL *cred;
bool result = ::CredRead(target_name.get(), kCredType, 0, &cred);
if (result == TRUE) {
password = std::string(reinterpret_cast<char *>(cred->CredentialBlob),
cred->CredentialBlobSize);
::CredFree(cred);
} else {
updateError(err);
}
return password;
}
void deletePassword(const std::string &package, const std::string &service,
const std::string &user, Error &err) {
err = Error{};
auto target_name = makeTargetName(package, service, user, err);
if (err) {
return;
}
if (::CredDelete(target_name.get(), kCredType, 0) == FALSE) {
updateError(err);
}
}
bool isAvailable(Error &err) {
// Credential Manager is always present on Windows;
// any runtime errors will surface in get/set/delete.
err = Error{};
return true;
}
} // namespace keychain
================================================
FILE: test/CMakeLists.txt
================================================
set(TEST_BINARY_NAME "${PROJECT_NAME}-test")
add_executable(${TEST_BINARY_NAME} "catch_amalgamated.cpp" "tests.cpp")
target_compile_features(${TEST_BINARY_NAME} PUBLIC cxx_std_14)
target_include_directories(${TEST_BINARY_NAME} PRIVATE ${PROJECT_SOURCE_DIR})
target_link_libraries(${TEST_BINARY_NAME} PRIVATE ${PROJECT_NAME})
add_custom_target(test ${TEST_BINARY_NAME})
================================================
FILE: test/catch_amalgamated.cpp
================================================
// Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
// SPDX-License-Identifier: BSL-1.0
// Catch v3.13.0
// Generated: 2026-02-15 22:55:00.269529
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
// ----------------------------------------------------------
#include "catch_amalgamated.hpp"
#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
#if defined(CATCH_PLATFORM_WINDOWS)
// We might end up with the define made globally through the compiler,
// and we don't want to trigger warnings for this
#if !defined(NOMINMAX)
# define NOMINMAX
#endif
#if !defined(WIN32_LEAN_AND_MEAN)
# define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif // defined(CATCH_PLATFORM_WINDOWS)
#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
namespace Catch {
namespace Benchmark {
namespace Detail {
ChronometerConcept::~ChronometerConcept() = default;
} // namespace Detail
} // namespace Benchmark
} // namespace Catch
// Adapted from donated nonius code.
#include <vector>
namespace Catch {
namespace Benchmark {
namespace Detail {
SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDuration* last) {
if (!cfg.benchmarkNoAnalysis()) {
std::vector<double> samples;
samples.reserve(static_cast<size_t>(last - first));
for (auto current = first; current != last; ++current) {
samples.push_back( current->count() );
}
auto analysis = Catch::Benchmark::Detail::analyse_samples(
cfg.benchmarkConfidenceInterval(),
cfg.benchmarkResamples(),
samples.data(),
samples.data() + samples.size() );
auto outliers = Catch::Benchmark::Detail::classify_outliers(
samples.data(), samples.data() + samples.size() );
auto wrap_estimate = [](Estimate<double> e) {
return Estimate<FDuration> {
FDuration(e.point),
FDuration(e.lower_bound),
FDuration(e.upper_bound),
e.confidence_interval,
};
};
std::vector<FDuration> samples2;
samples2.reserve(samples.size());
for (auto s : samples) {
samples2.push_back( FDuration( s ) );
}
return {
CATCH_MOVE(samples2),
wrap_estimate(analysis.mean),
wrap_estimate(analysis.standard_deviation),
outliers,
analysis.outlier_variance,
};
} else {
std::vector<FDuration> samples;
samples.reserve(static_cast<size_t>(last - first));
FDuration mean = FDuration(0);
int i = 0;
for (auto it = first; it < last; ++it, ++i) {
samples.push_back(*it);
mean += *it;
}
mean /= i;
return SampleAnalysis{
CATCH_MOVE(samples),
Estimate<FDuration>{ mean, mean, mean, 0.0 },
Estimate<FDuration>{ FDuration( 0 ),
FDuration( 0 ),
FDuration( 0 ),
0.0 },
OutlierClassification{},
0.0
};
}
}
} // namespace Detail
} // namespace Benchmark
} // namespace Catch
namespace Catch {
namespace Benchmark {
namespace Detail {
struct do_nothing {
void operator()() const {}
};
BenchmarkFunction::callable::~callable() = default;
BenchmarkFunction::BenchmarkFunction():
f( new model<do_nothing>{ {} } ){}
} // namespace Detail
} // namespace Benchmark
} // namespace Catch
#include <exception>
namespace Catch {
namespace Benchmark {
namespace Detail {
struct optimized_away_error : std::exception {
const char* what() const noexcept override;
};
const char* optimized_away_error::what() const noexcept {
return "could not measure benchmark, maybe it was optimized away";
}
void throw_optimized_away_error() {
Catch::throw_exception(optimized_away_error{});
}
} // namespace Detail
} // namespace Benchmark
} // namespace Catch
// Adapted from donated nonius code.
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <numeric>
#include <random>
#if defined(CATCH_CONFIG_USE_ASYNC)
#include <future>
#endif
namespace Catch {
namespace Benchmark {
namespace Detail {
namespace {
template <typename URng, typename Estimator>
static sample
resample( URng& rng,
unsigned int resamples,
double const* first,
double const* last,
Estimator& estimator ) {
auto n = static_cast<size_t>( last - first );
Catch::uniform_integer_distribution<size_t> dist( 0, n - 1 );
sample out;
out.reserve( resamples );
std::vector<double> resampled;
resampled.reserve( n );
for ( size_t i = 0; i < resamples; ++i ) {
resampled.clear();
for ( size_t s = 0; s < n; ++s ) {
resampled.push_back( first[dist( rng )] );
}
const auto estimate =
estimator( resampled.data(), resampled.data() + resampled.size() );
out.push_back( estimate );
}
std::sort( out.begin(), out.end() );
return out;
}
static double outlier_variance( Estimate<double> mean,
Estimate<double> stddev,
int n ) {
double sb = stddev.point;
double mn = mean.point / n;
double mg_min = mn / 2.;
double sg = (std::min)( mg_min / 4., sb / std::sqrt( n ) );
double sg2 = sg * sg;
double sb2 = sb * sb;
auto c_max = [n, mn, sb2, sg2]( double x ) -> double {
double k = mn - x;
double d = k * k;
double nd = n * d;
double k0 = -n * nd;
double k1 = sb2 - n * sg2 + nd;
double det = k1 * k1 - 4 * sg2 * k0;
return static_cast<int>( -2. * k0 /
( k1 + std::sqrt( det ) ) );
};
auto var_out = [n, sb2, sg2]( double c ) {
double nc = n - c;
return ( nc / n ) * ( sb2 - nc * sg2 );
};
return (std::min)( var_out( 1 ),
var_out(
(std::min)( c_max( 0. ),
c_max( mg_min ) ) ) ) /
sb2;
}
static double erf_inv( double x ) {
// Code accompanying the article "Approximating the erfinv
// function" in GPU Computing Gems, Volume 2
double w, p;
w = -log( ( 1.0 - x ) * ( 1.0 + x ) );
if ( w < 6.250000 ) {
w = w - 3.125000;
p = -3.6444120640178196996e-21;
p = -1.685059138182016589e-19 + p * w;
p = 1.2858480715256400167e-18 + p * w;
p = 1.115787767802518096e-17 + p * w;
p = -1.333171662854620906e-16 + p * w;
p = 2.0972767875968561637e-17 + p * w;
p = 6.6376381343583238325e-15 + p * w;
p = -4.0545662729752068639e-14 + p * w;
p = -8.1519341976054721522e-14 + p * w;
p = 2.6335093153082322977e-12 + p * w;
p = -1.2975133253453532498e-11 + p * w;
p = -5.4154120542946279317e-11 + p * w;
p = 1.051212273321532285e-09 + p * w;
p = -4.1126339803469836976e-09 + p * w;
p = -2.9070369957882005086e-08 + p * w;
p = 4.2347877827932403518e-07 + p * w;
p = -1.3654692000834678645e-06 + p * w;
p = -1.3882523362786468719e-05 + p * w;
p = 0.0001867342080340571352 + p * w;
p = -0.00074070253416626697512 + p * w;
p = -0.0060336708714301490533 + p * w;
p = 0.24015818242558961693 + p * w;
p = 1.6536545626831027356 + p * w;
} else if ( w < 16.000000 ) {
w = sqrt( w ) - 3.250000;
p = 2.2137376921775787049e-09;
p = 9.0756561938885390979e-08 + p * w;
p = -2.7517406297064545428e-07 + p * w;
p = 1.8239629214389227755e-08 + p * w;
p = 1.5027403968909827627e-06 + p * w;
p = -4.013867526981545969e-06 + p * w;
p = 2.9234449089955446044e-06 + p * w;
p = 1.2475304481671778723e-05 + p * w;
p = -4.7318229009055733981e-05 + p * w;
p = 6.8284851459573175448e-05 + p * w;
p = 2.4031110387097893999e-05 + p * w;
p = -0.0003550375203628474796 + p * w;
p = 0.00095328937973738049703 + p * w;
p = -0.0016882755560235047313 + p * w;
p = 0.0024914420961078508066 + p * w;
p = -0.0037512085075692412107 + p * w;
p = 0.005370914553590063617 + p * w;
p = 1.0052589676941592334 + p * w;
p = 3.0838856104922207635 + p * w;
} else {
w = sqrt( w ) - 5.000000;
p = -2.7109920616438573243e-11;
p = -2.5556418169965252055e-10 + p * w;
p = 1.5076572693500548083e-09 + p * w;
p = -3.7894654401267369937e-09 + p * w;
p = 7.6157012080783393804e-09 + p * w;
p = -1.4960026627149240478e-08 + p * w;
p = 2.9147953450901080826e-08 + p * w;
p = -6.7711997758452339498e-08 + p * w;
p = 2.2900482228026654717e-07 + p * w;
p = -9.9298272942317002539e-07 + p * w;
p = 4.5260625972231537039e-06 + p * w;
p = -1.9681778105531670567e-05 + p * w;
p = 7.5995277030017761139e-05 + p * w;
p = -0.00021503011930044477347 + p * w;
p = -0.00013871931833623122026 + p * w;
p = 1.0103004648645343977 + p * w;
p = 4.8499064014085844221 + p * w;
}
return p * x;
}
static double
standard_deviation( double const* first, double const* last ) {
auto m = Catch::Benchmark::Detail::mean( first, last );
double variance =
std::accumulate( first,
last,
0.,
[m]( double a, double b ) {
double diff = b - m;
return a + diff * diff;
} ) /
static_cast<double>( last - first );
return std::sqrt( variance );
}
static sample jackknife( double ( *estimator )( double const*,
double const* ),
double* first,
double* last ) {
const auto second = first + 1;
sample results;
results.reserve( static_cast<size_t>( last - first ) );
for ( auto it = first; it != last; ++it ) {
std::iter_swap( it, first );
results.push_back( estimator( second, last ) );
}
return results;
}
} // namespace
} // namespace Detail
} // namespace Benchmark
} // namespace Catch
namespace Catch {
namespace Benchmark {
namespace Detail {
double weighted_average_quantile( int k,
int q,
double* first,
double* last ) {
auto count = last - first;
double idx = static_cast<double>((count - 1) * k) / static_cast<double>(q);
int j = static_cast<int>(idx);
double g = idx - j;
std::nth_element(first, first + j, last);
auto xj = first[j];
if ( Catch::Detail::directCompare( g, 0 ) ) {
return xj;
}
auto xj1 = *std::min_element(first + (j + 1), last);
return xj + g * (xj1 - xj);
}
OutlierClassification
classify_outliers( double const* first, double const* last ) {
std::vector<double> copy( first, last );
auto q1 = weighted_average_quantile( 1, 4, copy.data(), copy.data() + copy.size() );
auto q3 = weighted_average_quantile( 3, 4, copy.data(), copy.data() + copy.size() );
auto iqr = q3 - q1;
auto los = q1 - ( iqr * 3. );
auto lom = q1 - ( iqr * 1.5 );
auto him = q3 + ( iqr * 1.5 );
auto his = q3 + ( iqr * 3. );
OutlierClassification o;
for ( ; first != last; ++first ) {
const double t = *first;
if ( t < los ) {
++o.low_severe;
} else if ( t < lom ) {
++o.low_mild;
} else if ( t > his ) {
++o.high_severe;
} else if ( t > him ) {
++o.high_mild;
}
++o.samples_seen;
}
return o;
}
double mean( double const* first, double const* last ) {
auto count = last - first;
double sum = 0.;
while (first != last) {
sum += *first;
++first;
}
return sum / static_cast<double>(count);
}
double normal_cdf( double x ) {
return std::erfc( -x / std::sqrt( 2.0 ) ) / 2.0;
}
double erfc_inv(double x) {
return erf_inv(1.0 - x);
}
double normal_quantile(double p) {
static const double ROOT_TWO = std::sqrt(2.0);
double result = 0.0;
assert(p >= 0 && p <= 1);
if (p < 0 || p > 1) {
return result;
}
result = -erfc_inv(2.0 * p);
// result *= normal distribution standard deviation (1.0) * sqrt(2)
result *= /*sd * */ ROOT_TWO;
// result += normal disttribution mean (0)
return result;
}
Estimate<double>
bootstrap( double confidence_level,
double* first,
double* last,
sample const& resample,
double ( *estimator )( double const*, double const* ) ) {
auto n_samples = last - first;
double point = estimator( first, last );
// Degenerate case with a single sample
if ( n_samples == 1 )
return { point, point, point, confidence_level };
sample jack = jackknife( estimator, first, last );
double jack_mean =
mean( jack.data(), jack.data() + jack.size() );
double sum_squares = 0, sum_cubes = 0;
for ( double x : jack ) {
auto difference = jack_mean - x;
auto square = difference * difference;
auto cube = square * difference;
sum_squares += square;
sum_cubes += cube;
}
double accel = sum_cubes / ( 6 * std::pow( sum_squares, 1.5 ) );
long n = static_cast<long>( resample.size() );
double prob_n = static_cast<double>(
std::count_if( resample.begin(),
resample.end(),
[point]( double x ) { return x < point; } )) /
static_cast<double>( n );
// degenerate case with uniform samples
if ( Catch::Detail::directCompare( prob_n, 0. ) ) {
return { point, point, point, confidence_level };
}
double bias = normal_quantile( prob_n );
double z1 = normal_quantile( ( 1. - confidence_level ) / 2. );
auto cumn = [n]( double x ) -> long {
return std::lround( normal_cdf( x ) *
static_cast<double>( n ) );
};
auto a = [bias, accel]( double b ) {
return bias + b / ( 1. - accel * b );
};
double b1 = bias + z1;
double b2 = bias - z1;
double a1 = a( b1 );
double a2 = a( b2 );
auto lo = static_cast<size_t>( (std::max)( cumn( a1 ), 0l ) );
auto hi =
static_cast<size_t>( (std::min)( cumn( a2 ), n - 1 ) );
return { point, resample[lo], resample[hi], confidence_level };
}
bootstrap_analysis analyse_samples(double confidence_level,
unsigned int n_resamples,
double* first,
double* last) {
auto mean = &Detail::mean;
auto stddev = &standard_deviation;
#if defined(CATCH_CONFIG_USE_ASYNC)
auto Estimate = [=](double(*f)(double const*, double const*)) {
std::random_device rd;
auto seed = rd();
return std::async(std::launch::async, [=] {
SimplePcg32 rng( seed );
auto resampled = resample(rng, n_resamples, first, last, f);
return bootstrap(confidence_level, first, last, resampled, f);
});
};
auto mean_future = Estimate(mean);
auto stddev_future = Estimate(stddev);
auto mean_estimate = mean_future.get();
auto stddev_estimate = stddev_future.get();
#else
auto Estimate = [=](double(*f)(double const* , double const*)) {
std::random_device rd;
auto seed = rd();
SimplePcg32 rng( seed );
auto resampled = resample(rng, n_resamples, first, last, f);
return bootstrap(confidence_level, first, last, resampled, f);
};
auto mean_estimate = Estimate(mean);
auto stddev_estimate = Estimate(stddev);
#endif // CATCH_USE_ASYNC
auto n = static_cast<int>(last - first); // seriously, one can't use integral types without hell in C++
double outlier_variance = Detail::outlier_variance(mean_estimate, stddev_estimate, n);
return { mean_estimate, stddev_estimate, outlier_variance };
}
} // namespace Detail
} // namespace Benchmark
} // namespace Catch
#include <cmath>
#include <limits>
namespace {
// Performs equivalent check of std::fabs(lhs - rhs) <= margin
// But without the subtraction to allow for INFINITY in comparison
bool marginComparison(double lhs, double rhs, double margin) {
return (lhs + margin >= rhs) && (rhs + margin >= lhs);
}
}
namespace Catch {
Approx::Approx ( double value )
: m_epsilon( static_cast<double>(std::numeric_limits<float>::epsilon())*100. ),
m_margin( 0.0 ),
m_scale( 0.0 ),
m_value( value )
{}
Approx Approx::custom() {
return Approx( 0 );
}
Approx Approx::operator-() const {
auto temp(*this);
temp.m_value = -temp.m_value;
return temp;
}
std::string Approx::toString() const {
ReusableStringStream rss;
rss << "Approx( " << ::Catch::Detail::stringify( m_value ) << " )";
return rss.str();
}
bool Approx::equalityComparisonImpl(const double other) const {
// First try with fixed margin, then compute margin based on epsilon, scale and Approx's value
// Thanks to Richard Harris for his help refining the scaled margin value
return marginComparison(m_value, other, m_margin)
|| marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(std::isinf(m_value)? 0 : m_value)));
}
void Approx::setMargin(double newMargin) {
CATCH_ENFORCE(newMargin >= 0,
"Invalid Approx::margin: " << newMargin << '.'
<< " Approx::Margin has to be non-negative.");
m_margin = newMargin;
}
void Approx::setEpsilon(double newEpsilon) {
CATCH_ENFORCE(newEpsilon >= 0 && newEpsilon <= 1.0,
"Invalid Approx::epsilon: " << newEpsilon << '.'
<< " Approx::epsilon has to be in [0, 1]");
m_epsilon = newEpsilon;
}
namespace literals {
Approx operator ""_a(long double val) {
return Approx(val);
}
Approx operator ""_a(unsigned long long val) {
return Approx(val);
}
} // end namespace literals
std::string StringMaker<Catch::Approx>::convert(Catch::Approx const& value) {
return value.toString();
}
} // end namespace Catch
namespace Catch {
AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const& _lazyExpression):
lazyExpression(_lazyExpression),
resultType(_resultType) {}
std::string AssertionResultData::reconstructExpression() const {
if( reconstructedExpression.empty() ) {
if( lazyExpression ) {
ReusableStringStream rss;
rss << lazyExpression;
reconstructedExpression = rss.str();
}
}
return reconstructedExpression;
}
AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData&& data )
: m_info( info ),
m_resultData( CATCH_MOVE(data) )
{}
// Result was a success
bool AssertionResult::succeeded() const {
return Catch::isOk( m_resultData.resultType );
}
// Result was a success, or failure is suppressed
bool AssertionResult::isOk() const {
return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
}
ResultWas::OfType AssertionResult::getResultType() const {
return m_resultData.resultType;
}
bool AssertionResult::hasExpression() const {
return !m_info.capturedExpression.empty();
}
bool AssertionResult::hasMessage() const {
return !m_resultData.message.empty();
}
std::string AssertionResult::getExpression() const {
// Possibly overallocating by 3 characters should be basically free
std::string expr; expr.reserve(m_info.capturedExpression.size() + 3);
if (isFalseTest(m_info.resultDisposition)) {
expr += "!(";
}
expr += m_info.capturedExpression;
if (isFalseTest(m_info.resultDisposition)) {
expr += ')';
}
return expr;
}
std::string AssertionResult::getExpressionInMacro() const {
if ( m_info.macroName.empty() ) {
return static_cast<std::string>( m_info.capturedExpression );
}
std::string expr;
expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
expr += m_info.macroName;
expr += "( ";
expr += m_info.capturedExpression;
expr += " )";
return expr;
}
bool AssertionResult::hasExpandedExpression() const {
return hasExpression() && getExpandedExpression() != getExpression();
}
std::string AssertionResult::getExpandedExpression() const {
std::string expr = m_resultData.reconstructExpression();
return expr.empty()
? getExpression()
: expr;
}
StringRef AssertionResult::getMessage() const {
return m_resultData.message;
}
SourceLineInfo AssertionResult::getSourceInfo() const {
return m_info.lineInfo;
}
StringRef AssertionResult::getTestMacroName() const {
return m_info.macroName;
}
} // end namespace Catch
#include <fstream>
namespace Catch {
namespace {
static bool enableBazelEnvSupport() {
#if defined( CATCH_CONFIG_BAZEL_SUPPORT )
return true;
#else
return Detail::getEnv( "BAZEL_TEST" ) != nullptr;
#endif
}
struct bazelShardingOptions {
unsigned int shardIndex, shardCount;
std::string shardFilePath;
};
static Optional<bazelShardingOptions> readBazelShardingOptions() {
const auto bazelShardIndex = Detail::getEnv( "TEST_SHARD_INDEX" );
const auto bazelShardTotal = Detail::getEnv( "TEST_TOTAL_SHARDS" );
const auto bazelShardInfoFile = Detail::getEnv( "TEST_SHARD_STATUS_FILE" );
const bool has_all =
bazelShardIndex && bazelShardTotal && bazelShardInfoFile;
if ( !has_all ) {
// We provide nice warning message if the input is
// misconfigured.
auto warn = []( const char* env_var ) {
Catch::cerr()
<< "Warning: Bazel shard configuration is missing '"
<< env_var << "'. Shard configuration is skipped.\n";
};
if ( !bazelShardIndex ) {
warn( "TEST_SHARD_INDEX" );
}
if ( !bazelShardTotal ) {
warn( "TEST_TOTAL_SHARDS" );
}
if ( !bazelShardInfoFile ) {
warn( "TEST_SHARD_STATUS_FILE" );
}
return {};
}
auto shardIndex = parseUInt( bazelShardIndex );
if ( !shardIndex ) {
Catch::cerr()
<< "Warning: could not parse 'TEST_SHARD_INDEX' ('" << bazelShardIndex
<< "') as unsigned int.\n";
return {};
}
auto shardTotal = parseUInt( bazelShardTotal );
if ( !shardTotal ) {
Catch::cerr()
<< "Warning: could not parse 'TEST_TOTAL_SHARD' ('"
<< bazelShardTotal << "') as unsigned int.\n";
return {};
}
return bazelShardingOptions{
*shardIndex, *shardTotal, bazelShardInfoFile };
}
} // end namespace
bool operator==( ProcessedReporterSpec const& lhs,
ProcessedReporterSpec const& rhs ) {
return lhs.name == rhs.name &&
lhs.outputFilename == rhs.outputFilename &&
lhs.colourMode == rhs.colourMode &&
lhs.customOptions == rhs.customOptions;
}
bool operator==( PathFilter const& lhs, PathFilter const& rhs ) {
return lhs.type == rhs.type && lhs.filter == rhs.filter;
}
Config::Config( ConfigData const& data ):
m_data( data ) {
// We need to trim filter specs to avoid trouble with superfluous
// whitespace (esp. important for bdd macros, as those are manually
// aligned with whitespace).
for (auto& elem : m_data.testsOrTags) {
elem = trim(elem);
}
// Insert the default reporter if user hasn't asked for a specific one
if ( m_data.reporterSpecifications.empty() ) {
#if defined( CATCH_CONFIG_DEFAULT_REPORTER )
const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER;
#else
const auto default_spec = "console";
#endif
auto parsed = parseReporterSpec(default_spec);
CATCH_ENFORCE( parsed,
"Cannot parse the provided default reporter spec: '"
<< default_spec << '\'' );
m_data.reporterSpecifications.push_back( std::move( *parsed ) );
}
// Reading bazel env vars can change some parts of the config data,
// so we have to process the bazel env before acting on the config.
if ( enableBazelEnvSupport() ) {
readBazelEnvVars();
}
// Bazel support can modify the test specs, so parsing has to happen
// after reading Bazel env vars.
TestSpecParser parser( ITagAliasRegistry::get() );
if ( !m_data.testsOrTags.empty() ) {
m_hasTestFilters = true;
for ( auto const& testOrTags : m_data.testsOrTags ) {
parser.parse( testOrTags );
}
}
m_testSpec = parser.testSpec();
// We now fixup the reporter specs to handle default output spec,
// default colour spec, etc
bool defaultOutputUsed = false;
for ( auto const& reporterSpec : m_data.reporterSpecifications ) {
// We do the default-output check separately, while always
// using the default output below to make the code simpler
// and avoid superfluous copies.
if ( reporterSpec.outputFile().none() ) {
CATCH_ENFORCE( !defaultOutputUsed,
"Internal error: cannot use default output for "
"multiple reporters" );
defaultOutputUsed = true;
}
m_processedReporterSpecs.push_back( ProcessedReporterSpec{
reporterSpec.name(),
reporterSpec.outputFile() ? *reporterSpec.outputFile()
: data.defaultOutputFilename,
reporterSpec.colourMode().valueOr( data.defaultColourMode ),
reporterSpec.customOptions() } );
}
}
Config::~Config() = default;
bool Config::listTests() const { return m_data.listTests; }
bool Config::listTags() const { return m_data.listTags; }
bool Config::listReporters() const { return m_data.listReporters; }
bool Config::listListeners() const { return m_data.listListeners; }
std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
std::vector<PathFilter> const& Config::getPathFilters() const { return m_data.pathFilters; }
bool Config::useNewFilterBehaviour() const { return m_data.useNewPathFilteringBehaviour; }
std::vector<ReporterSpec> const& Config::getReporterSpecs() const {
return m_data.reporterSpecifications;
}
std::vector<ProcessedReporterSpec> const&
Config::getProcessedReporterSpecs() const {
return m_processedReporterSpecs;
}
TestSpec const& Config::testSpec() const { return m_testSpec; }
bool Config::hasTestFilters() const { return m_hasTestFilters; }
bool Config::showHelp() const { return m_data.showHelp; }
std::string const& Config::getExitGuardFilePath() const { return m_data.prematureExitGuardFilePath; }
// IConfig interface
bool Config::allowThrows() const { return !m_data.noThrow; }
StringRef 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::warnAboutUnmatchedTestSpecs() const {
return !!( m_data.warnings & WarnAbout::UnmatchedTestSpec );
}
bool Config::warnAboutInfiniteGenerators() const {
return !!( m_data.warnings & WarnAbout::InfiniteGenerator );
}
bool Config::zeroTestsCountAsSuccess() const { return m_data.allowZeroTests; }
ShowDurations Config::showDurations() const { return m_data.showDurations; }
double Config::minDuration() const { return m_data.minDuration; }
TestRunOrder Config::runOrder() const { return m_data.runOrder; }
uint32_t Config::rngSeed() const { return m_data.rngSeed; }
unsigned int Config::shardCount() const { return m_data.shardCount; }
unsigned int Config::shardIndex() const { return m_data.shardIndex; }
ColourMode Config::defaultColourMode() const { return m_data.defaultColourMode; }
bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
int Config::abortAfter() const { return m_data.abortAfter; }
bool Config::showInvisibles() const { return m_data.showInvisibles; }
Verbosity Config::verbosity() const { return m_data.verbosity; }
bool Config::skipBenchmarks() const { return m_data.skipBenchmarks; }
bool Config::benchmarkNoAnalysis() const { return m_data.benchmarkNoAnalysis; }
unsigned int Config::benchmarkSamples() const { return m_data.benchmarkSamples; }
double Config::benchmarkConfidenceInterval() const { return m_data.benchmarkConfidenceInterval; }
unsigned int Config::benchmarkResamples() const { return m_data.benchmarkResamples; }
std::chrono::milliseconds Config::benchmarkWarmupTime() const { return std::chrono::milliseconds(m_data.benchmarkWarmupTime); }
void Config::readBazelEnvVars() {
// Register a JUnit reporter for Bazel. Bazel sets an environment
// variable with the path to XML output. If this file is written to
// during test, Bazel will not generate a default XML output.
// This allows the XML output file to contain higher level of detail
// than what is possible otherwise.
const auto bazelOutputFile = Detail::getEnv( "XML_OUTPUT_FILE" );
if ( bazelOutputFile ) {
m_data.reporterSpecifications.push_back(
{ "junit", std::string( bazelOutputFile ), {}, {} } );
}
const auto bazelTestSpec = Detail::getEnv( "TESTBRIDGE_TEST_ONLY" );
if ( bazelTestSpec ) {
// Presumably the test spec from environment should overwrite
// the one we got from CLI (if we got any)
m_data.testsOrTags.clear();
m_data.testsOrTags.push_back( bazelTestSpec );
}
const auto bazelShardOptions = readBazelShardingOptions();
if ( bazelShardOptions ) {
std::ofstream f( bazelShardOptions->shardFilePath,
std::ios_base::out | std::ios_base::trunc );
if ( f.is_open() ) {
f << "";
m_data.shardIndex = bazelShardOptions->shardIndex;
m_data.shardCount = bazelShardOptions->shardCount;
}
}
const auto bazelExitGuardFile = Detail::getEnv( "TEST_PREMATURE_EXIT_FILE" );
if (bazelExitGuardFile) {
m_data.prematureExitGuardFilePath = bazelExitGuardFile;
}
const auto bazelRandomSeed = Detail::getEnv( "TEST_RANDOM_SEED" );
if ( bazelRandomSeed ) {
auto parsedSeed = parseUInt( bazelRandomSeed, 0 );
if ( !parsedSeed ) {
// Currently we handle issues with parsing other Bazel Env
// options by warning and ignoring the issue. So we do the
// same for random seed option.
Catch::cerr()
<< "Warning: could not parse 'TEST_RANDOM_SEED' ('"
<< bazelRandomSeed << "') as proper seed.\n";
} else {
m_data.rngSeed = *parsedSeed;
}
}
}
} // end namespace Catch
namespace Catch {
std::uint32_t getSeed() {
return getCurrentContext().getConfig()->rngSeed();
}
}
#include <cassert>
#include <stack>
namespace Catch {
////////////////////////////////////////////////////////////////////////////
ScopedMessage::ScopedMessage( MessageBuilder&& builder ):
m_messageId( builder.m_info.sequence ) {
MessageInfo info( CATCH_MOVE( builder.m_info ) );
info.message = builder.m_stream.str();
IResultCapture::pushScopedMessage( CATCH_MOVE( info ) );
}
ScopedMessage::ScopedMessage( ScopedMessage&& old ) noexcept:
m_messageId( old.m_messageId ) {
old.m_moved = true;
}
ScopedMessage::~ScopedMessage() {
if ( !m_moved ) { IResultCapture::popScopedMessage( m_messageId ); }
}
Capturer::Capturer( StringRef macroName,
SourceLineInfo const& lineInfo,
ResultWas::OfType resultType,
StringRef names,
bool isScoped):
m_isScoped(isScoped) {
auto trimmed = [&] (size_t start, size_t end) {
while (names[start] == ',' || isspace(static_cast<unsigned char>(names[start]))) {
++start;
}
while (names[end] == ',' || isspace(static_cast<unsigned char>(names[end]))) {
--end;
}
return names.substr(start, end - start + 1);
};
auto skipq = [&] (size_t start, char quote) {
for (auto i = start + 1; i < names.size() ; ++i) {
if (names[i] == quote)
return i;
if (names[i] == '\\')
++i;
}
CATCH_INTERNAL_ERROR("CAPTURE parsing encountered unmatched quote");
};
size_t start = 0;
std::stack<char> openings;
for (size_t pos = 0; pos < names.size(); ++pos) {
char c = names[pos];
switch (c) {
case '[':
case '{':
case '(':
// It is basically impossible to disambiguate between
// comparison and start of template args in this context
// case '<':
openings.push(c);
break;
case ']':
case '}':
case ')':
// case '>':
openings.pop();
break;
case '"':
case '\'':
pos = skipq(pos, c);
break;
case ',':
if (start != pos && openings.empty()) {
m_messages.emplace_back(macroName, lineInfo, resultType);
m_messages.back().message += trimmed(start, pos);
m_messages.back().message += " := "_sr;
start = pos;
}
break;
default:; // noop
}
}
assert(openings.empty() && "Mismatched openings");
m_messages.emplace_back(macroName, lineInfo, resultType);
m_messages.back().message += trimmed(start, names.size() - 1);
m_messages.back().message += " := "_sr;
}
Capturer::~Capturer() {
assert( m_captured == m_messages.size() );
if ( m_isScoped ) {
for ( auto const& message : m_messages ) {
IResultCapture::popScopedMessage( message.sequence );
}
}
}
void Capturer::captureValue( size_t index, std::string const& value ) {
assert( index < m_messages.size() );
m_messages[index].message += value;
if ( m_isScoped ) {
IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
} else {
IResultCapture::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
}
m_captured++;
}
} // end namespace Catch
#include <exception>
namespace Catch {
namespace {
class RegistryHub : public IRegistryHub,
public IMutableRegistryHub,
private Detail::NonCopyable {
public: // IRegistryHub
RegistryHub() = default;
ReporterRegistry const& getReporterRegistry() const override {
return m_reporterRegistry;
}
ITestCaseRegistry const& getTestCaseRegistry() const override {
return m_testCaseRegistry;
}
IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const override {
return m_exceptionTranslatorRegistry;
}
ITagAliasRegistry const& getTagAliasRegistry() const override {
return m_tagAliasRegistry;
}
StartupExceptionRegistry const& getStartupExceptionRegistry() const override {
return m_exceptionRegistry;
}
public: // IMutableRegistryHub
void registerReporter( std::string const& name, IReporterFactoryPtr factory ) override {
m_reporterRegistry.registerReporter( name, CATCH_MOVE(factory) );
}
void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) override {
m_reporterRegistry.registerListener( CATCH_MOVE(factory) );
}
void registerTest( Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker ) override {
m_testCaseRegistry.registerTest( CATCH_MOVE(testInfo), CATCH_MOVE(invoker) );
}
void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) override {
m_exceptionTranslatorRegistry.registerTranslator( CATCH_MOVE(translator) );
}
void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
m_tagAliasRegistry.add( alias, tag, lineInfo );
}
void registerStartupException() noexcept override {
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
m_exceptionRegistry.add(std::current_exception());
#else
CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
#endif
}
IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
return m_enumValuesRegistry;
}
private:
TestRegistry m_testCaseRegistry;
ReporterRegistry m_reporterRegistry;
ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
TagAliasRegistry m_tagAliasRegistry;
StartupExceptionRegistry m_exceptionRegistry;
Detail::EnumValuesRegistry m_enumValuesRegistry;
};
}
using RegistryHubSingleton = Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>;
IRegistryHub const& getRegistryHub() {
return RegistryHubSingleton::get();
}
IMutableRegistryHub& getMutableRegistryHub() {
return RegistryHubSingleton::getMutable();
}
void cleanUp() {
cleanupSingletons();
}
std::string translateActiveException() {
return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
}
} // end namespace Catch
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <exception>
#include <iomanip>
#include <set>
namespace Catch {
namespace {
IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) {
auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config));
CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << '\'');
return reporter;
}
IEventListenerPtr prepareReporters(Config const* config) {
if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()
&& config->getProcessedReporterSpecs().size() == 1) {
auto const& spec = config->getProcessedReporterSpecs()[0];
return createReporter(
spec.name,
ReporterConfig( config,
makeStream( spec.outputFilename ),
spec.colourMode,
spec.customOptions ) );
}
auto multi = Detail::make_unique<MultiReporter>(config);
auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
for (auto const& listener : listeners) {
multi->addListener(listener->create(config));
}
for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) {
multi->addReporter( createReporter(
reporterSpec.name,
ReporterConfig( config,
makeStream( reporterSpec.outputFilename ),
reporterSpec.colourMode,
reporterSpec.customOptions ) ) );
}
return multi;
}
class TestGroup {
public:
explicit TestGroup(IEventListenerPtr&& reporter, Config const* config):
m_reporter(reporter.get()),
m_config{config},
m_context{config, CATCH_MOVE(reporter)} {
assert( m_config->testSpec().getInvalidSpecs().empty() &&
"Invalid test specs should be handled before running tests" );
auto const& allTestCases = getAllTestCasesSorted(*m_config);
auto const& testSpec = m_config->testSpec();
if ( !testSpec.hasFilters() ) {
for ( auto const& test : allTestCases ) {
if ( !test.getTestCaseInfo().isHidden() ) {
m_tests.emplace( &test );
}
}
} else {
m_matches =
testSpec.matchesByFilter( allTestCases, *m_config );
for ( auto const& match : m_matches ) {
m_tests.insert( match.tests.begin(),
match.tests.end() );
}
}
m_tests = createShard(m_tests, m_config->shardCount(), m_config->shardIndex());
}
Totals execute() {
Totals totals;
for (auto const& testCase : m_tests) {
if (!m_context.aborting())
totals += m_context.runTest(*testCase);
else
m_reporter->skipTest(testCase->getTestCaseInfo());
}
for (auto const& match : m_matches) {
if (match.tests.empty()) {
m_unmatchedTestSpecs = true;
m_reporter->noMatchingTestCases( match.name );
}
}
return totals;
}
bool hadUnmatchedTestSpecs() const {
return m_unmatchedTestSpecs;
}
private:
IEventListener* m_reporter;
Config const* m_config;
RunContext m_context;
std::set<TestCaseHandle const*> m_tests;
TestSpec::Matches m_matches;
bool m_unmatchedTestSpecs = false;
};
void applyFilenamesAsTags() {
for (auto const& testInfo : getRegistryHub().getTestCaseRegistry().getAllInfos()) {
testInfo->addFilenameTag();
}
}
// Creates empty file at path. The path must be writable, we do not
// try to create directories in path because that's hard in C++14.
void setUpGuardFile( std::string const& guardFilePath ) {
if ( !guardFilePath.empty() ) {
#if defined( _MSC_VER )
std::FILE* file = nullptr;
if ( fopen_s( &file, guardFilePath.c_str(), "w" ) ) {
char msgBuffer[100];
const auto err = errno;
std::string errMsg;
if ( !strerror_s( msgBuffer, err ) ) {
errMsg = msgBuffer;
} else {
errMsg = "Could not translate errno to a string";
}
#else
std::FILE* file = std::fopen( guardFilePath.c_str(), "w" );
if ( !file ) {
const auto err = errno;
const char* errMsg = std::strerror( err );
#endif
CATCH_RUNTIME_ERROR( "Could not open the exit guard file '"
<< guardFilePath << "' because '"
<< errMsg << "' (" << err << ')' );
}
const int ret = std::fclose( file );
CATCH_ENFORCE(
ret == 0,
"Error when closing the exit guard file: " << ret );
}
}
// Removes file at path. Assuming we created it in setUpGuardFile.
void tearDownGuardFile( std::string const& guardFilePath ) {
if ( !guardFilePath.empty() ) {
const int ret = std::remove( guardFilePath.c_str() );
CATCH_ENFORCE(
ret == 0,
"Error when removing the exit guard file: " << ret );
}
}
} // anon namespace
Session::Session() {
static bool alreadyInstantiated = false;
if( alreadyInstantiated ) {
CATCH_TRY { CATCH_INTERNAL_ERROR( "Only one instance of Catch::Session can ever be used" ); }
CATCH_CATCH_ALL { getMutableRegistryHub().registerStartupException(); }
}
// There cannot be exceptions at startup in no-exception mode.
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions();
if ( !exceptions.empty() ) {
config();
getCurrentMutableContext().setConfig(m_config.get());
m_startupExceptions = true;
auto errStream = makeStream( "%stderr" );
auto colourImpl = makeColourImpl(
ColourMode::PlatformDefault, errStream.get() );
auto guard = colourImpl->guardColour( Colour::Red );
errStream->stream() << "Errors occurred during startup!" << '\n';
// iterate over all exceptions and notify user
for ( const auto& ex_ptr : exceptions ) {
try {
std::rethrow_exception(ex_ptr);
} catch ( std::exception const& ex ) {
errStream->stream() << TextFlow::Column( ex.what() ).indent(2) << '\n';
}
}
}
#endif
alreadyInstantiated = true;
m_cli = makeCommandLineParser( m_configData );
}
Session::~Session() {
Catch::cleanUp();
}
void Session::showHelp() const {
Catch::cout()
<< "\nCatch2 v" << libraryVersion() << '\n'
<< m_cli << '\n'
<< "For more detailed usage please see the project docs\n\n" << std::flush;
}
void Session::libIdentify() {
Catch::cout()
<< std::left << std::setw(16) << "description: " << "A Catch2 test executable\n"
<< std::left << std::setw(16) << "category: " << "testframework\n"
<< std::left << std::setw(16) << "framework: " << "Catch2\n"
<< std::left << std::setw(16) << "version: " << libraryVersion() << '\n' << std::flush;
}
int Session::applyCommandLine( int argc, char const * const * argv ) {
if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; }
auto result = m_cli.parse( Clara::Args( argc, argv ) );
if( !result ) {
config();
getCurrentMutableContext().setConfig(m_config.get());
auto errStream = makeStream( "%stderr" );
auto colour = makeColourImpl( ColourMode::PlatformDefault, errStream.get() );
errStream->stream()
<< colour->guardColour( Colour::Red )
<< "\nError(s) in input:\n"
<< TextFlow::Column( result.errorMessage() ).indent( 2 )
<< "\n\n";
errStream->stream() << "Run with -? for usage\n\n" << std::flush;
return UnspecifiedErrorExitCode;
}
if( m_configData.showHelp )
showHelp();
if( m_configData.libIdentify )
libIdentify();
m_config.reset();
return 0;
}
#if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
int Session::applyCommandLine( int argc, wchar_t const * const * argv ) {
char **utf8Argv = new char *[ argc ];
for ( int i = 0; i < argc; ++i ) {
int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, nullptr, 0, nullptr, nullptr );
utf8Argv[ i ] = new char[ bufSize ];
WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, nullptr, nullptr );
}
int returnCode = applyCommandLine( argc, utf8Argv );
for ( int i = 0; i < argc; ++i )
delete [] utf8Argv[ i ];
delete [] utf8Argv;
return returnCode;
}
#endif
void Session::useConfigData( ConfigData const& configData ) {
m_configData = configData;
m_config.reset();
}
int Session::run() {
if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) {
Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush;
static_cast<void>(std::getchar());
}
int exitCode = runInternal();
if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) {
Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << '\n' << std::flush;
static_cast<void>(std::getchar());
}
return exitCode;
}
Clara::Parser const& Session::cli() const {
return m_cli;
}
void Session::cli( Clara::Parser const& newParser ) {
m_cli = newParser;
}
ConfigData& Session::configData() {
return m_configData;
}
Config& Session::config() {
if( !m_config )
m_config = Detail::make_unique<Config>( m_configData );
return *m_config;
}
int Session::runInternal() {
if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; }
if (m_configData.showHelp || m_configData.libIdentify) {
return 0;
}
if ( m_configData.shardIndex >= m_configData.shardCount ) {
Catch::cerr() << "The shard count (" << m_configData.shardCount
<< ") must be greater than the shard index ("
<< m_configData.shardIndex << ")\n"
<< std::flush;
return UnspecifiedErrorExitCode;
}
CATCH_TRY {
config(); // Force config to be constructed
// We need to retrieve potential Bazel config with the full Config
// constructor, so we have to create the guard file after it is created.
setUpGuardFile( m_config->getExitGuardFilePath() );
seedRng( *m_config );
if (m_configData.filenamesAsTags) {
applyFilenamesAsTags();
}
// Set up global config instance before we start calling into other functions
getCurrentMutableContext().setConfig(m_config.get());
// Create reporter(s) so we can route listings through them
auto reporter = prepareReporters(m_config.get());
auto const& invalidSpecs = m_config->testSpec().getInvalidSpecs();
if ( !invalidSpecs.empty() ) {
for ( auto const& spec : invalidSpecs ) {
reporter->reportInvalidTestSpec( spec );
}
return InvalidTestSpecExitCode;
}
// Handle list request
if (list(*reporter, *m_config)) {
return 0;
}
TestGroup tests { CATCH_MOVE(reporter), m_config.get() };
auto const totals = tests.execute();
// If we got here, running the tests finished normally-enough.
// They might've failed, but that would've been reported elsewhere.
tearDownGuardFile( m_config->getExitGuardFilePath() );
if ( tests.hadUnmatchedTestSpecs()
&& m_config->warnAboutUnmatchedTestSpecs() ) {
return UnmatchedTestSpecExitCode;
}
if ( totals.testCases.total() == 0
&& !m_config->zeroTestsCountAsSuccess() ) {
return NoTestsRunExitCode;
}
if ( totals.testCases.total() > 0 &&
totals.testCases.total() == totals.testCases.skipped
&& !m_config->zeroTestsCountAsSuccess() ) {
return AllTestsSkippedExitCode;
}
if ( totals.assertions.failed ) { return TestFailureExitCode; }
return 0;
}
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
catch( std::exception& ex ) {
Catch::cerr() << ex.what() << '\n' << std::flush;
return UnspecifiedErrorExitCode;
}
#endif
}
} // end namespace Catch
namespace Catch {
RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) {
CATCH_TRY {
getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
} CATCH_CATCH_ALL {
// Do not throw when constructing global objects, instead register the exception to be processed later
getMutableRegistryHub().registerStartupException();
}
}
}
#include <cassert>
#include <cctype>
#include <algorithm>
namespace Catch {
namespace {
using TCP_underlying_type = uint8_t;
static_assert(sizeof(TestCaseProperties) == sizeof(TCP_underlying_type),
"The size of the TestCaseProperties is different from the assumed size");
constexpr TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) {
return static_cast<TestCaseProperties>(
static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs)
);
}
constexpr TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) {
lhs = static_cast<TestCaseProperties>(
static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs)
);
return lhs;
}
constexpr TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) {
return static_cast<TestCaseProperties>(
static_cast<TCP_underlying_type>(lhs) & static_cast<TCP_underlying_type>(rhs)
);
}
constexpr bool applies(TestCaseProperties tcp) {
static_assert(static_cast<TCP_underlying_type>(TestCaseProperties::None) == 0,
"TestCaseProperties::None must be equal to 0");
return tcp != TestCaseProperties::None;
}
TestCaseProperties parseSpecialTag( StringRef tag ) {
if( !tag.empty() && tag[0] == '.' )
return TestCaseProperties::IsHidden;
else if( tag == "!throws"_sr )
return TestCaseProperties::Throws;
else if( tag == "!shouldfail"_sr )
return TestCaseProperties::ShouldFail;
else if( tag == "!mayfail"_sr )
return TestCaseProperties::MayFail;
else if( tag == "!nonportable"_sr )
return TestCaseProperties::NonPortable;
else if( tag == "!benchmark"_sr )
return TestCaseProperties::Benchmark | TestCaseProperties::IsHidden;
else
return TestCaseProperties::None;
}
bool isReservedTag( StringRef tag ) {
return parseSpecialTag( tag ) == TestCaseProperties::None
&& tag.size() > 0
&& !std::isalnum( static_cast<unsigned char>(tag[0]) );
}
void enforceNotReservedTag( StringRef tag, SourceLineInfo const& _lineInfo ) {
CATCH_ENFORCE( !isReservedTag(tag),
"Tag name: [" << tag << "] is not allowed.\n"
<< "Tag names starting with non alphanumeric characters are reserved\n"
<< _lineInfo );
}
std::string makeDefaultName() {
static size_t counter = 0;
return "Anonymous test case " + std::to_string(++counter);
}
constexpr StringRef extractFilenamePart(StringRef filename) {
size_t lastDot = filename.size();
while (lastDot > 0 && filename[lastDot - 1] != '.') {
--lastDot;
}
// In theory we could have filename without any extension in it
if ( lastDot == 0 ) { return StringRef(); }
--lastDot;
size_t nameStart = lastDot;
while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') {
--nameStart;
}
return filename.substr(nameStart, lastDot - nameStart);
}
// Returns the upper bound on size of extra tags ([#file]+[.])
constexpr size_t sizeOfExtraTags(StringRef filepath) {
// [.] is 3, [#] is another 3
const size_t extras = 3 + 3;
return extractFilenamePart(filepath).size() + extras;
}
} // end unnamed namespace
bool operator<( Tag const& lhs, Tag const& rhs ) {
Detail::CaseInsensitiveLess cmp;
return cmp( lhs.original, rhs.original );
}
bool operator==( Tag const& lhs, Tag const& rhs ) {
Detail::CaseInsensitiveEqualTo cmp;
return cmp( lhs.original, rhs.original );
}
Detail::unique_ptr<TestCaseInfo>
makeTestCaseInfo(StringRef _className,
NameAndTags const& nameAndTags,
SourceLineInfo const& _lineInfo ) {
return Detail::make_unique<TestCaseInfo>(_className, nameAndTags, _lineInfo);
}
TestCaseInfo::TestCaseInfo(StringRef _className,
NameAndTags const& _nameAndTags,
SourceLineInfo const& _lineInfo):
name( _nameAndTags.name.empty() ? makeDefaultName() : _nameAndTags.name ),
className( _className ),
lineInfo( _lineInfo )
{
StringRef originalTags = _nameAndTags.tags;
// We need to reserve enough space to store all of the tags
// (including optional hidden tag and filename tag)
auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file);
backingTags.reserve(requiredSize);
// We cannot copy the tags directly, as we need to normalize
// some tags, so that [.foo] is copied as [.][foo].
size_t tagStart = 0;
size_t tagEnd = 0;
bool inTag = false;
for (size_t idx = 0; idx < originalTags.size(); ++idx) {
auto c = originalTags[idx];
if (c == '[') {
CATCH_ENFORCE(
!inTag,
"Found '[' inside a tag while registering test case '"
<< _nameAndTags.name << "' at " << _lineInfo );
inTag = true;
tagStart = idx;
}
if (c == ']') {
CATCH_ENFORCE(
inTag,
"Found unmatched ']' while registering test case '"
<< _nameAndTags.name << "' at " << _lineInfo );
inTag = false;
tagEnd = idx;
assert(tagStart < tagEnd);
// We need to check the tag for special meanings, copy
// it over to backing storage and actually reference the
// backing storage in the saved tags
StringRef tagStr = originalTags.substr(tagStart+1, tagEnd - tagStart - 1);
CATCH_ENFORCE( !tagStr.empty(),
"Found an empty tag while registering test case '"
<< _nameAndTags.name << "' at "
<< _lineInfo );
enforceNotReservedTag(tagStr, lineInfo);
properties |= parseSpecialTag(tagStr);
// When copying a tag to the backing storage, we need to
// check if it is a merged hide tag, such as [.foo], and
// if it is, we need to handle it as if it was [foo].
if (tagStr.size() > 1 && tagStr[0] == '.') {
tagStr = tagStr.substr(1, tagStr.size() - 1);
}
// We skip over dealing with the [.] tag, as we will add
// it later unconditionally and then sort and unique all
// the tags.
internalAppendTag(tagStr);
}
}
CATCH_ENFORCE( !inTag,
"Found an unclosed tag while registering test case '"
<< _nameAndTags.name << "' at " << _lineInfo );
// Add [.] if relevant
if (isHidden()) {
internalAppendTag("."_sr);
}
// Sort and prepare tags
std::sort(begin(tags), end(tags));
tags.erase(std::unique(begin(tags), end(tags)),
end(tags));
}
bool TestCaseInfo::isHidden() const {
return applies( properties & TestCaseProperties::IsHidden );
}
bool TestCaseInfo::throws() const {
return applies( properties & TestCaseProperties::Throws );
}
bool TestCaseInfo::okToFail() const {
return applies( properties & (TestCaseProperties::ShouldFail | TestCaseProperties::MayFail ) );
}
bool TestCaseInfo::expectedToFail() const {
return applies( properties & (TestCaseProperties::ShouldFail) );
}
void TestCaseInfo::addFilenameTag() {
std::string combined("#");
combined += extractFilenamePart(lineInfo.file);
internalAppendTag(combined);
}
std::string TestCaseInfo::tagsAsString() const {
std::string ret;
// '[' and ']' per tag
std::size_t full_size = 2 * tags.size();
for (const auto& tag : tags) {
full_size += tag.original.size();
}
ret.reserve(full_size);
for (const auto& tag : tags) {
ret.push_back('[');
ret += tag.original;
ret.push_back(']');
}
return ret;
}
void TestCaseInfo::internalAppendTag(StringRef tagStr) {
backingTags += '[';
const auto backingStart = backingTags.size();
backingTags += tagStr;
const auto backingEnd = backingTags.size();
backingTags += ']';
tags.emplace_back(StringRef(backingTags.c_str() + backingStart, backingEnd - backingStart));
}
bool operator<( TestCaseInfo const& lhs, TestCaseInfo const& rhs ) {
// We want to avoid redoing the string comparisons multiple times,
// so we store the result of a three-way comparison before using
// it in the actual comparison logic.
const auto cmpName = lhs.name.compare( rhs.name );
if ( cmpName != 0 ) {
return cmpName < 0;
}
const auto cmpClassName = lhs.className.compare( rhs.className );
if ( cmpClassName != 0 ) {
return cmpClassName < 0;
}
return lhs.tags < rhs.tags;
}
} // end namespace Catch
#include <algorithm>
#include <string>
#include <vector>
#include <ostream>
namespace Catch {
TestSpec::Pattern::Pattern( std::string const& name )
: m_name( name )
{}
TestSpec::Pattern::~Pattern() = default;
std::string const& TestSpec::Pattern::name() const {
return m_name;
}
TestSpec::NamePattern::NamePattern( std::string const& name, std::string const& filterString )
: Pattern( filterString )
, m_wildcardPattern( toLower( name ), CaseSensitive::No )
{}
bool TestSpec::NamePattern::matches( TestCaseInfo const& testCase ) const {
return m_wildcardPattern.matches( testCase.name );
}
void TestSpec::NamePattern::serializeTo( std::ostream& out ) const {
out << '"' << name() << '"';
}
TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString )
: Pattern( filterString )
, m_tag( tag )
{}
bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const {
return std::find( begin( testCase.tags ),
end( testCase.tags ),
Tag( m_tag ) ) != end( testCase.tags );
}
void TestSpec::TagPattern::serializeTo( std::ostream& out ) const {
out << name();
}
bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const {
bool should_use = !testCase.isHidden();
for (auto const& pattern : m_required) {
should_use = true;
if (!pattern->matches(testCase)) {
return false;
}
}
for (auto const& pattern : m_forbidden) {
if (pattern->matches(testCase)) {
return false;
}
}
return should_use;
}
void TestSpec::Filter::serializeTo( std::ostream& out ) const {
bool first = true;
for ( auto const& pattern : m_required ) {
if ( !first ) {
out << ' ';
}
out << *pattern;
first = false;
}
for ( auto const& pattern : m_forbidden ) {
if ( !first ) {
out << ' ';
}
out << *pattern;
first = false;
}
}
std::string TestSpec::extractFilterName( Filter const& filter ) {
Catch::ReusableStringStream sstr;
sstr << filter;
return sstr.str();
}
bool TestSpec::hasFilters() const {
return !m_filters.empty();
}
bool TestSpec::matches( TestCaseInfo const& testCase ) const {
return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } );
}
TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const {
Matches matches;
matches.reserve( m_filters.size() );
for ( auto const& filter : m_filters ) {
std::vector<TestCaseHandle const*> currentMatches;
for ( auto const& test : testCases )
if ( isThrowSafe( test, config ) &&
filter.matches( test.getTestCaseInfo() ) )
currentMatches.emplace_back( &test );
matches.push_back(
FilterMatch{ extractFilterName( filter ), currentMatches } );
}
return matches;
}
const TestSpec::vectorStrings& TestSpec::getInvalidSpecs() const {
return m_invalidSpecs;
}
void TestSpec::serializeTo( std::ostream& out ) const {
bool first = true;
for ( auto const& filter : m_filters ) {
if ( !first ) {
out << ',';
}
out << filter;
first = false;
}
}
}
#include <chrono>
namespace Catch {
namespace {
static auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
}
} // end unnamed namespace
void Timer::start() {
m_nanoseconds = getCurrentNanosecondsSinceEpoch();
}
auto Timer::getElapsedNanoseconds() const -> uint64_t {
return getCurrentNanosecondsSinceEpoch() - m_nanoseconds;
}
auto Timer::getElapsedMicroseconds() const -> uint64_t {
return getElapsedNanoseconds()/1000;
}
auto Timer::getElapsedMilliseconds() const -> unsigned int {
return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
}
auto Timer::getElapsedSeconds() const -> double {
return static_cast<double>(getElapsedMicroseconds())/1000000.0;
}
} // namespace Catch
#include <iomanip>
namespace Catch {
namespace Detail {
namespace {
const int hexThreshold = 255;
struct Endianness {
enum Arch : uint8_t {
Big,
Little
};
static Arch which() {
int one = 1;
// If the lowest byte we read is non-zero, we can assume
// that little endian format is used.
auto value = *reinterpret_cast<char*>(&one);
return value ? Little : Big;
}
};
template<typename T>
std::string fpToString(T value, int precision) {
if (Catch::isnan(value)) {
return "nan";
}
ReusableStringStream rss;
rss << std::setprecision(precision)
<< std::fixed
<< value;
std::string d = rss.str();
std::size_t i = d.find_last_not_of('0');
if (i != std::string::npos && i != d.size() - 1) {
if (d[i] == '.')
i++;
d = d.substr(0, i + 1);
}
return d;
}
} // end unnamed namespace
std::size_t catch_strnlen( const char* str, std::size_t n ) {
auto ret = std::char_traits<char>::find( str, n, '\0' );
if ( ret != nullptr ) { return static_cast<std::size_t>( ret - str ); }
return n;
}
std::string formatTimeT(std::time_t time) {
#ifdef _MSC_VER
std::tm timeInfo = {};
const auto err = gmtime_s( &timeInfo, &time );
if ( err ) {
return "gmtime from provided timepoint has failed. This "
"happens e.g. with pre-1970 dates using Microsoft libc";
}
#else
std::tm* timeInfo = std::gmtime( &time );
#endif
auto const timeStampSize = sizeof( "2017-01-16T17:06:45Z" );
char timeStamp[timeStampSize];
const char* const fmt = "%Y-%m-%dT%H:%M:%SZ";
#ifdef _MSC_VER
std::strftime( timeStamp, timeStampSize, fmt, &timeInfo );
#else
std::strftime( timeStamp, timeStampSize, fmt, timeInfo );
#endif
return std::string( timeStamp, timeStampSize - 1 );
}
std::string convertIntoString(StringRef string, bool escapeInvisibles) {
std::string ret;
// This is enough for the "don't escape invisibles" case, and a good
// lower bound on the "escape invisibles" case.
ret.reserve( string.size() + 2 );
if ( !escapeInvisibles ) {
ret += '"';
ret += string;
ret += '"';
return ret;
}
size_t last_start = 0;
auto write_to = [&]( size_t idx ) {
if ( last_start < idx ) {
ret += string.substr( last_start, idx - last_start );
}
last_start = idx + 1;
};
ret += '"';
for ( size_t i = 0; i < string.size(); ++i ) {
const char c = string[i];
if ( c == '\r' || c == '\n' || c == '\t' || c == '\f' ) {
write_to( i );
if ( c == '\r' ) { ret.append( "\\r" ); }
if ( c == '\n' ) { ret.append( "\\n" ); }
if ( c == '\t' ) { ret.append( "\\t" ); }
if ( c == '\f' ) { ret.append( "\\f" ); }
}
}
write_to( string.size() );
ret += '"';
return ret;
}
std::string convertIntoString(StringRef string) {
return convertIntoString(string, getCurrentContext().getConfig()->showInvisibles());
}
std::string rawMemoryToString( const void *object, std::size_t size ) {
// Reverse order for little endian architectures
int i = 0, end = static_cast<int>( size ), inc = 1;
if( Endianness::which() == Endianness::Little ) {
i = end-1;
end = inc = -1;
}
unsigned char const *bytes = static_cast<unsigned char const *>(object);
ReusableStringStream rss;
rss << "0x" << std::setfill('0') << std::hex;
for( ; i != end; i += inc )
rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
return rss.str();
}
std::string makeExceptionHappenedString() {
return "{ stringification failed with an exception: \"" +
translateActiveException() + "\" }";
}
} // end Detail namespace
//// ======================================================= ////
//
// Out-of-line defs for full specialization of StringMaker
//
//// ======================================================= ////
std::string StringMaker<std::string>::convert(const std::string& str) {
return Detail::convertIntoString( str );
}
#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
std::string StringMaker<std::string_view>::convert(std::string_view str) {
return Detail::convertIntoString( StringRef( str.data(), str.size() ) );
}
#endif
std::string StringMaker<char const*>::convert(char const* str) {
if (str) {
return Detail::convertIntoString( str );
} else {
return{ "{null string}" };
}
}
std::string StringMaker<char*>::convert(char* str) { // NOLINT(readability-non-const-parameter)
if (str) {
return Detail::convertIntoString( str );
} else {
return{ "{null string}" };
}
}
#ifdef CATCH_CONFIG_WCHAR
std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
std::string s;
s.reserve(wstr.size());
for (auto c : wstr) {
s += (c <= 0xff) ? static_cast<char>(c) : '?';
}
return ::Catch::Detail::stringify(s);
}
# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
std::string StringMaker<std::wstring_view>::convert(std::wstring_view str) {
return StringMaker<std::wstring>::convert(std::wstring(str));
}
# endif
std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
if (str) {
return ::Catch::Detail::stringify(std::wstring{ str });
} else {
return{ "{null string}" };
}
}
std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
if (str) {
return ::Catch::Detail::stringify(std::wstring{ str });
} else {
return{ "{null string}" };
}
}
#endif
#if defined(CATCH_CONFIG_CPP17_BYTE)
#include <cstddef>
std::string StringMaker<std::byte>::convert(std::byte value) {
return ::Catch::Detail::stringify(std::to_integer<unsigned long long>(value));
}
#endif // defined(CATCH_CONFIG_CPP17_BYTE)
std::string StringMaker<int>::convert(int value) {
return ::Catch::Detail::stringify(static_cast<long long>(value));
}
std::string StringMaker<long>::convert(long value) {
return ::Catch::Detail::stringify(static_cast<long long>(value));
}
std::string StringMaker<long long>::convert(long long value) {
ReusableStringStream rss;
rss << value;
if (value > Detail::hexThreshold) {
rss << " (0x" << std::hex << value << ')';
}
return rss.str();
}
std::string StringMaker<unsigned int>::convert(unsigned int value) {
return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
}
std::string StringMaker<unsigned long>::convert(unsigned long value) {
return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
}
std::string StringMaker<unsigned long long>::convert(unsigned long long value) {
ReusableStringStream rss;
rss << value;
if (value > Detail::hexThreshold) {
rss << " (0x" << std::hex << value << ')';
}
return rss.str();
}
std::string StringMaker<signed char>::convert(signed char value) {
if (value == '\r') {
return "'\\r'";
} else if (value == '\f') {
return "'\\f'";
} else if (value == '\n') {
return "'\\n'";
} else if (value == '\t') {
return "'\\t'";
} else if ('\0' <= value && value < ' ') {
return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
} else {
char chstr[] = "' '";
chstr[1] = value;
return chstr;
}
}
std::string StringMaker<char>::convert(char c) {
return ::Catch::Detail::stringify(static_cast<signed char>(c));
}
std::string StringMaker<unsigned char>::convert(unsigned char value) {
return ::Catch::Detail::stringify(static_cast<char>(value));
}
int StringMaker<float>::precision = std::numeric_limits<float>::max_digits10;
std::string StringMaker<float>::convert(float value) {
return Detail::fpToString(value, precision) + 'f';
}
int StringMaker<double>::precision = std::numeric_limits<double>::max_digits10;
std::string StringMaker<double>::convert(double value) {
return Detail::fpToString(value, precision);
}
} // end namespace Catch
namespace Catch {
Counts Counts::operator - ( Counts const& other ) const {
Counts diff;
diff.passed = passed - other.passed;
diff.failed = failed - other.failed;
diff.failedButOk = failedButOk - other.failedButOk;
diff.skipped = skipped - other.skipped;
return diff;
}
Counts& Counts::operator += ( Counts const& other ) {
passed += other.passed;
failed += other.failed;
failedButOk += other.failedButOk;
skipped += other.skipped;
return *this;
}
std::uint64_t Counts::total() const {
return passed + failed + failedButOk + skipped;
}
bool Counts::allPassed() const {
return failed == 0 && failedButOk == 0 && skipped == 0;
}
bool Counts::allOk() const {
return failed == 0;
}
Totals Totals::operator - ( Totals const& other ) const {
Totals diff;
diff.assertions = assertions - other.assertions;
diff.testCases = testCases - other.testCases;
return diff;
}
Totals& Totals::operator += ( Totals const& other ) {
assertions += other.assertions;
testCases += other.testCases;
return *this;
}
Totals Totals::delta( Totals const& prevTotals ) const {
Totals diff = *this - prevTotals;
if( diff.assertions.failed > 0 )
++diff.testCases.failed;
else if( diff.assertions.failedButOk > 0 )
++diff.testCases.failedButOk;
else if ( diff.assertions.skipped > 0 )
++ diff.testCases.skipped;
else
++diff.testCases.passed;
return diff;
}
}
namespace Catch {
namespace Detail {
void registerTranslatorImpl(
Detail::unique_ptr<IExceptionTranslator>&& translator ) {
getMutableRegistryHub().registerTranslator(
CATCH_MOVE( translator ) );
}
} // namespace Detail
} // namespace Catch
#include <ostream>
namespace Catch {
Version::Version
( unsigned int _majorVersion,
unsigned int _minorVersion,
unsigned int _patchNumber,
char const * const _branchName,
unsigned int _buildNumber )
: majorVersion( _majorVersion ),
minorVersion( _minorVersion ),
patchNumber( _patchNumber ),
branchName( _branchName ),
buildNumber( _buildNumber )
{}
std::ostream& operator << ( std::ostream& os, Version const& version ) {
os << version.majorVersion << '.'
<< version.minorVersion << '.'
<< version.patchNumber;
// branchName is never null -> 0th char is \0 if it is empty
if (version.branchName[0]) {
os << '-' << version.branchName
<< '.' << version.buildNumber;
}
return os;
}
Version const& libraryVersion() {
static Version version( 3, 13, 0, "", 0 );
return version;
}
}
namespace Catch {
const char* GeneratorException::what() const noexcept {
return m_msg;
}
} // end namespace Catch
namespace Catch {
IGeneratorTracker::~IGeneratorTracker() = default;
namespace Generators {
GeneratorUntypedBase::~GeneratorUntypedBase() = default;
IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo ) {
return getResultCapture().acquireGeneratorTracker( generatorName, lineInfo );
}
IGeneratorTracker* createGeneratorTracker( StringRef generatorName,
SourceLineInfo lineInfo,
GeneratorBasePtr&& generator ) {
return getResultCapture().createGeneratorTracker(
generatorName, lineInfo, CATCH_MOVE( generator ) );
}
} // namespace Generators
} // namespace Catch
#include <random>
namespace Catch {
namespace Generators {
namespace Detail {
std::uint32_t getSeed() { return sharedRng()(); }
} // namespace Detail
struct RandomFloatingGenerator<long double>::PImpl {
PImpl( long double a, long double b, uint32_t seed ):
rng( seed ), dist( a, b ) {}
Catch::SimplePcg32 rng;
std::uniform_real_distribution<long double> dist;
};
RandomFloatingGenerator<long double>::RandomFloatingGenerator(
long double a, long double b, std::uint32_t seed) :
m_pimpl(Catch::Detail::make_unique<PImpl>(a, b, seed)) {
static_cast<void>( next() );
}
RandomFloatingGenerator<long double>::~RandomFloatingGenerator() =
default;
bool RandomFloatingGenerator<long double>::next() {
m_current_number = m_pimpl->dist( m_pimpl->rng );
return true;
}
bool RandomFloatingGenerator<long double>::isFinite() const {
return false;
}
} // namespace Generators
} // namespace Catch
namespace Catch {
namespace Generators {
namespace Detail {
[[noreturn]]
void throw_generator_exception( char const* msg ) {
Catch::throw_exception( GeneratorException{ msg } );
}
} // namespace Detail
} // namespace Generators
} // namespace Catch
namespace Catch {
namespace Detail {
void missingCaptureInstance() {
CATCH_INTERNAL_ERROR( "No result capture instance" );
}
} // namespace Detail
IResultCapture::~IResultCapture() = default;
} // namespace Catch
namespace Catch {
IConfig::~IConfig() = default;
}
namespace Catch {
IExceptionTranslator::~IExceptionTranslator() = default;
IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default;
}
#include <string>
namespace Catch {
namespace Generators {
bool GeneratorUntypedBase::countedNext() {
auto ret = next();
if ( ret ) {
m_stringReprCache.clear();
++m_currentElementIndex;
}
return ret;
}
void GeneratorUntypedBase::skipToNthElementImpl( std::size_t n ) {
for ( size_t i = m_currentElementIndex; i < n; ++i ) {
bool isValid = next();
if ( !isValid ) {
Detail::throw_generator_exception(
"Coud not jump to Nth element: not enough elements" );
}
}
}
void GeneratorUntypedBase::skipToNthElement( std::size_t n ) {
if ( n < m_currentElementIndex ) {
Detail::throw_generator_exception(
"Tried to jump generator backwards" );
}
if ( n == m_currentElementIndex ) { return; }
skipToNthElementImpl(n);
// Fixup tracking after moving the generator forward
// * Ensure that the correct element index is set after skipping
// * Invalidate cache
m_currentElementIndex = n;
m_stringReprCache.clear();
}
StringRef GeneratorUntypedBase::currentElementAsString() const {
if ( m_stringReprCache.empty() ) {
m_stringReprCache = stringifyImpl();
}
return m_stringReprCache;
}
bool GeneratorUntypedBase::isFinite() const { return true; }
} // namespace Generators
} // namespace Catch
namespace Catch {
IRegistryHub::~IRegistryHub() = default;
IMutableRegistryHub::~IMutableRegistryHub() = default;
}
#include <cassert>
namespace Catch {
ReporterConfig::ReporterConfig(
IConfig const* _fullConfig,
Detail::unique_ptr<IStream> _stream,
ColourMode colourMode,
std::map<std::string, std::string> customOptions ):
m_stream( CATCH_MOVE(_stream) ),
m_fullConfig( _fullConfig ),
m_colourMode( colourMode ),
m_customOptions( CATCH_MOVE( customOptions ) ) {}
Detail::unique_ptr<IStream> ReporterConfig::takeStream() && {
assert( m_stream );
return CATCH_MOVE( m_stream );
}
IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; }
ColourMode ReporterConfig::colourMode() const { return m_colourMode; }
std::map<std::string, std::string> const&
ReporterConfig::customOptions() const {
return m_customOptions;
}
ReporterConfig::~ReporterConfig() = default;
AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
std::vector<MessageInfo> const& _infoMessages,
Totals const& _totals )
: assertionResult( _assertionResult ),
infoMessages( _infoMessages ),
totals( _totals )
{
if( assertionResult.hasMessage() ) {
// Copy message into messages list.
// !TBD This should have been done earlier, somewhere
MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() );
builder.m_info.message = static_cast<std::string>(assertionResult.getMessage());
infoMessages.push_back( CATCH_MOVE(builder.m_info) );
}
}
SectionStats::SectionStats( SectionInfo&& _sectionInfo,
Counts const& _assertions,
double _durationInSeconds,
bool _missingAssertions )
: sectionInfo( CATCH_MOVE(_sectionInfo) ),
assertions( _assertions ),
durationInSeconds( _durationInSeconds ),
missingAssertions( _missingAssertions )
{}
TestCaseStats::TestCaseStats( TestCaseInfo const& _testInfo,
Totals const& _totals,
std::string&& _stdOut,
std::string&& _stdErr,
bool _aborting )
: testInfo( &_testInfo ),
totals( _totals ),
stdOut( CATCH_MOVE(_stdOut) ),
stdErr( CATCH_MOVE(_stdErr) ),
aborting( _aborting )
{}
TestRunStats::TestRunStats( TestRunInfo const& _runInfo,
Totals const& _totals,
bool _aborting )
: runInfo( _runInfo ),
totals( _totals ),
aborting( _aborting )
{}
IEventListener::~IEventListener() = default;
} // end namespace Catch
namespace Catch {
IReporterFactory::~IReporterFactory() = default;
EventListenerFactory::~EventListenerFactory() = default;
}
namespace Catch {
ITestCaseRegistry::~ITestCaseRegistry() = default;
}
namespace Catch {
AssertionHandler::AssertionHandler
( StringRef macroName,
SourceLineInfo const& lineInfo,
StringRef capturedExpression,
ResultDisposition::Flags resultDisposition )
: m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
m_resultCapture( getResultCapture() )
{
m_resultCapture.notifyAssertionStarted( m_assertionInfo );
}
void AssertionHandler::handleExpr( ITransientExpression const& expr ) {
m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction );
}
void AssertionHandler::handleMessage(ResultWas::OfType resultType, std::string&& message) {
m_resultCapture.handleMessage( m_assertionInfo, resultType, CATCH_MOVE(message), m_reaction );
}
auto AssertionHandler::allowThrows() const -> bool {
return getCurrentContext().getConfig()->allowThrows();
}
void AssertionHandler::complete() {
m_completed = true;
if( m_reaction.shouldDebugBreak ) {
// If you find your debugger stopping you here then go one level up on the
// call-stack for the code that caused it (typically a failed assertion)
// (To go back to the test and change execution, jump over the throw, next)
CATCH_BREAK_INTO_DEBUGGER();
}
if (m_reaction.shouldThrow) {
throw_test_failure_exception();
}
if ( m_reaction.shouldSkip ) {
throw_test_skip_exception();
}
}
void AssertionHandler::handleUnexpectedInflightException() {
m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
}
void AssertionHandler::handleExceptionThrownAsExpected() {
m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
}
void AssertionHandler::handleExceptionNotThrownAsExpected() {
m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
}
void AssertionHandler::handleUnexpectedExceptionNotThrown() {
m_resultCapture.handleUnexpectedExceptionNotThrown( m_assertionInfo, m_reaction );
}
void AssertionHandler::handleThrowingCallSkipped() {
m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
}
// This is the overload that takes a string and infers the Equals matcher from it
// The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str ) {
handleExceptionMatchExpr( handler, Matchers::Equals( str ) );
}
} // namespace Catch
#include <algorithm>
namespace Catch {
namespace Detail {
bool CaseInsensitiveLess::operator()( StringRef lhs,
StringRef rhs ) const {
return std::lexicographical_compare(
lhs.begin(), lhs.end(),
rhs.begin(), rhs.end(),
[]( char l, char r ) { return toLower( l ) < toLower( r ); } );
}
bool
CaseInsensitiveEqualTo::operator()( StringRef lhs,
StringRef rhs ) const {
return std::equal(
lhs.begin(), lhs.end(),
rhs.begin(), rhs.end(),
[]( char l, char r ) { return toLower( l ) == toLower( r ); } );
}
} // namespace Detail
} // namespace Catch
#include <algorithm>
#include <ostream>
namespace {
bool isOptPrefix( char c ) {
return c == '-'
#ifdef CATCH_PLATFORM_WINDOWS
|| c == '/'
#endif
;
}
Catch::StringRef normaliseOpt( Catch::StringRef optName ) {
if ( optName[0] == '-'
#if defined(CATCH_PLATFORM_WINDOWS)
|| optName[0] == '/'
#endif
) {
return optName.substr( 1, optName.size() );
}
return optName;
}
static size_t find_first_separator(Catch::StringRef sr) {
auto is_separator = []( char c ) {
return c == ' ' || c == ':' || c == '=';
};
size_t pos = 0;
while (pos < sr.size()) {
if (is_separator(sr[pos])) { return pos; }
++pos;
}
return Catch::StringRef::npos;
}
} // namespace
namespace Catch {
namespace Clara {
namespace Detail {
void TokenStream::loadBuffer() {
m_tokenBuffer.clear();
// Skip any empty strings
while ( it != itEnd && it->empty() ) {
++it;
}
if ( it != itEnd ) {
StringRef next = *it;
if ( isOptPrefix( next[0] ) ) {
auto delimiterPos = find_first_separator(next);
if ( delimiterPos != StringRef::npos ) {
m_tokenBuffer.push_back(
{ TokenType::Option,
next.substr( 0, delimiterPos ) } );
m_tokenBuffer.push_back(
{ TokenType::Argument,
next.substr( delimiterPos + 1, next.size() ) } );
} else {
if ( next.size() > 1 && next[1] != '-' && next.size() > 2 ) {
// Combined short args, e.g. "-ab" for "-a -b"
for ( size_t i = 1; i < next.size(); ++i ) {
m_tokenBuffer.push_back(
{ TokenType::Option,
next.substr( i, 1 ) } );
}
} else {
m_tokenBuffer.push_back(
{ TokenType::Option, next } );
}
}
} else {
m_tokenBuffer.push_back(
{ TokenType::Argument, next } );
}
}
}
TokenStream::TokenStream( Args const& args ):
TokenStream( args.m_args.begin(), args.m_args.end() ) {}
TokenStream::TokenStream( Iterator it_, Iterator itEnd_ ):
it( it_ ), itEnd( itEnd_ ) {
loadBuffer();
}
TokenStream& TokenStream::operator++() {
if ( m_tokenBuffer.size() >= 2 ) {
m_tokenBuffer.erase( m_tokenBuffer.begin() );
} else {
if ( it != itEnd )
++it;
loadBuffer();
}
return *this;
}
ParserResult convertInto( std::string const& source,
std::string& target ) {
target = source;
return ParserResult::ok( ParseResultType::Matched );
}
ParserResult convertInto( std::string const& source,
bool& target ) {
std::string srcLC = toLower( source );
if ( srcLC == "y" || srcLC == "1" || srcLC == "true" ||
srcLC == "yes" || srcLC == "on" ) {
target = true;
} else if ( srcLC == "n" || srcLC == "0" || srcLC == "false" ||
srcLC == "no" || srcLC == "off" ) {
target = false;
} else {
return ParserResult::runtimeError(
"Expected a boolean value but did not recognise: '" +
source + '\'' );
}
return ParserResult::ok( ParseResultType::Matched );
}
size_t ParserBase::cardinality() const { return 1; }
InternalParseResult ParserBase::parse( Args const& args ) const {
return parse( static_cast<std::string>(args.exeName()), TokenStream( args ) );
}
ParseState::ParseState( ParseResultType type,
TokenStream remainingTokens ):
m_type( type ), m_remainingTokens( CATCH_MOVE(remainingTokens) ) {}
ParserResult BoundFlagRef::setFlag( bool flag ) {
m_ref = flag;
return ParserResult::ok( ParseResultType::Matched );
}
ResultBase::~ResultBase() = default;
bool BoundRef::isContainer() const { return false; }
bool BoundRef::isFlag() const { return false; }
bool BoundFlagRefBase::isFlag() const { return true; }
} // namespace Detail
Detail::InternalParseResult Arg::parse(std::string const&,
Detail::TokenStream tokens) const {
auto validationResult = validate();
if (!validationResult)
return Detail::InternalParseResult(validationResult);
auto token = *tokens;
if (token.type != Detail::TokenType::Argument)
return Detail::InternalParseResult::ok(Detail::ParseState(
ParseResultType::NoMatch, CATCH_MOVE(tokens)));
assert(!m_ref->isFlag());
auto valueRef =
static_cast<Detail::BoundValueRefBase*>(m_ref.get());
auto result = valueRef->setValue(static_cast<std::string>(token.token));
if ( !result )
return Detail::InternalParseResult( result );
else
return Detail::InternalParseResult::ok(
Detail::ParseState( ParseResultType::Matched,
CATCH_MOVE( ++tokens ) ) );
}
Opt::Opt(bool& ref) :
ParserRefImpl(std::make_shared<Detail::BoundFlagRef>(ref)) {}
Detail::HelpColumns Opt::getHelpColumns() const {
ReusableStringStream oss;
bool first = true;
for (auto const& opt : m_optNames) {
if (first)
first = false;
else
oss << ", ";
oss << opt;
}
if (!m_hint.empty())
oss << " <" << m_hint << '>';
return { oss.str(), m_description };
}
bool Opt::isMatch(StringRef optToken) const {
auto normalisedToken = normaliseOpt(optToken);
for (auto const& name : m_optNames) {
if (normaliseOpt(name) == normalisedToken)
return true;
}
return false;
}
Detail::InternalParseResult Opt::parse(std::string const&,
Detail::TokenStream tokens) const {
auto validationResult = validate();
if (!validationResult)
return Detail::InternalParseResult(validationResult);
if (tokens &&
tokens->type == Detail::TokenType::Option) {
auto const& token = *tokens;
if (isMatch(token.token)) {
if (m_ref->isFlag()) {
auto flagRef =
static_cast<Detail::BoundFlagRefBase*>(
m_ref.get());
auto result = flagRef->setFlag(true);
if (!result)
return Detail::InternalParseResult(result);
if (result.value() ==
ParseResultType::ShortCircuitAll)
return Detail::InternalParseResult::ok(Detail::ParseState(
result.value(), CATCH_MOVE(tokens)));
} else {
auto valueRef =
static_cast<Detail::BoundValueRefBase*>(
m_ref.get());
++tokens;
if (!tokens)
return Detail::InternalParseResult::runtimeError(
"Expected argument following " +
token.token);
auto const& argToken = *tokens;
if (argToken.type != Detail::TokenType::Argument)
return Detail::InternalParseResult::runtimeError(
"Expected argument following " +
token.token);
const auto result = valueRef->setValue(static_cast<std::string>(argToken.token));
if (!result)
return Detail::InternalParseResult(result);
if (result.value() ==
ParseResultType::ShortCircuitAll)
return Detail::InternalParseResult::ok(Detail::ParseState(
result.value(), CATCH_MOVE(tokens)));
}
return Detail::InternalParseResult::ok(Detail::ParseState(
ParseResultType::Matched, CATCH_MOVE(++tokens)));
}
}
return Detail::InternalParseResult::ok(
Detail::ParseState(ParseResultType::NoMatch, CATCH_MOVE(tokens)));
}
Detail::Result Opt::validate() const {
if (m_optNames.empty())
return Detail::Result::logicError("No options supplied to Opt");
for (auto const& name : m_optNames) {
if (name.empty())
return Detail::Result::logicError(
"Option name cannot be empty");
#ifdef CATCH_PLATFORM_WINDOWS
if (name[0] != '-' && name[0] != '/')
return Detail::Result::logicError(
"Option name must begin with '-' or '/'");
#else
if (name[0] != '-')
return Detail::Result::logicError(
"Option name must begin with '-'");
#endif
}
return ParserRefImpl::validate();
}
ExeName::ExeName() :
m_name(std::make_shared<std::string>("<executable>")) {}
ExeName::ExeName(std::string& ref) : ExeName() {
m_ref = std::make_shared<Detail::BoundValueRef<std::string>>(ref);
}
Detail::InternalParseResult
ExeName::parse(std::string const&,
Detail::TokenStream tokens) const {
return Detail::InternalParseResult::ok(
Detail::ParseState(ParseResultType::NoMatch, CATCH_MOVE(tokens)));
}
ParserResult ExeName::set(std::string const& newName) {
auto lastSlash = newName.find_last_of("\\/");
auto filename = (lastSlash == std::string::npos)
? newName
: newName.substr(lastSlash + 1);
*m_name = filename;
if (m_ref)
return m_ref->setValue(filename);
else
return ParserResult::ok(ParseResultType::Matched);
}
Parser& Parser::operator|=( Parser const& other ) {
m_options.insert( m_options.end(),
other.m_options.begin(),
other.m_options.end() );
m_args.insert(
m_args.end(), other.m_args.begin(), other.m_args.end() );
return *this;
}
std::vector<Detail::HelpColumns> Parser::getHelpColumns() const {
std::vector<Detail::HelpColumns> cols;
cols.reserve( m_options.size() );
for ( auto const& o : m_options ) {
cols.push_back(o.getHelpColumns());
}
return cols;
}
void Parser::writeToStream( std::ostream& os ) const {
if ( !m_exeName.name().empty() ) {
os << "usage:\n"
<< " " << m_exeName.name() << ' ';
bool required = true, first = true;
for ( auto const& arg : m_args ) {
if ( first )
first = false;
else
os << ' ';
if ( arg.isOptional() && required ) {
os << '[';
required = false;
}
os << '<' << arg.hint() << '>';
if ( arg.cardinality() == 0 )
os << " ... ";
}
if ( !required )
os << ']';
if ( !m_options.empty() )
os << " options";
os << "\n\nwhere options are:\n";
}
auto rows = getHelpColumns();
size_t consoleWidth = CATCH_CONFIG_CONSOLE_WIDTH;
size_t optWidth = 0;
for ( auto const& cols : rows )
optWidth = ( std::max )( optWidth, cols.left.size() + 2 );
optWidth = ( std::min )( optWidth, consoleWidth / 2 );
for ( auto& cols : rows ) {
auto row = TextFlow::Column( CATCH_MOVE(cols.left) )
.width( optWidth )
.indent( 2 ) +
TextFlow::Spacer( 4 ) +
TextFlow::Column( static_cast<std::string>(cols.descriptions) )
.width( consoleWidth - 7 - optWidth );
os << row << '\n';
}
}
Detail::Result Parser::validate() const {
for ( auto const& opt : m_options ) {
auto result = opt.validate();
if ( !result )
return result;
}
for ( auto const& arg : m_args ) {
auto result = arg.validate();
if ( !result )
return result;
}
return Detail::Result::ok();
}
Detail::InternalParseResult
Parser::parse( std::string const& exeName,
Detail::TokenStream tokens ) const {
struct ParserInfo {
ParserBase const* parser = nullptr;
size_t count = 0;
};
std::vector<ParserInfo> parseInfos;
parseInfos.reserve( m_options.size() + m_args.size() );
for ( auto const& opt : m_options ) {
parseInfos.push_back( { &opt, 0 } );
}
for ( auto const& arg : m_args ) {
parseInfos.push_back( { &arg, 0 } );
}
m_exeName.set( exeName );
auto result = Detail::InternalParseResult::ok(
Detail::ParseState( ParseResultType::NoMatch, CATCH_MOVE(tokens) ) );
while ( result.value().remainingTokens() ) {
bool tokenParsed = false;
for ( auto& parseInfo : parseInfos ) {
if ( parseInfo.parser->cardinality() == 0 ||
parseInfo.count < parseInfo.parser->cardinality() ) {
result = parseInfo.parser->parse(
exeName, CATCH_MOVE(result).value().remainingTokens() );
if ( !result )
return result;
if ( result.value().type() !=
ParseResultType::NoMatch ) {
tokenParsed = true;
++parseInfo.count;
break;
}
}
}
if ( result.value().type() == ParseResultType::ShortCircuitAll )
return result;
if ( !tokenParsed )
return Detail::InternalParseResult::runtimeError(
"Unrecognised token: " +
result.value().remainingTokens()->token );
}
// !TBD Check missing required options
return result;
}
Args::Args(int argc, char const* const* argv) :
m_exeName(argv[0]), m_args(argv + 1, argv + argc) {}
Args::Args(std::initializer_list<StringRef> args) :
m_exeName(*args.begin()),
m_args(args.begin() + 1, args.end()) {}
Help::Help( bool& showHelpFlag ):
Opt( [&]( bool flag ) {
showHelpFlag = flag;
return ParserResult::ok( ParseResultType::ShortCircuitAll );
} ) {
static_cast<Opt&> ( *this )(
"display usage information" )["-?"]["-h"]["--help"]
.optional();
}
} // namespace Clara
} // namespace Catch
#include <fstream>
#include <string>
namespace Catch {
Clara::Parser makeCommandLineParser( ConfigData& config ) {
using namespace Clara;
auto const setWarning = [&]( std::string const& warning ) {
if ( warning == "NoAssertions" ) {
config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::NoAssertions);
return ParserResult::ok( ParseResultType::Matched );
} else if ( warning == "UnmatchedTestSpec" ) {
config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::UnmatchedTestSpec);
return ParserResult::ok( ParseResultType::Matched );
} else if ( warning == "InfiniteGenerators" ) {
config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::InfiniteGenerator);
return ParserResult::ok( ParseResultType::Matched );
}
return ParserResult ::runtimeError(
"Unrecognised warning option: '" + warning + '\'' );
};
auto const loadTestNamesFromFile = [&]( std::string const& filename ) {
std::ifstream f( filename.c_str() );
if( !f.is_open() )
return ParserResult::runtimeError( "Unable to load input file: '" + filename + '\'' );
std::string line;
while( std::getline( f, line ) ) {
line = trim(line);
if( !line.empty() && !startsWith( line, '#' ) ) {
if( !startsWith( line, '"' ) )
line = '"' + CATCH_MOVE(line) + '"';
config.testsOrTags.push_back( line );
config.testsOrTags.emplace_back( "," );
}
}
//Remove comma in the end
if(!config.testsOrTags.empty())
config.testsOrTags.erase( config.testsOrTags.end()-1 );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setTestOrder = [&]( std::string const& order ) {
if( startsWith( "declared", order ) )
config.runOrder = TestRunOrder::Declared;
else if( startsWith( "lexical", order ) )
config.runOrder = TestRunOrder::LexicographicallySorted;
else if( startsWith( "random", order ) )
config.runOrder = TestRunOrder::Randomized;
else
return ParserResult::runtimeError( "Unrecognised ordering: '" + order + '\'' );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setRngSeed = [&]( std::string const& seed ) {
if( seed == "time" ) {
config.rngSeed = generateRandomSeed(GenerateFrom::Time);
return ParserResult::ok(ParseResultType::Matched);
} else if (seed == "random-device") {
config.rngSeed = generateRandomSeed(GenerateFrom::RandomDevice);
return ParserResult::ok(ParseResultType::Matched);
}
// TODO: ideally we should be parsing uint32_t directly
// fix this later when we add new parse overload
auto parsedSeed = parseUInt( seed, 0 );
if ( !parsedSeed ) {
return ParserResult::runtimeError( "Could not parse '" + seed + "' as seed" );
}
config.rngSeed = *parsedSeed;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setDefaultColourMode = [&]( std::string const& colourMode ) {
Optional<ColourMode> maybeMode = Catch::Detail::stringToColourMode(toLower( colourMode ));
if ( !maybeMode ) {
return ParserResult::runtimeError(
"colour mode must be one of: default, ansi, win32, "
"or none. '" +
colourMode + "' is not recognised" );
}
auto mode = *maybeMode;
if ( !isColourImplAvailable( mode ) ) {
return ParserResult::runtimeError(
"colour mode '" + colourMode +
"' is not supported in this binary" );
}
config.defaultColourMode = mode;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setWaitForKeypress = [&]( std::string const& keypress ) {
auto keypressLc = toLower( keypress );
if (keypressLc == "never")
config.waitForKeypress = WaitForKeypress::Never;
else if( keypressLc == "start" )
config.waitForKeypress = WaitForKeypress::BeforeStart;
else if( keypressLc == "exit" )
config.waitForKeypress = WaitForKeypress::BeforeExit;
else if( keypressLc == "both" )
config.waitForKeypress = WaitForKeypress::BeforeStartAndExit;
else
return ParserResult::runtimeError( "keypress argument must be one of: never, start, exit or both. '" + keypress + "' not recognised" );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setVerbosity = [&]( std::string const& verbosity ) {
auto lcVerbosity = toLower( verbosity );
if( lcVerbosity == "quiet" )
config.verbosity = Verbosity::Quiet;
else if( lcVerbosity == "normal" )
config.verbosity = Verbosity::Normal;
else if( lcVerbosity == "high" )
config.verbosity = Verbosity::High;
else
return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + '\'' );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setReporter = [&]( std::string const& userReporterSpec ) {
if ( userReporterSpec.empty() ) {
return ParserResult::runtimeError( "Received empty reporter spec." );
}
Optional<ReporterSpec> parsed =
parseReporterSpec( userReporterSpec );
if ( !parsed ) {
return ParserResult::runtimeError(
"Could not parse reporter spec '" + userReporterSpec +
"'" );
}
auto const& reporterSpec = *parsed;
auto const& factories =
getRegistryHub().getReporterRegistry().getFactories();
auto result = factories.find( reporterSpec.name() );
if ( result == factories.end() ) {
return ParserResult::runtimeError(
"Unrecognized reporter, '" + reporterSpec.name() +
"'. Check available with --list-reporters" );
}
const bool hadOutputFile = reporterSpec.outputFile().some();
config.reporterSpecifications.push_back( CATCH_MOVE( *parsed ) );
// It would be enough to check this only once at the very end, but
// there is not a place where we could call this check, so do it
// every time it could fail. For valid inputs, this is still called
// at most once.
if (!hadOutputFile) {
int n_reporters_without_file = 0;
for (auto const& spec : config.reporterSpecifications) {
if (spec.outputFile().none()) {
n_reporters_without_file++;
}
}
if (n_reporters_without_file > 1) {
return ParserResult::runtimeError( "Only one reporter may have unspecified output file." );
}
}
return ParserResult::ok( ParseResultType::Matched );
};
auto const setShardCount = [&]( std::string const& shardCount ) {
auto parsedCount = parseUInt( shardCount );
if ( !parsedCount ) {
return ParserResult::runtimeError(
"Could not parse '" + shardCount + "' as shard count" );
}
if ( *parsedCount == 0 ) {
return ParserResult::runtimeError(
"Shard count must be positive" );
}
config.shardCount = *parsedCount;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setBenchmarkSamples = [&]( std::string const& samples ) {
auto parsedSamples = parseUInt( samples );
if ( !parsedSamples ) {
return ParserResult::runtimeError(
"Could not parse '" + samples + "' as benchmark samples" );
}
if ( *parsedSamples == 0 ) {
return ParserResult::runtimeError(
"Benchmark samples must be greater than 0" );
}
config.benchmarkSamples = *parsedSamples;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setShardIndex = [&](std::string const& shardIndex) {
auto parsedIndex = parseUInt( shardIndex );
if ( !parsedIndex ) {
return ParserResult::runtimeError(
"Could not parse '" + shardIndex + "' as shard index" );
}
config.shardIndex = *parsedIndex;
return ParserResult::ok( ParseResultType::Matched );
};
auto const setSectionFilter = [&]( std::string const& sectionFilter ) {
config.pathFilters.emplace_back( PathFilter::For::Section, trim(sectionFilter) );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setGeneratorFilter = [&]( std::string const& generatorFilter ) {
if (generatorFilter != "*") {
// TODO: avoid re-parsing the index?
auto parsedIndex = parseUInt( generatorFilter );
if ( !parsedIndex ) {
return ParserResult::runtimeError( "Could not parse '" +
generatorFilter +
"' as generator index" );
}
}
config.useNewPathFilteringBehaviour = true;
config.pathFilters.emplace_back( PathFilter::For::Generator, trim(generatorFilter) );
return ParserResult::ok( ParseResultType::Matched );
};
// Copy-capturing other `setFoo` functions enables calling them later,
// as the config ref remains valid, but the local lambda vars won't.
auto const setPathFilter = [=, &config]( std::string const& pathFilter ) {
config.useNewPathFilteringBehaviour = true;
if ( pathFilter.size() < 3 ) {
return ParserResult::runtimeError(
"Path filter '" + pathFilter + "' is too short" );
}
if ( startsWith( pathFilter, "g:" ) ) {
return setGeneratorFilter( pathFilter.substr( 2 ) );
}
if ( startsWith( pathFilter, "c:" ) ) {
return setSectionFilter( pathFilter.substr( 2 ) );
}
return ParserResult::runtimeError( "Path filter '" + pathFilter +
"' has unknown type prefix" );
};
auto cli
= ExeName( config.processName )
| Help( config.showHelp )
| Opt( config.showSuccessfulTests )
["-s"]["--success"]
( "include successful tests in output" )
| Opt( config.shouldDebugBreak )
["-b"]["--break"]
( "break into debugger on failure" )
| Opt( config.noThrow )
["-e"]["--nothrow"]
( "skip exception tests" )
| Opt( config.showInvisibles )
["-i"]["--invisibles"]
( "show invisibles (tabs, newlines)" )
| Opt( config.defaultOutputFilename, "filename" )
["-o"]["--out"]
( "default output filename" )
| Opt( accept_many, setReporter, "name[::key=value]*" )
["-r"]["--reporter"]
( "reporter to use (defaults to console)" )
| Opt( config.name, "name" )
["-n"]["--name"]
( "suite name" )
| Opt( [&]( bool ){ config.abortAfter = 1; } )
["-a"]["--abort"]
( "abort at first failure" )
| Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" )
["-x"]["--abortx"]
( "abort after x failures" )
| Opt( accept_many, setWarning, "warning name" )
["-w"]["--warn"]
( "enable warnings" )
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
["-d"]["--durations"]
( "show test durations" )
| Opt( config.minDuration, "seconds" )
["-D"]["--min-duration"]
( "show test durations for tests taking at least the given number of seconds" )
| Opt( loadTestNamesFromFile, "filename" )
["-f"]["--input-file"]
( "load test names to run from a file" )
| Opt( config.filenamesAsTags )
["-#"]["--filenames-as-tags"]
( "adds a tag for the filename" )
| Opt( accept_many, setSectionFilter, "section name" )
["-c"]["--section"]
( "specify section to run" )
| Opt( accept_many, setGeneratorFilter, "index spec" )
["-g"]["--generator-index"]
( "specify generator elements to try" )
| Opt( accept_many, setPathFilter, "path filter spec" )
["-p"]["--path-filter"]
( "qualified path filter" )
| Opt( setVerbosity, "quiet|normal|high" )
["-v"]["--verbosity"]
( "set output verbosity" )
| Opt( config.listTests )
["--list-tests"]
( "list all/matching test cases" )
| Opt( config.listTags )
["--list-tags"]
( "list all/matching tags" )
| Opt( config.listReporters )
["--list-reporters"]
( "list all available reporters" )
| Opt( config.listListeners )
["--list-listeners"]
( "list all listeners" )
| Opt( setTestOrder, "decl|lex|rand" )
["--order"]
( "test case order (defaults to rand)" )
| Opt( setRngSeed, "'time'|'random-device'|number" )
["--rng-seed"]
( "set a specific seed for random numbers" )
| Opt( setDefaultColourMode, "ansi|win32|none|default" )
["--colour-mode"]
( "what color mode should be used as default" )
| Opt( config.libIdentify )
["--libidentify"]
( "report name and version according to libidentify standard" )
| Opt( setWaitForKeypress, "never|start|exit|both" )
["--wait-for-keypress"]
( "waits for a keypress before exiting" )
| Opt( config.skipBenchmarks)
["--skip-benchmarks"]
( "disable running benchmarks")
| Opt( setBenchmarkSamples, "samples" )
["--benchmark-samples"]
( "number of samples to collect (default: 100)" )
| Opt( config.benchmarkResamples, "resamples" )
["--benchmark-resamples"]
( "number of resamples for the bootstrap (default: 100000)" )
| Opt( config.benchmarkConfidenceInterval, "confidence interval" )
["--benchmark-confidence-interval"]
( "confidence interval for the bootstrap (between 0 and 1, default: 0.95)" )
| Opt( config.benchmarkNoAnalysis )
["--benchmark-no-analysis"]
( "perform only measurements; do not perform any analysis" )
| Opt( config.benchmarkWarmupTime, "benchmarkWarmupTime" )
["--benchmark-warmup-time"]
( "amount of time in milliseconds spent on warming up each test (default: 100)" )
| Opt( setShardCount, "shard count" )
["--shard-count"]
( "split the tests to execute into this many groups" )
| Opt( setShardIndex, "shard index" )
["--shard-index"]
( "index of the group of tests to execute (see --shard-count)" )
| Opt( config.allowZeroTests )
["--allow-running-no-tests"]
( "Treat 'No tests run' as a success" )
| Opt( config.prematureExitGuardFilePath, "path" )
["--premature-exit-guard-file"]
( "create a file before running tests and delete it during clean exit" )
| Arg( config.testsOrTags, "test name|pattern|tags" )
( "which test or tests to use" );
return cli;
}
} // end namespace Catch
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wexit-time-destructors"
#endif
#include <cassert>
#include <ostream>
#include <utility>
namespace Catch {
ColourImpl::~ColourImpl() = default;
ColourImpl::ColourGuard ColourImpl::guardColour( Colour::Code colourCode ) {
return ColourGuard(colourCode, this );
}
void ColourImpl::ColourGuard::engageImpl( std::ostream& stream ) {
assert( &stream == &m_colourImpl->m_stream->stream() &&
"Engaging colour guard for different stream than used by the "
"parent colour implementation" );
static_cast<void>( stream );
m_engaged = true;
m_colourImpl->use( m_code );
}
ColourImpl::ColourGuard::ColourGuard( Colour::Code code,
ColourImpl const* colour ):
m_colourImpl( colour ), m_code( code ) {
}
ColourImpl::ColourGuard::ColourGuard( ColourGuard&& rhs ) noexcept:
m_colourImpl( rhs.m_colourImpl ),
m_code( rhs.m_code ),
m_engaged( rhs.m_engaged ) {
rhs.m_engaged = false;
}
ColourImpl::ColourGuard&
ColourImpl::ColourGuard::operator=( ColourGuard&& rhs ) noexcept {
using std::swap;
swap( m_colourImpl, rhs.m_colourImpl );
swap( m_code, rhs.m_code );
swap( m_engaged, rhs.m_engaged );
return *this;
}
ColourImpl::ColourGuard::~ColourGuard() {
if ( m_engaged ) {
m_colourImpl->use( Colour::None );
}
}
ColourImpl::ColourGuard&
ColourImpl::ColourGuard::engage( std::ostream& stream ) & {
engageImpl( stream );
return *this;
}
ColourImpl::ColourGuard&&
ColourImpl::ColourGuard::engage( std::ostream& stream ) && {
engageImpl( stream );
return CATCH_MOVE(*this);
}
namespace {
//! A do-nothing implementation of colour, used as fallback for unknown
//! platforms, and when the user asks to deactivate all colours.
class NoColourImpl final : public ColourImpl {
public:
NoColourImpl( IStream* stream ): ColourImpl( stream ) {}
private:
void use( Colour::Code ) const override {}
};
} // namespace
} // namespace Catch
#if defined ( CATCH_CONFIG_COLOUR_WIN32 ) /////////////////////////////////////////
namespace Catch {
namespace {
class Win32ColourImpl final : public ColourImpl {
public:
Win32ColourImpl(IStream* stream):
ColourImpl(stream) {
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ),
&csbiInfo );
originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
}
static bool useImplementationForStream(IStream const& stream) {
// Win32 text colour APIs can only be used on console streams
// We cannot check that the output hasn't been redirected,
// so we just check that the original stream is console stream.
return stream.isConsole();
}
private:
void use( Colour::Code _colourCode ) const override {
switch( _colourCode ) {
case Colour::None: return setTextAttribute( originalForegroundAttributes );
case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
case Colour::Red: return setTextAttribute( FOREGROUND_RED );
case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE );
case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
case Colour::Grey: return setTextAttribute( 0 );
case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY );
case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
case Colour::BrightYellow: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN );
case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
default:
CATCH_ERROR( "Unknown colour requested" );
}
}
void setTextAttribute( WORD _textAttribute ) const {
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ),
_textAttribute |
originalBackgroundAttributes );
}
WORD originalForegroundAttributes;
WORD originalBackgroundAttributes;
};
} // end anon namespace
} // end namespace Catch
#endif // Windows/ ANSI/ None
#if defined( CATCH_PLATFORM_LINUX ) \
|| defined( CATCH_PLATFORM_MAC ) \
|| defined( __GLIBC__ ) \
|| (defined( __FreeBSD__ ) \
/* PlayStation platform does not have `isatty()` */ \
&& !defined(CATCH_PLATFORM_PLAYSTATION)) \
|| defined( CATCH_PLATFORM_QNX )
# define CATCH_INTERNAL_HAS_ISATTY
# include <unistd.h>
#endif
namespace Catch {
namespace {
class ANSIColourImpl final : public ColourImpl {
public:
ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {}
static bool useImplementationForStream(IStream const& stream) {
// This is kinda messy due to trying to support a bunch of
// different platforms at once.
// The basic idea is that if we are asked to do autodetection (as
// opposed to being told to use posixy colours outright), then we
// only want to use the colours if we are writing to console.
// However, console might be redirected, so we make an attempt at
// checking for that on platforms where we know how to do that.
bool useColour = stream.isConsole();
#if defined( CATCH_INTERNAL_HAS_ISATTY ) && \
!( defined( __DJGPP__ ) && defined( __STRICT_ANSI__ ) )
ErrnoGuard _; // for isatty
useColour = useColour && isatty( STDOUT_FILENO );
# endif
# if defined( CATCH_PLATFORM_MAC ) || defined( CATCH_PLATFORM_IPHONE )
useColour = useColour && !isDebuggerActive();
# endif
return useColour;
}
private:
void use( Colour::Code _colourCode ) const override {
auto setColour = [&out =
m_stream->stream()]( char const* escapeCode ) {
// The escape sequence must be flushed to console, otherwise
// if stdin and stderr are intermixed, we'd get accidentally
// coloured output.
out << '\033' << escapeCode << std::flush;
};
switch( _colourCode ) {
case Colour::None:
case Colour::White: return setColour( "[0m" );
case Colour::Red: return setColour( "[0;31m" );
case Colour::Green: return setColour( "[0;32m" );
case Colour::Blue: return setColour( "[0;34m" );
case Colour::Cyan: return setColour( "[0;36m" );
case Colour::Yellow: return setColour( "[0;33m" );
case Colour::Grey: return setColour( "[1;30m" );
case Colour::LightGrey: return setColour( "[0;37m" );
case Colour::BrightRed: return setColour( "[1;31m" );
case Colour::BrightGreen: return setColour( "[1;32m" );
case Colour::BrightWhite: return setColour( "[1;37m" );
case Colour::BrightYellow: return setColour( "[1;33m" );
case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
default: CATCH_INTERNAL_ERROR( "Unknown colour requested" );
}
}
};
} // end anon namespace
} // end namespace Catch
namespace Catch {
Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode colourSelection,
IStream* stream ) {
#if defined( CATCH_CONFIG_COLOUR_WIN32 )
if ( colourSelection == ColourMode::Win32 ) {
return Detail::make_unique<Win32ColourImpl>( stream );
}
#endif
if ( colourSelection == ColourMode::ANSI ) {
return Detail::make_unique<ANSIColourImpl>( stream );
}
if ( colourSelection == ColourMode::None ) {
return Detail::make_unique<NoColourImpl>( stream );
}
if ( colourSelection == ColourMode::PlatformDefault) {
#if defined( CATCH_CONFIG_COLOUR_WIN32 )
if ( Win32ColourImpl::useImplementationForStream( *stream ) ) {
return Detail::make_unique<Win32ColourImpl>( stream );
}
#endif
if ( ANSIColourImpl::useImplementationForStream( *stream ) ) {
return Detail::make_unique<ANSIColourImpl>( stream );
}
return Detail::make_unique<NoColourImpl>( stream );
}
CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(colourSelection) );
}
bool isColourImplAvailable( ColourMode colourSelection ) {
switch ( colourSelection ) {
#if defined( CATCH_CONFIG_COLOUR_WIN32 )
case ColourMode::Win32:
#endif
case ColourMode::ANSI:
case ColourMode::None:
case ColourMode::PlatformDefault:
return true;
default:
return false;
}
}
} // end namespace Catch
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
namespace Catch {
Context Context::currentContext;
Context& getCurrentMutableContext() {
return Context::currentContext;
}
SimplePcg32& sharedRng() {
static SimplePcg32 s_rng;
return s_rng;
}
}
#include <ostream>
#if defined(CATCH_CONFIG_ANDROID_LOGWRITE)
#include <android/log.h>
namespace Catch {
void writeToDebugConsole( std::string const& text ) {
__android_log_write( ANDROID_LOG_DEBUG, "Catch", text.c_str() );
}
}
#elif defined(CATCH_PLATFORM_WINDOWS)
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
#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
# include <cassert>
# include <sys/types.h>
# include <unistd.h>
# include <cstddef>
# include <ostream>
#ifdef __apple_build_version__
// These headers will only compile with AppleClang (XCode)
// For other compilers (Clang, GCC, ... ) we need to exclude them
# include <sys/sysctl.h>
#endif
namespace Catch {
#ifdef __apple_build_version__
// The following function is taken directly from the following technical note:
// https://developer.apple.com/library/archive/qa/qa1361/_index.html
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).
bool isDebuggerActive(){
int mib[4];
struct kinfo_proc info;
std::size_t size;
// Initialize the flags so that, if sysctl fails for some bizarre
// reason, we get a predictable result.
info.kp_proc.p_flag = 0;
// Initialize mib, which tells sysctl the info we want, in this case
// we're looking for information about a specific process ID.
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid();
// Call sysctl.
size = sizeof(info);
if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, nullptr, 0) != 0 ) {
Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n\n" << std::flush;
return false;
}
// We're being debugged if the P_TRACED flag is set.
return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
}
#else
bool isDebuggerActive() {
// We need to find another way to determine this for non-appleclang compilers on macOS
return false;
}
#endif
} // namespace Catch
#elif defined(CATCH_PLATFORM_LINUX) || defined(CATCH_PLATFORM_QNX)
#include <fstream>
#include <string>
namespace Catch{
// The standard POSIX way of detecting a debugger is to attempt to
// ptrace() the process, but this needs to be done from a child and not
// this process itself to still allow attaching to this process later
// if wanted, so is rather heavy. Under Linux we have the PID of the
// "debugger" (which doesn't need to be gdb, of course, it could also
// be strace, for example) in /proc/$PID/status, so just get it from
// there instead.
bool isDebuggerActive(){
// Libstdc++ has a bug, where std::ifstream sets errno to 0
// This way our users can properly assert over errno values
ErrnoGuard guard;
std::ifstream in("/proc/self/status");
for( std::string line; std::getline(in, line); ) {
static const int PREFIX_LEN = 11;
if( line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0 ) {
// We're traced if the PID is not 0 and no other PID starts
// with 0 digit, so it's enough to check for just a single
// character.
return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0';
}
}
return false;
}
} // namespace Catch
#elif defined(_MSC_VER)
extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
namespace Catch {
bool isDebuggerActive() {
return IsDebuggerPresent() != 0;
}
}
#elif defined(__MINGW32__)
extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
namespace Catch {
bool isDebuggerActive() {
return IsDebuggerPresent() != 0;
}
}
#else
namespace Catch {
bool isDebuggerActive() { return false; }
}
#endif // Platform
namespace Catch {
void ITransientExpression::streamReconstructedExpression(
std::ostream& os ) const {
// We can't make this function pure virtual to keep ITransientExpression
// constexpr, so we write error message instead
os << "Some class derived from ITransientExpression without overriding streamReconstructedExpression";
}
void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
if( lhs.size() + rhs.size() < 40 &&
lhs.find('\n') == std::string::npos &&
rhs.find('\n') == std::string::npos )
os << lhs << ' ' << op << ' ' << rhs;
else
os << lhs << '\n' << op << '\n' << rhs;
}
}
#include <stdexcept>
namespace Catch {
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER)
[[noreturn]]
void throw_exception(std::exception const& e) {
Catch::cerr() << "Catch will terminate because it needed to throw an exception.\n"
<< "The message was: " << e.what() << '\n';
std::terminate();
}
#endif
[[noreturn]]
void throw_logic_error(std::string const& msg) {
throw_exception(std::logic_error(msg));
}
[[noreturn]]
void throw_domain_error(std::string const& msg) {
throw_exception(std::domain_error(msg));
}
[[noreturn]]
void throw_runtime_error(std::string const& msg) {
throw_exception(std::runtime_error(msg));
}
} // namespace Catch;
#include <cassert>
namespace Catch {
IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() = default;
namespace Detail {
namespace {
// Extracts the actual name part of an enum instance
// In other words, it returns the Blue part of Bikeshed::Colour::Blue
StringRef extractInstanceName(StringRef enumInstance) {
// Find last occurrence of ":"
size_t name_start = enumInstance.size();
while (name_start > 0 && enumInstance[name_start - 1] != ':') {
--name_start;
}
return enumInstance.substr(name_start, enumInstance.size() - name_start);
}
}
std::vector<StringRef> parseEnums( StringRef enums ) {
auto enumValues = splitStringRef( enums, ',' );
std::vector<StringRef> parsed;
parsed.reserve( enumValues.size() );
for( auto const& enumValue : enumValues ) {
parsed.push_back(trim(extractInstanceName(enumValue)));
}
return parsed;
}
EnumInfo::~EnumInfo() = default;
StringRef EnumInfo::lookup( int value ) const {
for( auto const& valueToName : m_values ) {
if( valueToName.first == value )
return valueToName.second;
}
return "{** unexpected enum value **}"_sr;
}
Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
auto enumInfo = Catch::Detail::make_unique<EnumInfo>();
enumInfo->m_name = enumName;
enumInfo->m_values.reserve( values.size() );
const auto valueNames = Catch::Detail::parseEnums( allValueNames );
assert( valueNames.size() == values.size() );
std::size_t i = 0;
for( auto value : values )
enumInfo->m_values.emplace_back(value, valueNames[i++]);
return enumInfo;
}
EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
m_enumInfos.push_back(makeEnumInfo(enumName, allValueNames, values));
return *m_enumInfos.back();
}
} // Detail
} // Catch
#include <cerrno>
namespace Catch {
ErrnoGuard::ErrnoGuard():m_oldErrno(errno){}
ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; }
}
#include <exception>
namespace Catch {
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
namespace {
static std::string tryTranslators(
std::vector<
Detail::unique_ptr<IExceptionTranslator const>> const& translators ) {
if ( translators.empty() ) {
std::rethrow_exception( std::current_exception() );
} else {
return translators[0]->translate( translators.begin() + 1,
translators.end() );
}
}
}
#endif //!defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() = default;
void ExceptionTranslatorRegistry::registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) {
m_translators.push_back( CATCH_MOVE( translator ) );
}
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
std::string ExceptionTranslatorRegistry::translateActiveException() const {
// Compiling a mixed mode project with MSVC means that CLR
// exceptions will be caught in (...) as well. However, these do
// do not fill-in std::current_exception and thus lead to crash
// when attempting rethrow.
// /EHa switch also causes structured exceptions to be caught
// here, but they fill-in current_exception properly, so
// at worst the output should be a little weird, instead of
// causing a crash.
if ( std::current_exception() == nullptr ) {
return "Non C++ exception. Possibly a CLR exception.";
}
// First we try user-registered translators. If none of them can
// handle the exception, it will be rethrown handled by our defaults.
try {
return tryTranslators(m_translators);
}
// To avoid having to handle TFE explicit
gitextract_bkhq94ol/
├── .clang-format
├── .github/
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── include/
│ └── keychain/
│ └── keychain.h
├── src/
│ ├── keychain_linux.cpp
│ ├── keychain_mac.cpp
│ └── keychain_win.cpp
└── test/
├── CMakeLists.txt
├── catch_amalgamated.cpp
├── catch_amalgamated.hpp
└── tests.cpp
Copy disabled (too large)
Download .txt
Showing preview only (292,949K chars total). Download the full file to get everything.
SYMBOL INDEX (2034 symbols across 7 files)
FILE: include/keychain/keychain.h
function namespace (line 50) | namespace keychain {
FILE: src/keychain_linux.cpp
function SecretSchema (line 41) | SecretSchema makeSchema(const std::string &package) {
function makeLabel (line 51) | std::string makeLabel(const std::string &service, const std::string &use...
function updateError (line 61) | void updateError(keychain::Error &err, GError *error) {
function setErrorNotFound (line 73) | void setErrorNotFound(keychain::Error &err) {
type keychain (line 81) | namespace keychain {
function setPassword (line 83) | void setPassword(const std::string &package, const std::string &service,
function getPassword (line 108) | std::string getPassword(const std::string &package, const std::string ...
function deletePassword (line 138) | void deletePassword(const std::string &package, const std::string &ser...
function isAvailable (line 161) | bool isAvailable(Error &err) {
FILE: src/keychain_mac.cpp
function CFStringToStdString (line 39) | std::string CFStringToStdString(const CFStringRef cfstring) {
function errorStatusToString (line 58) | std::string errorStatusToString(OSStatus status) {
function makeServiceName (line 70) | std::string makeServiceName(const std::string &package,
function updateError (line 80) | void updateError(keychain::Error &err, OSStatus status) {
function setGenericError (line 106) | void setGenericError(keychain::Error &err, const std::string &errorMessa...
class ScopedCFRef (line 123) | class ScopedCFRef {
method ScopedCFRef (line 125) | explicit ScopedCFRef(T ref) : _ref(ref) {}
method ScopedCFRef (line 128) | ScopedCFRef(ScopedCFRef &&other) noexcept : _ref(other._ref) {
method ScopedCFRef (line 131) | ScopedCFRef &operator=(ScopedCFRef &&other) {
method ScopedCFRef (line 140) | ScopedCFRef(const ScopedCFRef &) = delete;
method ScopedCFRef (line 141) | ScopedCFRef &operator=(const ScopedCFRef &) = delete;
method T (line 143) | const T get() const { return _ref; }
method _release (line 147) | void _release() {
function createCFStringWithCString (line 157) | ScopedCFRef<CFStringRef> createCFStringWithCString(const std::string &str,
function createCFMutableDictionary (line 166) | ScopedCFRef<CFMutableDictionaryRef>
function createCFData (line 178) | ScopedCFRef<CFDataRef> createCFData(const std::string &data,
function createQuery (line 189) | ScopedCFRef<CFMutableDictionaryRef> createQuery(const std::string &servi...
type keychain (line 208) | namespace keychain {
function setPassword (line 210) | void setPassword(const std::string &package, const std::string &service,
function getPassword (line 238) | std::string getPassword(const std::string &package, const std::string ...
function deletePassword (line 261) | void deletePassword(const std::string &package, const std::string &ser...
function isAvailable (line 273) | bool isAvailable(Error &err) {
FILE: src/keychain_win.cpp
type LpwstrDeleter (line 43) | struct LpwstrDeleter {
function ScopedLpwstr (line 55) | ScopedLpwstr utf8ToWideChar(const std::string &utf8) {
function wideCharToAnsi (line 87) | std::string wideCharToAnsi(LPWSTR wChar) {
function getErrorMessage (line 122) | std::string getErrorMessage(DWORD errorCode) {
function updateError (line 141) | void updateError(keychain::Error &err) {
function ScopedLpwstr (line 158) | ScopedLpwstr makeTargetName(const std::string &package,
type keychain (line 178) | namespace keychain {
function setPassword (line 180) | void setPassword(const std::string &package, const std::string &service,
function getPassword (line 216) | std::string getPassword(const std::string &package, const std::string ...
function deletePassword (line 240) | void deletePassword(const std::string &package, const std::string &ser...
function isAvailable (line 253) | bool isAvailable(Error &err) {
FILE: test/catch_amalgamated.cpp
type Catch (line 43) | namespace Catch {
type Benchmark (line 44) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 58) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 129) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 148) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 184) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 362) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
function Approx (line 573) | Approx Approx::custom() {
function Approx (line 577) | Approx Approx::operator-() const {
type literals (line 611) | namespace literals {
function Approx (line 612) | Approx operator ""_a(long double val) {
function Approx (line 615) | Approx operator ""_a(unsigned long long val) {
function StringRef (line 710) | StringRef AssertionResult::getMessage() const {
function SourceLineInfo (line 713) | SourceLineInfo AssertionResult::getSourceInfo() const {
function StringRef (line 717) | StringRef AssertionResult::getTestMacroName() const {
function enableBazelEnvSupport (line 730) | static bool enableBazelEnvSupport() {
type bazelShardingOptions (line 738) | struct bazelShardingOptions {
function readBazelShardingOptions (line 743) | static Optional<bazelShardingOptions> readBazelShardingOptions() {
function TestSpec (line 891) | TestSpec const& Config::testSpec() const { return m_testSpec; }
function StringRef (line 900) | StringRef Config::name() const { return m_data.name.empty() ? m_data.p...
function ShowDurations (line 912) | ShowDurations Config::showDurations() const { return m_data.sho...
function TestRunOrder (line 914) | TestRunOrder Config::runOrder() const { return m_data.run...
function ColourMode (line 918) | ColourMode Config::defaultColourMode() const { return m_data.def...
function Verbosity (line 922) | Verbosity Config::verbosity() const { return m_data.ver...
function getSeed (line 991) | std::uint32_t getSeed() {
class RegistryHub (line 1118) | class RegistryHub : public IRegistryHub,
method RegistryHub (line 1123) | RegistryHub() = default;
method ReporterRegistry (line 1124) | ReporterRegistry const& getReporterRegistry() const override {
method ITestCaseRegistry (line 1127) | ITestCaseRegistry const& getTestCaseRegistry() const override {
method IExceptionTranslatorRegistry (line 1130) | IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry()...
method ITagAliasRegistry (line 1133) | ITagAliasRegistry const& getTagAliasRegistry() const override {
method StartupExceptionRegistry (line 1136) | StartupExceptionRegistry const& getStartupExceptionRegistry() const ...
method registerReporter (line 1141) | void registerReporter( std::string const& name, IReporterFactoryPtr ...
method registerListener (line 1144) | void registerListener( Detail::unique_ptr<EventListenerFactory> fact...
method registerTest (line 1147) | void registerTest( Detail::unique_ptr<TestCaseInfo>&& testInfo, Deta...
method registerTranslator (line 1150) | void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& ...
method registerTagAlias (line 1153) | void registerTagAlias( std::string const& alias, std::string const& ...
method registerStartupException (line 1156) | void registerStartupException() noexcept override {
method IMutableEnumValuesRegistry (line 1163) | IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
function IRegistryHub (line 1179) | IRegistryHub const& getRegistryHub() {
function IMutableRegistryHub (line 1182) | IMutableRegistryHub& getMutableRegistryHub() {
function cleanUp (line 1185) | void cleanUp() {
function translateActiveException (line 1188) | std::string translateActiveException() {
function IEventListenerPtr (line 1207) | IEventListenerPtr createReporter(std::string const& reporterName, Repo...
function IEventListenerPtr (line 1214) | IEventListenerPtr prepareReporters(Config const* config) {
class TestGroup (line 1245) | class TestGroup {
method TestGroup (line 1247) | explicit TestGroup(IEventListenerPtr&& reporter, Config const* config):
method Totals (line 1275) | Totals execute() {
method hadUnmatchedTestSpecs (line 1294) | bool hadUnmatchedTestSpecs() const {
function applyFilenamesAsTags (line 1308) | void applyFilenamesAsTags() {
function setUpGuardFile (line 1316) | void setUpGuardFile( std::string const& guardFilePath ) {
function TestCaseProperties (line 1613) | constexpr TestCaseProperties operator|(TestCaseProperties lhs, TestCas...
function TestCaseProperties (line 1619) | constexpr TestCaseProperties& operator|=(TestCaseProperties& lhs, Test...
function TestCaseProperties (line 1626) | constexpr TestCaseProperties operator&(TestCaseProperties lhs, TestCas...
function applies (line 1632) | constexpr bool applies(TestCaseProperties tcp) {
function TestCaseProperties (line 1638) | TestCaseProperties parseSpecialTag( StringRef tag ) {
function isReservedTag (line 1654) | bool isReservedTag( StringRef tag ) {
function enforceNotReservedTag (line 1659) | void enforceNotReservedTag( StringRef tag, SourceLineInfo const& _line...
function makeDefaultName (line 1666) | std::string makeDefaultName() {
function StringRef (line 1671) | constexpr StringRef extractFilenamePart(StringRef filename) {
function sizeOfExtraTags (line 1689) | constexpr size_t sizeOfExtraTags(StringRef filepath) {
function makeTestCaseInfo (line 1705) | Detail::unique_ptr<TestCaseInfo>
function getCurrentNanosecondsSinceEpoch (line 1989) | static auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
type Detail (line 2020) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function Counts (line 2301) | Counts Counts::operator - ( Counts const& other ) const {
function Counts (line 2310) | Counts& Counts::operator += ( Counts const& other ) {
function Totals (line 2328) | Totals Totals::operator - ( Totals const& other ) const {
function Totals (line 2335) | Totals& Totals::operator += ( Totals const& other ) {
function Totals (line 2341) | Totals Totals::delta( Totals const& prevTotals ) const {
type Detail (line 2360) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function Version (line 2399) | Version const& libraryVersion() {
type Generators (line 2424) | namespace Generators {
function IGeneratorTracker (line 2428) | IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, ...
function IGeneratorTracker (line 2432) | IGeneratorTracker* createGeneratorTracker( StringRef generatorName,
type Detail (line 2449) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
type RandomFloatingGenerator<long double>::PImpl (line 2453) | struct RandomFloatingGenerator<long double>::PImpl {
method PImpl (line 2454) | PImpl( long double a, long double b, uint32_t seed ):
type Detail (line 2486) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
function StringRef (line 2567) | StringRef GeneratorUntypedBase::currentElementAsString() const {
type GeneratorTracker (line 5865) | struct GeneratorTracker final : TestCaseTracking::TrackerBase,
method GeneratorTracker (line 5872) | GeneratorTracker(
method GeneratorTracker (line 5909) | static GeneratorTracker*
method isGeneratorTracker (line 5950) | bool isGeneratorTracker() const override { return true; }
method close (line 5951) | void close() override {
method getGenerator (line 6018) | auto getGenerator() const -> GeneratorBasePtr const& override {
type Generators (line 2448) | namespace Generators {
function IGeneratorTracker (line 2428) | IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, ...
function IGeneratorTracker (line 2432) | IGeneratorTracker* createGeneratorTracker( StringRef generatorName,
type Detail (line 2449) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
type RandomFloatingGenerator<long double>::PImpl (line 2453) | struct RandomFloatingGenerator<long double>::PImpl {
method PImpl (line 2454) | PImpl( long double a, long double b, uint32_t seed ):
type Detail (line 2486) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
function StringRef (line 2567) | StringRef GeneratorUntypedBase::currentElementAsString() const {
type GeneratorTracker (line 5865) | struct GeneratorTracker final : TestCaseTracking::TrackerBase,
method GeneratorTracker (line 5872) | GeneratorTracker(
method GeneratorTracker (line 5909) | static GeneratorTracker*
method isGeneratorTracker (line 5950) | bool isGeneratorTracker() const override { return true; }
method close (line 5951) | void close() override {
method getGenerator (line 6018) | auto getGenerator() const -> GeneratorBasePtr const& override {
type Generators (line 2485) | namespace Generators {
function IGeneratorTracker (line 2428) | IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, ...
function IGeneratorTracker (line 2432) | IGeneratorTracker* createGeneratorTracker( StringRef generatorName,
type Detail (line 2449) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
type RandomFloatingGenerator<long double>::PImpl (line 2453) | struct RandomFloatingGenerator<long double>::PImpl {
method PImpl (line 2454) | PImpl( long double a, long double b, uint32_t seed ):
type Detail (line 2486) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
function StringRef (line 2567) | StringRef GeneratorUntypedBase::currentElementAsString() const {
type GeneratorTracker (line 5865) | struct GeneratorTracker final : TestCaseTracking::TrackerBase,
method GeneratorTracker (line 5872) | GeneratorTracker(
method GeneratorTracker (line 5909) | static GeneratorTracker*
method isGeneratorTracker (line 5950) | bool isGeneratorTracker() const override { return true; }
method close (line 5951) | void close() override {
method getGenerator (line 6018) | auto getGenerator() const -> GeneratorBasePtr const& override {
type Detail (line 2501) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
type Generators (line 2531) | namespace Generators {
function IGeneratorTracker (line 2428) | IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, ...
function IGeneratorTracker (line 2432) | IGeneratorTracker* createGeneratorTracker( StringRef generatorName,
type Detail (line 2449) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
type RandomFloatingGenerator<long double>::PImpl (line 2453) | struct RandomFloatingGenerator<long double>::PImpl {
method PImpl (line 2454) | PImpl( long double a, long double b, uint32_t seed ):
type Detail (line 2486) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
function StringRef (line 2567) | StringRef GeneratorUntypedBase::currentElementAsString() const {
type GeneratorTracker (line 5865) | struct GeneratorTracker final : TestCaseTracking::TrackerBase,
method GeneratorTracker (line 5872) | GeneratorTracker(
method GeneratorTracker (line 5909) | static GeneratorTracker*
method isGeneratorTracker (line 5950) | bool isGeneratorTracker() const override { return true; }
method close (line 5951) | void close() override {
method getGenerator (line 6018) | auto getGenerator() const -> GeneratorBasePtr const& override {
function IConfig (line 2607) | IConfig const * ReporterConfig::fullConfig() const { return m_fullConf...
function ColourMode (line 2608) | ColourMode ReporterConfig::colourMode() const { return m_colourMode; }
function handleExceptionMatchExpr (line 2750) | void handleExceptionMatchExpr( AssertionHandler& handler, std::string ...
type Detail (line 2762) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
type Clara (line 2827) | namespace Clara {
type Detail (line 2828) | namespace Detail {
function TokenStream (line 2877) | TokenStream& TokenStream::operator++() {
function ParserResult (line 2888) | ParserResult convertInto( std::string const& source,
function ParserResult (line 2894) | ParserResult convertInto( std::string const& source,
function InternalParseResult (line 2914) | InternalParseResult ParserBase::parse( Args const& args ) const {
function ParserResult (line 2922) | ParserResult BoundFlagRef::setFlag( bool flag ) {
function ParserResult (line 3073) | ParserResult ExeName::set(std::string const& newName) {
function Parser (line 3089) | Parser& Parser::operator|=( Parser const& other ) {
type ParserInfo (line 3169) | struct ParserInfo {
function makeCommandLineParser (line 3245) | Clara::Parser makeCommandLineParser( ConfigData& config ) {
class NoColourImpl (line 3669) | class NoColourImpl final : public ColourImpl {
method NoColourImpl (line 3671) | NoColourImpl( IStream* stream ): ColourImpl( stream ) {}
method use (line 3674) | void use( Colour::Code ) const override {}
class Win32ColourImpl (line 3687) | class Win32ColourImpl final : public ColourImpl {
method Win32ColourImpl (line 3689) | Win32ColourImpl(IStream* stream):
method useImplementationForStream (line 3698) | static bool useImplementationForStream(IStream const& stream) {
method use (line 3706) | void use( Colour::Code _colourCode ) const override {
method setTextAttribute (line 3730) | void setTextAttribute( WORD _textAttribute ) const {
class ANSIColourImpl (line 3759) | class ANSIColourImpl final : public ColourImpl {
method ANSIColourImpl (line 3761) | ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {}
method useImplementationForStream (line 3763) | static bool useImplementationForStream(IStream const& stream) {
method use (line 3785) | void use( Colour::Code _colourCode ) const override {
function makeColourImpl (line 3820) | Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode colourSelect...
function isColourImplAvailable (line 3849) | bool isColourImplAvailable( ColourMode colourSelection ) {
function Context (line 3877) | Context& getCurrentMutableContext() {
function SimplePcg32 (line 3881) | SimplePcg32& sharedRng() {
function writeToDebugConsole (line 3898) | void writeToDebugConsole( std::string const& text ) {
function writeToDebugConsole (line 3906) | void writeToDebugConsole( std::string const& text ) {
function writeToDebugConsole (line 3914) | void writeToDebugConsole( std::string const& text ) {
function isDebuggerActive (line 3945) | bool isDebuggerActive(){
function isDebuggerActive (line 3976) | bool isDebuggerActive() {
function isDebuggerActive (line 3995) | bool isDebuggerActive(){
function isDebuggerActive (line 4016) | bool isDebuggerActive() {
function isDebuggerActive (line 4023) | bool isDebuggerActive() {
function isDebuggerActive (line 4029) | bool isDebuggerActive() { return false; }
function formatReconstructedExpression (line 4045) | void formatReconstructedExpression( std::ostream &os, std::string cons...
function throw_exception (line 4062) | [[noreturn]]
function throw_logic_error (line 4070) | [[noreturn]]
function throw_domain_error (line 4075) | [[noreturn]]
function throw_runtime_error (line 4080) | [[noreturn]]
type Detail (line 4097) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function tryTranslators (line 4173) | static std::string tryTranslators(
type SignalDefs (line 4305) | struct SignalDefs { DWORD id; const char* name; }
function LONG (line 4323) | static LONG CALLBACK topLevelExceptionFilter(PEXCEPTION_POINTERS Excep...
type SignalDefs (line 4380) | struct SignalDefs {
type sigaction (line 4405) | struct sigaction
function restorePreviousSignalHandlers (line 4407) | static void restorePreviousSignalHandlers() noexcept {
function handleSignal (line 4419) | static void handleSignal( int sig ) {
type sigaction (line 4456) | struct sigaction
type Detail (line 4484) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
type Detail (line 4522) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
type Detail (line 4554) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function makeStream (line 4666) | auto makeStream( std::string const& filename ) -> Detail::unique_ptr<I...
function needsEscape (line 4691) | static bool needsEscape( char c ) {
function makeEscapeStringRef (line 4696) | static Catch::StringRef makeEscapeStringRef( char c ) {
function JsonValueWriter (line 4754) | JsonValueWriter JsonObjectWriter::write( StringRef key ) {
function JsonObjectWriter (line 4784) | JsonObjectWriter JsonArrayWriter::writeObject() {
function JsonArrayWriter (line 4790) | JsonArrayWriter JsonArrayWriter::writeArray() {
function JsonArrayWriter (line 4796) | JsonArrayWriter& JsonArrayWriter::write( bool value ) {
function JsonObjectWriter (line 4807) | JsonObjectWriter JsonValueWriter::writeObject() && {
function JsonArrayWriter (line 4811) | JsonArrayWriter JsonValueWriter::writeArray() && {
function listTests (line 4901) | void listTests(IEventListener& reporter, IConfig const& config) {
function listTags (line 4907) | void listTags(IEventListener& reporter, IConfig const& config) {
function listReporters (line 4929) | void listReporters(IEventListener& reporter) {
function listListeners (line 4941) | void listListeners(IEventListener& reporter) {
function list (line 4977) | bool list( IEventListener& reporter, Config const& config ) {
function isnan (line 5432) | bool isnan(float f) {
function isnan (line 5435) | bool isnan(double d) {
function isnan (line 5440) | bool isnan(float f) {
function isnan (line 5443) | bool isnan(double d) {
function nextafter (line 5449) | float nextafter( float x, float y ) { return std::nextafter( x, y ); }
function nextafter (line 5450) | double nextafter( double x, double y ) { return std::nextafter( x, y ); }
function nextafter (line 5452) | float nextafter( float x, float y ) { return ::nextafterf( x, y ); }
function nextafter (line 5453) | double nextafter( double x, double y ) { return ::nextafter( x, y ); }
function CATCH2_CLANG_NO_SANITIZE_INTEGER (line 5475) | CATCH2_CLANG_NO_SANITIZE_INTEGER
function CATCH2_CLANG_NO_SANITIZE_INTEGER (line 5509) | CATCH2_CLANG_NO_SANITIZE_INTEGER
function generateRandomSeed (line 5539) | std::uint32_t generateRandomSeed( GenerateFrom from ) {
type ReporterRegistry::ReporterRegistryImpl (line 5561) | struct ReporterRegistry::ReporterRegistryImpl {
function IEventListenerPtr (line 5593) | IEventListenerPtr
type kvPair (line 5638) | struct kvPair {
function kvPair (line 5642) | kvPair splitKVPair(StringRef kvString) {
type Detail (line 5652) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function parseReporterSpec (line 5725) | Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec ) {
type StringStreams (line 5804) | struct StringStreams {
method add (line 5810) | auto add() -> std::pair<std::size_t, std::ostringstream*> {
method release (line 5823) | void release( std::size_t index, std::ostream* originalPtr ) {
type Generators (line 5863) | namespace Generators {
function IGeneratorTracker (line 2428) | IGeneratorTracker* acquireGeneratorTracker(StringRef generatorName, ...
function IGeneratorTracker (line 2432) | IGeneratorTracker* createGeneratorTracker( StringRef generatorName,
type Detail (line 2449) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
type RandomFloatingGenerator<long double>::PImpl (line 2453) | struct RandomFloatingGenerator<long double>::PImpl {
method PImpl (line 2454) | PImpl( long double a, long double b, uint32_t seed ):
type Detail (line 2486) | namespace Detail {
function getSeed (line 2450) | std::uint32_t getSeed() { return sharedRng()(); }
function throw_generator_exception (line 2488) | [[noreturn]]
function StringRef (line 2567) | StringRef GeneratorUntypedBase::currentElementAsString() const {
type GeneratorTracker (line 5865) | struct GeneratorTracker final : TestCaseTracking::TrackerBase,
method GeneratorTracker (line 5872) | GeneratorTracker(
method GeneratorTracker (line 5909) | static GeneratorTracker*
method isGeneratorTracker (line 5950) | bool isGeneratorTracker() const override { return true; }
method close (line 5951) | void close() override {
method getGenerator (line 6018) | auto getGenerator() const -> GeneratorBasePtr const& override {
type Detail (line 6025) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function Totals (line 6162) | Totals RunContext::runTest(TestCaseHandle const& testCase) {
function IGeneratorTracker (line 6331) | IGeneratorTracker*
function IGeneratorTracker (line 6342) | IGeneratorTracker* RunContext::createGeneratorTracker(
function AssertionResult (line 6439) | const AssertionResult * RunContext::getLastResult() const {
function CATCH_CATCH_ANON (line 6569) | CATCH_CATCH_ANON (TestFailureException&) {
function CATCH_CATCH_ANON (line 6571) | CATCH_CATCH_ANON (TestSkipException&) {
function getSingletons (line 6843) | static auto getSingletons() -> std::vector<ISingleton*>*& {
function addSingleton (line 6853) | void addSingleton(ISingleton* singleton ) {
function cleanupSingletons (line 6856) | void cleanupSingletons() {
function startsWith (line 6940) | bool startsWith( std::string const& s, std::string const& prefix ) {
function startsWith (line 6943) | bool startsWith( StringRef s, char prefix ) {
function endsWith (line 6946) | bool endsWith( std::string const& s, std::string const& suffix ) {
function endsWith (line 6949) | bool endsWith( std::string const& s, char suffix ) {
function contains (line 6952) | bool contains( std::string const& s, std::string const& infix ) {
function toLowerInPlace (line 6955) | void toLowerInPlace( std::string& s ) {
function toLower (line 6960) | std::string toLower( std::string const& s ) {
function toLower (line 6965) | char toLower(char c) {
function trim (line 6969) | std::string trim( std::string const& str ) {
function StringRef (line 6977) | StringRef trim(StringRef ref) {
function replaceInPlace (line 6989) | bool replaceInPlace( std::string& str, std::string const& replaceThis,...
function splitStringRef (line 7015) | std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
function TagAlias (line 7104) | TagAlias const* TagAliasRegistry::find( std::string const& alias ) con...
function ITagAliasRegistry (line 7137) | ITagAliasRegistry const& ITagAliasRegistry::get() {
function enforceNoDuplicateTestCases (line 7184) | static void enforceNoDuplicateTestCases(
function matchTest (line 7206) | static bool matchTest( TestCaseHandle const& testCase,
function sortTests (line 7215) | std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vec...
function isThrowSafe (line 7266) | bool isThrowSafe( TestCaseHandle const& testCase, IConfig const& confi...
function filterTests (line 7270) | std::vector<TestCaseHandle> filterTests( std::vector<TestCaseHandle> c...
type TestCaseTracking (line 7326) | namespace TestCaseTracking {
function ITracker (line 7355) | ITracker* ITracker::findChild( NameAndLocationRef const& nameAndLoca...
function ITracker (line 7388) | ITracker& TrackerContext::startRun() {
function SectionTracker (line 7506) | SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAn...
function StringRef (line 7537) | StringRef SectionTracker::trimmedName() const {
function throw_test_failure_exception (line 7554) | void throw_test_failure_exception() {
function throw_test_skip_exception (line 7562) | void throw_test_skip_exception() {
function StringRef (line 7583) | static StringRef extractClassName( StringRef classOrMethodName ) {
class TestInvokerAsFunction (line 7611) | class TestInvokerAsFunction final : public ITestInvoker {
method TestInvokerAsFunction (line 7616) | constexpr TestInvokerAsFunction( TestType testAsFunction ) noexcept:
method invoke (line 7619) | void invoke() const override { m_testAsFunction(); }
function makeTestInvoker (line 7624) | Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction...
function TestSpecParser (line 7653) | TestSpecParser& TestSpecParser::parse( std::string const& arg ) {
function TestSpec (line 7671) | TestSpec TestSpecParser::testSpec() {
type TextFlow (line 7899) | namespace TextFlow {
function isBoundary (line 8005) | static bool isBoundary( AnsiSkippingString const& line,
function Column (line 8140) | Column Spacer( size_t spaceWidth ) {
function Columns (line 8214) | Columns operator+( Column const& lhs, Column const& rhs ) {
function Columns (line 8220) | Columns operator+( Column&& lhs, Column&& rhs ) {
function Columns (line 8227) | Columns& operator+=( Columns& lhs, Column const& rhs ) {
function Columns (line 8231) | Columns& operator+=( Columns& lhs, Column&& rhs ) {
function Columns (line 8235) | Columns operator+( Columns const& lhs, Column const& rhs ) {
function Columns (line 8240) | Columns operator+( Columns&& lhs, Column&& rhs ) {
function uncaught_exceptions (line 8254) | bool uncaught_exceptions() {
function trailingBytes (line 8317) | size_t trailingBytes(unsigned char c) {
function headerValue (line 8330) | uint32_t headerValue(unsigned char c) {
function hexEscapeChar (line 8343) | void hexEscapeChar(std::ostream& os, unsigned char c) {
function shouldNewline (line 8351) | constexpr bool shouldNewline(XmlFormatting fmt) {
function shouldIndent (line 8355) | constexpr bool shouldIndent(XmlFormatting fmt) {
function XmlWriter (line 8532) | XmlWriter& XmlWriter::startElement( std::string const& name, XmlFormat...
function XmlWriter (line 8552) | XmlWriter& XmlWriter::endElement(XmlFormatting fmt) {
function XmlWriter (line 8571) | XmlWriter& XmlWriter::writeAttribute( StringRef name,
function XmlWriter (line 8578) | XmlWriter& XmlWriter::writeAttribute( StringRef name, bool attribute ) {
function XmlWriter (line 8583) | XmlWriter& XmlWriter::writeAttribute( StringRef name,
function XmlWriter (line 8589) | XmlWriter& XmlWriter::writeText( StringRef text, XmlFormatting fmt ) {
function XmlWriter (line 8603) | XmlWriter& XmlWriter::writeComment( StringRef text, XmlFormatting fmt ) {
type Matchers (line 8646) | namespace Matchers {
function IsEmptyMatcher (line 8676) | IsEmptyMatcher IsEmpty() {
function HasSizeMatcher (line 8680) | HasSizeMatcher SizeIs(std::size_t sz) {
function ExceptionMessageMatcher (line 8700) | ExceptionMessageMatcher Message(std::string const& message) {
type Detail (line 8760) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function WithinUlpsMatcher (line 8878) | WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
function WithinUlpsMatcher (line 8882) | WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
function WithinAbsMatcher (line 8886) | WithinAbsMatcher WithinAbs(double target, double margin) {
function WithinRelMatcher (line 8890) | WithinRelMatcher WithinRel(double target, double eps) {
function WithinRelMatcher (line 8894) | WithinRelMatcher WithinRel(double target) {
function WithinRelMatcher (line 8898) | WithinRelMatcher WithinRel(float target, float eps) {
function WithinRelMatcher (line 8902) | WithinRelMatcher WithinRel(float target) {
function IsNaNMatcher (line 8917) | IsNaNMatcher IsNaN() { return IsNaNMatcher(); }
function AllTrueMatcher (line 8939) | AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
function NoneTrueMatcher (line 8943) | NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
function AnyTrueMatcher (line 8947) | AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
function StringRef (line 8967) | StringRef CasedString::caseSensitivitySuffix() const {
function StringEqualsMatcher (line 9036) | StringEqualsMatcher Equals( std::string const& str, CaseSensitive ca...
function StringContainsMatcher (line 9039) | StringContainsMatcher ContainsSubstring( std::string const& str, Cas...
function EndsWithMatcher (line 9042) | EndsWithMatcher EndsWith( std::string const& str, CaseSensitive case...
function StartsWithMatcher (line 9045) | StartsWithMatcher StartsWith( std::string const& str, CaseSensitive ...
function RegexMatcher (line 9049) | RegexMatcher Matches(std::string const& regex, CaseSensitive caseSen...
type Detail (line 9062) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
type Matchers (line 8664) | namespace Matchers {
function IsEmptyMatcher (line 8676) | IsEmptyMatcher IsEmpty() {
function HasSizeMatcher (line 8680) | HasSizeMatcher SizeIs(std::size_t sz) {
function ExceptionMessageMatcher (line 8700) | ExceptionMessageMatcher Message(std::string const& message) {
type Detail (line 8760) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function WithinUlpsMatcher (line 8878) | WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
function WithinUlpsMatcher (line 8882) | WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
function WithinAbsMatcher (line 8886) | WithinAbsMatcher WithinAbs(double target, double margin) {
function WithinRelMatcher (line 8890) | WithinRelMatcher WithinRel(double target, double eps) {
function WithinRelMatcher (line 8894) | WithinRelMatcher WithinRel(double target) {
function WithinRelMatcher (line 8898) | WithinRelMatcher WithinRel(float target, float eps) {
function WithinRelMatcher (line 8902) | WithinRelMatcher WithinRel(float target) {
function IsNaNMatcher (line 8917) | IsNaNMatcher IsNaN() { return IsNaNMatcher(); }
function AllTrueMatcher (line 8939) | AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
function NoneTrueMatcher (line 8943) | NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
function AnyTrueMatcher (line 8947) | AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
function StringRef (line 8967) | StringRef CasedString::caseSensitivitySuffix() const {
function StringEqualsMatcher (line 9036) | StringEqualsMatcher Equals( std::string const& str, CaseSensitive ca...
function StringContainsMatcher (line 9039) | StringContainsMatcher ContainsSubstring( std::string const& str, Cas...
function EndsWithMatcher (line 9042) | EndsWithMatcher EndsWith( std::string const& str, CaseSensitive case...
function StartsWithMatcher (line 9045) | StartsWithMatcher StartsWith( std::string const& str, CaseSensitive ...
function RegexMatcher (line 9049) | RegexMatcher Matches(std::string const& regex, CaseSensitive caseSen...
type Detail (line 9062) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
type Matchers (line 8690) | namespace Matchers {
function IsEmptyMatcher (line 8676) | IsEmptyMatcher IsEmpty() {
function HasSizeMatcher (line 8680) | HasSizeMatcher SizeIs(std::size_t sz) {
function ExceptionMessageMatcher (line 8700) | ExceptionMessageMatcher Message(std::string const& message) {
type Detail (line 8760) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function WithinUlpsMatcher (line 8878) | WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
function WithinUlpsMatcher (line 8882) | WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
function WithinAbsMatcher (line 8886) | WithinAbsMatcher WithinAbs(double target, double margin) {
function WithinRelMatcher (line 8890) | WithinRelMatcher WithinRel(double target, double eps) {
function WithinRelMatcher (line 8894) | WithinRelMatcher WithinRel(double target) {
function WithinRelMatcher (line 8898) | WithinRelMatcher WithinRel(float target, float eps) {
function WithinRelMatcher (line 8902) | WithinRelMatcher WithinRel(float target) {
function IsNaNMatcher (line 8917) | IsNaNMatcher IsNaN() { return IsNaNMatcher(); }
function AllTrueMatcher (line 8939) | AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
function NoneTrueMatcher (line 8943) | NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
function AnyTrueMatcher (line 8947) | AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
function StringRef (line 8967) | StringRef CasedString::caseSensitivitySuffix() const {
function StringEqualsMatcher (line 9036) | StringEqualsMatcher Equals( std::string const& str, CaseSensitive ca...
function StringContainsMatcher (line 9039) | StringContainsMatcher ContainsSubstring( std::string const& str, Cas...
function EndsWithMatcher (line 9042) | EndsWithMatcher EndsWith( std::string const& str, CaseSensitive case...
function StartsWithMatcher (line 9045) | StartsWithMatcher StartsWith( std::string const& str, CaseSensitive ...
function RegexMatcher (line 9049) | RegexMatcher Matches(std::string const& regex, CaseSensitive caseSen...
type Detail (line 9062) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function almostEqualUlps (line 8722) | bool almostEqualUlps(FP lhs, FP rhs, uint64_t maxUlpDiff) {
function FP (line 8737) | FP step(FP start, FP direction, uint64_t steps) {
function marginComparison (line 8746) | bool marginComparison(double lhs, double rhs, double margin) {
function write (line 8751) | void write(std::ostream& out, FloatingPoint num) {
type Matchers (line 8759) | namespace Matchers {
function IsEmptyMatcher (line 8676) | IsEmptyMatcher IsEmpty() {
function HasSizeMatcher (line 8680) | HasSizeMatcher SizeIs(std::size_t sz) {
function ExceptionMessageMatcher (line 8700) | ExceptionMessageMatcher Message(std::string const& message) {
type Detail (line 8760) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function WithinUlpsMatcher (line 8878) | WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
function WithinUlpsMatcher (line 8882) | WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
function WithinAbsMatcher (line 8886) | WithinAbsMatcher WithinAbs(double target, double margin) {
function WithinRelMatcher (line 8890) | WithinRelMatcher WithinRel(double target, double eps) {
function WithinRelMatcher (line 8894) | WithinRelMatcher WithinRel(double target) {
function WithinRelMatcher (line 8898) | WithinRelMatcher WithinRel(float target, float eps) {
function WithinRelMatcher (line 8902) | WithinRelMatcher WithinRel(float target) {
function IsNaNMatcher (line 8917) | IsNaNMatcher IsNaN() { return IsNaNMatcher(); }
function AllTrueMatcher (line 8939) | AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
function NoneTrueMatcher (line 8943) | NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
function AnyTrueMatcher (line 8947) | AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
function StringRef (line 8967) | StringRef CasedString::caseSensitivitySuffix() const {
function StringEqualsMatcher (line 9036) | StringEqualsMatcher Equals( std::string const& str, CaseSensitive ca...
function StringContainsMatcher (line 9039) | StringContainsMatcher ContainsSubstring( std::string const& str, Cas...
function EndsWithMatcher (line 9042) | EndsWithMatcher EndsWith( std::string const& str, CaseSensitive case...
function StartsWithMatcher (line 9045) | StartsWithMatcher StartsWith( std::string const& str, CaseSensitive ...
function RegexMatcher (line 9049) | RegexMatcher Matches(std::string const& regex, CaseSensitive caseSen...
type Detail (line 9062) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
type Matchers (line 8936) | namespace Matchers {
function IsEmptyMatcher (line 8676) | IsEmptyMatcher IsEmpty() {
function HasSizeMatcher (line 8680) | HasSizeMatcher SizeIs(std::size_t sz) {
function ExceptionMessageMatcher (line 8700) | ExceptionMessageMatcher Message(std::string const& message) {
type Detail (line 8760) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function WithinUlpsMatcher (line 8878) | WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
function WithinUlpsMatcher (line 8882) | WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
function WithinAbsMatcher (line 8886) | WithinAbsMatcher WithinAbs(double target, double margin) {
function WithinRelMatcher (line 8890) | WithinRelMatcher WithinRel(double target, double eps) {
function WithinRelMatcher (line 8894) | WithinRelMatcher WithinRel(double target) {
function WithinRelMatcher (line 8898) | WithinRelMatcher WithinRel(float target, float eps) {
function WithinRelMatcher (line 8902) | WithinRelMatcher WithinRel(float target) {
function IsNaNMatcher (line 8917) | IsNaNMatcher IsNaN() { return IsNaNMatcher(); }
function AllTrueMatcher (line 8939) | AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
function NoneTrueMatcher (line 8943) | NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
function AnyTrueMatcher (line 8947) | AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
function StringRef (line 8967) | StringRef CasedString::caseSensitivitySuffix() const {
function StringEqualsMatcher (line 9036) | StringEqualsMatcher Equals( std::string const& str, CaseSensitive ca...
function StringContainsMatcher (line 9039) | StringContainsMatcher ContainsSubstring( std::string const& str, Cas...
function EndsWithMatcher (line 9042) | EndsWithMatcher EndsWith( std::string const& str, CaseSensitive case...
function StartsWithMatcher (line 9045) | StartsWithMatcher StartsWith( std::string const& str, CaseSensitive ...
function RegexMatcher (line 9049) | RegexMatcher Matches(std::string const& regex, CaseSensitive caseSen...
type Detail (line 9062) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
type Matchers (line 8956) | namespace Matchers {
function IsEmptyMatcher (line 8676) | IsEmptyMatcher IsEmpty() {
function HasSizeMatcher (line 8680) | HasSizeMatcher SizeIs(std::size_t sz) {
function ExceptionMessageMatcher (line 8700) | ExceptionMessageMatcher Message(std::string const& message) {
type Detail (line 8760) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function WithinUlpsMatcher (line 8878) | WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
function WithinUlpsMatcher (line 8882) | WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
function WithinAbsMatcher (line 8886) | WithinAbsMatcher WithinAbs(double target, double margin) {
function WithinRelMatcher (line 8890) | WithinRelMatcher WithinRel(double target, double eps) {
function WithinRelMatcher (line 8894) | WithinRelMatcher WithinRel(double target) {
function WithinRelMatcher (line 8898) | WithinRelMatcher WithinRel(float target, float eps) {
function WithinRelMatcher (line 8902) | WithinRelMatcher WithinRel(float target) {
function IsNaNMatcher (line 8917) | IsNaNMatcher IsNaN() { return IsNaNMatcher(); }
function AllTrueMatcher (line 8939) | AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
function NoneTrueMatcher (line 8943) | NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
function AnyTrueMatcher (line 8947) | AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
function StringRef (line 8967) | StringRef CasedString::caseSensitivitySuffix() const {
function StringEqualsMatcher (line 9036) | StringEqualsMatcher Equals( std::string const& str, CaseSensitive ca...
function StringContainsMatcher (line 9039) | StringContainsMatcher ContainsSubstring( std::string const& str, Cas...
function EndsWithMatcher (line 9042) | EndsWithMatcher EndsWith( std::string const& str, CaseSensitive case...
function StartsWithMatcher (line 9045) | StartsWithMatcher StartsWith( std::string const& str, CaseSensitive ...
function RegexMatcher (line 9049) | RegexMatcher Matches(std::string const& regex, CaseSensitive caseSen...
type Detail (line 9062) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
type Matchers (line 9059) | namespace Matchers {
function IsEmptyMatcher (line 8676) | IsEmptyMatcher IsEmpty() {
function HasSizeMatcher (line 8680) | HasSizeMatcher SizeIs(std::size_t sz) {
function ExceptionMessageMatcher (line 8700) | ExceptionMessageMatcher Message(std::string const& message) {
type Detail (line 8760) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function WithinUlpsMatcher (line 8878) | WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
function WithinUlpsMatcher (line 8882) | WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
function WithinAbsMatcher (line 8886) | WithinAbsMatcher WithinAbs(double target, double margin) {
function WithinRelMatcher (line 8890) | WithinRelMatcher WithinRel(double target, double eps) {
function WithinRelMatcher (line 8894) | WithinRelMatcher WithinRel(double target) {
function WithinRelMatcher (line 8898) | WithinRelMatcher WithinRel(float target, float eps) {
function WithinRelMatcher (line 8902) | WithinRelMatcher WithinRel(float target) {
function IsNaNMatcher (line 8917) | IsNaNMatcher IsNaN() { return IsNaNMatcher(); }
function AllTrueMatcher (line 8939) | AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
function NoneTrueMatcher (line 8943) | NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
function AnyTrueMatcher (line 8947) | AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
function StringRef (line 8967) | StringRef CasedString::caseSensitivitySuffix() const {
function StringEqualsMatcher (line 9036) | StringEqualsMatcher Equals( std::string const& str, CaseSensitive ca...
function StringContainsMatcher (line 9039) | StringContainsMatcher ContainsSubstring( std::string const& str, Cas...
function EndsWithMatcher (line 9042) | EndsWithMatcher EndsWith( std::string const& str, CaseSensitive case...
function StartsWithMatcher (line 9045) | StartsWithMatcher StartsWith( std::string const& str, CaseSensitive ...
function RegexMatcher (line 9049) | RegexMatcher Matches(std::string const& regex, CaseSensitive caseSen...
type Detail (line 9062) | namespace Detail {
type FloatingPointKind (line 8762) | enum class FloatingPointKind : uint8_t {
function describe_multi_matcher (line 9064) | std::string describe_multi_matcher(StringRef combine, std::string ...
function handleExceptionMatchExpr (line 9099) | void handleExceptionMatchExpr( AssertionHandler& handler, StringMatche...
class AssertionPrinter (line 9197) | class AssertionPrinter {
method AssertionPrinter (line 9199) | AssertionPrinter& operator= (AssertionPrinter const&) = delete;
method AssertionPrinter (line 9200) | AssertionPrinter(AssertionPrinter const&) = delete;
method AssertionPrinter (line 9201) | AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats...
method print (line 9210) | void print() {
method printSourceInfo (line 9284) | void printSourceInfo() const {
method printResultType (line 9289) | void printResultType(Colour::Code colour, StringRef passOrFail) const {
method printIssue (line 9296) | void printIssue(char const* issue) const {
method printExpressionWas (line 9300) | void printExpressionWas() {
method printOriginalExpression (line 9310) | void printOriginalExpression() const {
method printReconstructedExpression (line 9316) | void printReconstructedExpression() const {
method printMessage (line 9323) | void printMessage() {
method printRemainingMessages (line 9330) | void printRemainingMessages(Colour::Code colour = compactDimColour) {
class ConsoleAssertionPrinter (line 9442) | class ConsoleAssertionPrinter {
method ConsoleAssertionPrinter (line 9444) | ConsoleAssertionPrinter& operator= (ConsoleAssertionPrinter const&) ...
method ConsoleAssertionPrinter (line 9445) | ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete;
method ConsoleAssertionPrinter (line 9446) | ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const&...
method print (line 9534) | void print() const {
method printResultType (line 9547) | void printResultType() const {
method printOriginalExpression (line 9552) | void printOriginalExpression() const {
method printReconstructedExpression (line 9558) | void printReconstructedExpression() const {
method printMessage (line 9567) | void printMessage() const {
method printSourceInfo (line 9576) | void printSourceInfo() const {
function makeRatio (line 9592) | std::size_t makeRatio( std::uint64_t number, std::uint64_t total ) {
type ColumnBreak (line 9609) | struct ColumnBreak {}
type RowBreak (line 9610) | struct RowBreak {}
type OutputFlush (line 9611) | struct OutputFlush {}
class Duration (line 9613) | class Duration {
type Unit (line 9614) | enum class Unit : uint8_t {
method Duration (line 9631) | explicit Duration(double inNanoseconds, Unit units = Unit::Auto)
method value (line 9649) | auto value() const -> double {
method StringRef (line 9663) | StringRef unitsAsString() const {
type Justification (line 9686) | enum class Justification : uint8_t {
type ColumnInfo (line 9691) | struct ColumnInfo {
class TablePrinter (line 9697) | class TablePrinter {
method TablePrinter (line 9705) | TablePrinter( std::ostream& os, std::vector<ColumnInfo> columnInfos )
method columnInfos (line 9709) | auto columnInfos() const -> std::vector<ColumnInfo> const& {
method open (line 9713) | void open() {
method close (line 9729) | void close() {
method TablePrinter (line 9738) | TablePrinter& operator<< (TablePrinter& tp, T const& value) {
method TablePrinter (line 9743) | TablePrinter& operator<< (TablePrinter& tp, ColumnBreak) {
method TablePrinter (line 9765) | TablePrinter& operator<< (TablePrinter& tp, RowBreak) {
method TablePrinter (line 9773) | TablePrinter& operator<<(TablePrinter& tp, OutputFlush) {
type BySectionInfo (line 10077) | struct BySectionInfo {
method BySectionInfo (line 10078) | BySectionInfo( SectionInfo const& other ): m_other( other ) {}
method BySectionInfo (line 10079) | BySectionInfo( BySectionInfo const& other ) = default;
type Detail (line 10095) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function listTestNamesOnly (line 10267) | void listTestNamesOnly(std::ostream& out,
function getFormattedDuration (line 10288) | std::string getFormattedDuration( double duration ) {
function shouldShowDuration (line 10308) | bool shouldShowDuration( IConfig const& config, double duration ) {
function serializeFilters (line 10319) | std::string serializeFilters( std::vector<std::string> const& filters ) {
function defaultListReporters (line 10348) | void
function defaultListListeners (line 10382) | void defaultListListeners( std::ostream& out,
function defaultListTags (line 10414) | void defaultListTags( std::ostream& out,
function defaultListTests (line 10456) | void defaultListTests(std::ostream& out, ColourImpl* streamColour, std...
class SummaryColumn (line 10497) | class SummaryColumn {
method SummaryColumn (line 10499) | SummaryColumn( std::string suffix, Colour::Code colour ):
method SummaryColumn (line 10502) | SummaryColumn&& addRow( std::uint64_t count ) && {
method getColour (line 10518) | Colour::Code getColour() const { return m_colour; }
function printSummaryRow (line 10530) | void printSummaryRow( std::ostream& stream,
function printTestRunTotals (line 10556) | void printTestRunTotals( std::ostream& stream,
function writeSourceInfo (line 10608) | void writeSourceInfo( JsonObjectWriter& writer,
function writeTags (line 10617) | void writeTags( JsonArrayWriter writer, std::vector<Tag> const& tags ) {
function writeProperties (line 10623) | void writeProperties( JsonArrayWriter writer,
function JsonArrayWriter (line 10675) | JsonArrayWriter& JsonReporter::startArray() {
function JsonArrayWriter (line 10680) | JsonArrayWriter& JsonReporter::startArray( StringRef key ) {
function JsonObjectWriter (line 10687) | JsonObjectWriter& JsonReporter::startObject() {
function JsonObjectWriter (line 10692) | JsonObjectWriter& JsonReporter::startObject( StringRef key ) {
function writeCounts (line 10736) | static void writeCounts( JsonObjectWriter&& writer, Counts const& coun...
function getCurrentTimestamp (line 10975) | std::string getCurrentTimestamp() {
function fileNameTag (line 10999) | std::string fileNameTag(std::vector<Tag> const& tags) {
function formatDuration (line 11017) | std::string formatDuration( double seconds ) {
function normalizeNamespaceMarkers (line 11023) | static void normalizeNamespaceMarkers(std::string& str) {
type Detail (line 11455) | namespace Detail {
type Endianness (line 2025) | struct Endianness {
type Arch (line 2026) | enum Arch : uint8_t {
method Arch (line 2031) | static Arch which() {
function fpToString (line 2041) | std::string fpToString(T value, int precision) {
function catch_strnlen (line 2061) | std::size_t catch_strnlen( const char* str, std::size_t n ) {
function formatTimeT (line 2067) | std::string formatTimeT(std::time_t time) {
function convertIntoString (line 2091) | std::string convertIntoString(StringRef string, bool escapeInvisible...
function convertIntoString (line 2129) | std::string convertIntoString(StringRef string) {
function rawMemoryToString (line 2133) | std::string rawMemoryToString( const void *object, std::size_t size ) {
function makeExceptionHappenedString (line 2149) | std::string makeExceptionHappenedString() {
function registerTranslatorImpl (line 2361) | void registerTranslatorImpl(
function missingCaptureInstance (line 2502) | void missingCaptureInstance() {
function StringRef (line 4102) | StringRef extractInstanceName(StringRef enumInstance) {
function parseEnums (line 4112) | std::vector<StringRef> parseEnums( StringRef enums ) {
function StringRef (line 4124) | StringRef EnumInfo::lookup( int value ) const {
function makeEnumInfo (line 4132) | Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName...
function EnumInfo (line 4146) | EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName...
function convertToBits (line 4486) | uint32_t convertToBits(float f) {
function convertToBits (line 4493) | uint64_t convertToBits(double d) {
function directCompare (line 4504) | bool directCompare( float lhs, float rhs ) { return lhs == rhs; }
function directCompare (line 4505) | bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
class StreamBufImpl (line 4557) | class StreamBufImpl final : public std::streambuf {
method StreamBufImpl (line 4562) | StreamBufImpl() {
method overflow (line 4571) | int overflow( int c ) override {
method sync (line 4583) | int sync() override {
type OutputDebugWriter (line 4594) | struct OutputDebugWriter {
class FileStream (line 4605) | class FileStream final : public IStream {
method FileStream (line 4608) | FileStream( std::string const& filename ) {
class CoutStream (line 4621) | class CoutStream final : public IStream {
method CoutStream (line 4626) | CoutStream() : m_os( Catch::cout().rdbuf() ) {}
method isConsole (line 4630) | bool isConsole() const override { return true; }
class CerrStream (line 4633) | class CerrStream : public IStream {
method CerrStream (line 4639) | CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
method isConsole (line 4643) | bool isConsole() const override { return true; }
class DebugOutStream (line 4648) | class DebugOutStream final : public IStream {
method DebugOutStream (line 4652) | DebugOutStream()
function splitReporterSpec (line 5653) | std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
function stringToColourMode (line 5702) | Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
class MessageHolder (line 6062) | class MessageHolder {
method addUnscopedMessage (line 6074) | void addUnscopedMessage( MessageInfo&& info ) {
method addUnscopedMessage (line 6080) | void addUnscopedMessage(MessageBuilder&& builder) {
method addScopedMessage (line 6086) | void addScopedMessage(MessageInfo&& info) {
method removeMessage (line 6094) | void removeMessage( unsigned int messageId ) {
method removeUnscopedMessages (line 6112) | void removeUnscopedMessages() {
method repairUnscopedMessageInvariant (line 6120) | void repairUnscopedMessageInvariant() {
function CATCH_INTERNAL_START_WARNINGS_SUPPRESSION (line 6126) | CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
function AssertionStats (line 10111) | AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
function registerReporterImpl (line 11457) | void registerReporterImpl( std::string const& name,
function createMetadataString (line 11486) | std::string createMetadataString(IConfig const& config) {
class TapAssertionPrinter (line 11659) | class TapAssertionPrinter {
method TapAssertionPrinter (line 11661) | TapAssertionPrinter& operator= (TapAssertionPrinter const&) = delete;
method TapAssertionPrinter (line 11662) | TapAssertionPrinter(TapAssertionPrinter const&) = delete;
method TapAssertionPrinter (line 11663) | TapAssertionPrinter(std::ostream& _stream, AssertionStats const& _st...
method print (line 11672) | void print() {
method printResultType (line 11749) | void printResultType(StringRef passOrFail) const {
method printIssue (line 11755) | void printIssue(StringRef issue) const {
method printExpressionWas (line 11759) | void printExpressionWas() {
method printOriginalExpression (line 11768) | void printOriginalExpression() const {
method printReconstructedExpression (line 11774) | void printReconstructedExpression() const {
method printMessage (line 11784) | void printMessage() {
method printRemainingMessages (line 11791) | void printRemainingMessages(Colour::Code colour = tapDimColour) {
function printHeaderString (line 11873) | void printHeaderString(std::ostream& os, std::string const& _string, s...
function escape (line 11884) | std::string escape(StringRef str) {
type Catch (line 57) | namespace Catch {
type Benchmark (line 44) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 58) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 129) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 148) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 149) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 185) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 363) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Benchmark (line 184) | namespace Benchmark {
type Detail (line 45) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 59) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first, FDura...
type do_nothing (line 131) | struct do_nothing {
type optimized_away_error (line 150) | struct optimized_away_error : std::exception {
function throw_optimized_away_error (line 158) | void throw_optimized_away_error() {
function sample (line 189) | static sample
function outlier_variance (line 215) | static double outlier_variance( Estimate<double> mean,
function erf_inv (line 248) | static double erf_inv( double x ) {
function standard_deviation (line 324) | static double
function sample (line 339) | static sample jackknife( double ( *estimator )( double const*,
function weighted_average_quantile (line 365) | double weighted_average_quantile( int k,
function OutlierClassification (line 383) | OutlierClassification
function mean (line 412) | double mean( double const* first, double const* last ) {
function normal_cdf (line 422) | double normal_cdf( double x ) {
function erfc_inv (line 426) | double erfc_inv(double x) {
function normal_quantile (line 430) | double normal_quantile(double p) {
function bootstrap (line 446) | Estimate<double>
function bootstrap_analysis (line 504) | bootstrap_analysis analyse_samples(double confidence_level,
type Detail (line 130) | namespace Detail {
function SampleAnalysis (line 60) | SampleAnalysis analyse(const IConfig &cfg, FDuration* first
Condensed preview — 14 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,071K chars).
[
{
"path": ".clang-format",
"chars": 59,
"preview": "BasedOnStyle: LLVM\nIndentWidth: 4\nBinPackArguments: false\n\n"
},
{
"path": ".github/workflows/ci.yml",
"chars": 4407,
"preview": "name: CI\n\non:\n push:\n branches:\n - master\n pull_request:\n branches:\n - master\n schedule:\n - cron: "
},
{
"path": ".gitignore",
"chars": 106,
"preview": "_build/*\nbuild/*\n\ncompile_commands.json\ntags\n\n.vscode\nkeychain.sublime-project\nkeychain.sublime-workspace\n"
},
{
"path": "CMakeLists.txt",
"chars": 2670,
"preview": "cmake_minimum_required(VERSION 3.12.4)\n\nproject(keychain)\n\noption(BUILD_TESTS \"Build tests for ${PROJECT_NAME}\" OFF)\nopt"
},
{
"path": "LICENSE",
"chars": 1072,
"preview": "Copyright (c) 2019 Hannes Rantzsch, René Meusel\n\nPermission is hereby granted, free of charge, to any person obtaining a"
},
{
"path": "README.md",
"chars": 4459,
"preview": "# Keychain\n\n[](https://github.com/hrantzs"
},
{
"path": "include/keychain/keychain.h",
"chars": 5410,
"preview": "/*\n * Copyright (c) 2019 Hannes Rantzsch, René Meusel\n *\n * Permission is hereby granted, free of charge, to any person "
},
{
"path": "src/keychain_linux.cpp",
"chars": 6406,
"preview": "/*\n * Copyright (c) 2013 GitHub Inc.\n * Copyright (c) 2015-2019 Vaclav Slavik\n * Copyright (c) 2019 Hannes Rantzsch, Ren"
},
{
"path": "src/keychain_mac.cpp",
"chars": 10721,
"preview": "/*\n * Copyright (c) 2013 GitHub Inc.\n * Copyright (c) 2019 Hannes Rantzsch\n *\n * Permission is hereby granted, free of c"
},
{
"path": "src/keychain_win.cpp",
"chars": 7995,
"preview": "/*\n * Copyright (c) 2013 GitHub Inc.\n * Copyright (c) 2019 Hannes Rantzsch, René Meusel\n *\n * Permission is hereby grant"
},
{
"path": "test/CMakeLists.txt",
"chars": 371,
"preview": "set(TEST_BINARY_NAME \"${PROJECT_NAME}-test\")\n\nadd_executable(${TEST_BINARY_NAME} \"catch_amalgamated.cpp\" \"tests.cpp\")\nta"
},
{
"path": "test/catch_amalgamated.cpp",
"chars": 446773,
"preview": "\n// Copyright Catch2 Authors\n// Distributed under the Boost Software License, Version 1.0.\n// (See accomp"
},
{
"path": "test/catch_amalgamated.hpp",
"chars": 542003,
"preview": "\n// Copyright Catch2 Authors\n// Distributed under the Boost Software License, Version 1.0.\n// (See accomp"
},
{
"path": "test/tests.cpp",
"chars": 5071,
"preview": "#include \"catch_amalgamated.hpp\"\n#include \"keychain/keychain.h\"\n\nusing namespace keychain;\n\n// clang-format off\nCATCH_RE"
}
]
About this extraction
This page contains the full source code of the hrantzsch/keychain GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 14 files (1013.2 KB), approximately 225.1k tokens, and a symbol index with 2034 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.