Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable building Catch2 as a dynamic library #2398

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -31,4 +31,6 @@ benchmark-dir
bazel-*
build-fuzzers
debug-build
build/
.cache
.vscode
21 changes: 21 additions & 0 deletions CMakePresets.json
Expand Up @@ -20,6 +20,27 @@
"CATCH_BUILD_SURROGATES": "ON",
"CATCH_ENABLE_CONFIGURE_TESTS": "ON"
}
},
{
"name": "basic-tests-shared",
"displayName": "Basic development build with BUILD_SHARED_LIBS=ON",
"description": "Enables development build with basic tests that are cheap to build and run",
"cacheVariables": {
"CATCH_DEVELOPMENT_BUILD": "ON",
"BUILD_SHARED_LIBS": "ON"
}
},
{
"name": "all-tests-shared",
"inherits": "basic-tests-shared",
"displayName": "Full development build with BUILD_SHARED_LIBS=ON",
"description": "Enables development build with examples and ALL tests",
"cacheVariables": {
"CATCH_BUILD_EXAMPLES": "ON",
"CATCH_BUILD_EXTRA_TESTS": "ON",
"CATCH_BUILD_SURROGATES": "ON",
"CATCH_ENABLE_CONFIGURE_TESTS": "ON"
}
}
]
}
8 changes: 6 additions & 2 deletions extras/catch_amalgamated.cpp
Expand Up @@ -6,7 +6,7 @@
// SPDX-License-Identifier: BSL-1.0

// Catch v3.0.0-preview.5
// Generated: 2022-04-20 23:45:15.004945
// Generated: 2022-04-26 23:43:38.004914
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
Expand Down Expand Up @@ -635,6 +635,7 @@ namespace Catch {
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; }
Expand Down Expand Up @@ -2412,7 +2413,7 @@ namespace Catch {
return Detail::InternalParseResult::runtimeError(
"Expected argument following " +
token.token);
auto result = valueRef->setValue(argToken.token);
const auto result = valueRef->setValue(argToken.token);
if (!result)
return Detail::InternalParseResult(result);
if (result.value() ==
Expand Down Expand Up @@ -3125,6 +3126,9 @@ namespace Catch {
| Opt( setWaitForKeypress, "never|start|exit|both" )
["--wait-for-keypress"]
( "waits for a keypress before exiting" )
| Opt( config.skipBenchmarks)
["--skip-benchmarks"]
( "disable running benchmarks")
| Opt( config.benchmarkSamples, "samples" )
["--benchmark-samples"]
( "number of samples to collect (default: 100)" )
Expand Down