Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/benchmarks
diff options
context:
space:
mode:
authorLeitwolf2026-10-25 10:31:36 +0300
committerGitHub2026-10-25 10:31:36 +0300
commitd2e3e074bb2e1b8ffd9fc990d0b87667ea602f58 (patch)
tree0bce4462b2e190c39b3e1c5f697e3e4abd1a5e2a /benchmarks
parent13f81a480a93807c14dddb5abdb97355ced4d4c5 (diff)
parent126dc333564cb72b5115d9a9242d66694694b6d0 (diff)
downloadcatch3-d2e3e074bb2e1b8ffd9fc990d0b87667ea602f58.tar.gz
Merge pull request #18 from Progmasoft/build/catch3-identity
Give Catch3 its own build names and headers
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/CMakeLists.txt6
-rw-r--r--benchmarks/assertion_listener.cpp4
-rw-r--r--benchmarks/discover_tests/benchmark_discovery.py4
-rw-r--r--benchmarks/discover_tests/copy_shim.cmake2
-rw-r--r--benchmarks/only_include.cpp6
-rw-r--r--benchmarks/readme.md16
-rw-r--r--benchmarks/runtime_assertion_benches.cpp4
7 files changed, 21 insertions, 21 deletions
diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt
index b5819c79..6ca9b2cf 100644
--- a/benchmarks/CMakeLists.txt
+++ b/benchmarks/CMakeLists.txt
@@ -13,9 +13,9 @@ add_executable(EmptyExecutable
only_include.cpp
)
-target_link_libraries(AssertionsFastPath PRIVATE Catch2::Catch2WithMain)
-target_link_libraries(AssertionsSlowPath PRIVATE Catch2::Catch2WithMain)
-target_link_libraries(EmptyExecutable PRIVATE Catch2::Catch2WithMain)
+target_link_libraries(AssertionsFastPath PRIVATE Catch3::Catch3WithMain)
+target_link_libraries(AssertionsSlowPath PRIVATE Catch3::Catch3WithMain)
+target_link_libraries(EmptyExecutable PRIVATE Catch3::Catch3WithMain)
list(APPEND CATCH_TEST_TARGETS AssertionsFastPath AssertionsSlowPath EmptyExecutable)
set(CATCH_TEST_TARGETS ${CATCH_TEST_TARGETS} PARENT_SCOPE)
diff --git a/benchmarks/assertion_listener.cpp b/benchmarks/assertion_listener.cpp
index 38399568..1b7d0cad 100644
--- a/benchmarks/assertion_listener.cpp
+++ b/benchmarks/assertion_listener.cpp
@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
-#include <catch2/reporters/catch_reporter_event_listener.hpp>
-#include <catch2/reporters/catch_reporter_registrars.hpp>
+#include <Progmasoft/Catch3/Reporters/EventListener.hpp>
+#include <Progmasoft/Catch3/Reporters/Registrars.hpp>
/**
* Event listener that listens to all assertions, forcing assertion slow path
diff --git a/benchmarks/discover_tests/benchmark_discovery.py b/benchmarks/discover_tests/benchmark_discovery.py
index ea0c5229..6314e32b 100644
--- a/benchmarks/discover_tests/benchmark_discovery.py
+++ b/benchmarks/discover_tests/benchmark_discovery.py
@@ -152,12 +152,12 @@ def print_table(counts, tag_modes, results):
def main():
parser = argparse.ArgumentParser(
- description="Benchmark the CMake-side cost of catch_discover_tests."
+ description="Benchmark the CMake-side cost of catch3_discover_tests."
)
parser.add_argument(
"--script",
required=True,
- help="Path to the CatchAddTests.cmake to benchmark.",
+ help="Path to the Catch3AddTests.cmake to benchmark.",
)
args = parser.parse_args()
diff --git a/benchmarks/discover_tests/copy_shim.cmake b/benchmarks/discover_tests/copy_shim.cmake
index d1babc1b..d4243f1b 100644
--- a/benchmarks/discover_tests/copy_shim.cmake
+++ b/benchmarks/discover_tests/copy_shim.cmake
@@ -2,7 +2,7 @@
# Fake Catch2 binary used by benchmark_discovery.py.
#
-# catch_discover_tests_impl discovers tests by running
+# catch3_discover_tests_impl discovers tests by running
#
# ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ... --list-tests --reporter json --out <file>
#
diff --git a/benchmarks/only_include.cpp b/benchmarks/only_include.cpp
index d82cbcc3..660adf17 100644
--- a/benchmarks/only_include.cpp
+++ b/benchmarks/only_include.cpp
@@ -7,10 +7,10 @@
// SPDX-License-Identifier: BSL-1.0
/**\file
- * "empty" include of catch_test_macros.hpp
+ * "empty" include of Progmasoft/Catch3/TestMacros.hpp
*
- * This file does only one thing: include `catch2/catch_test_macros.hpp`,
+ * This file does only one thing: include `Progmasoft/Catch3/TestMacros.hpp`,
* so that we can measure the compilation cost of the header.
*/
-#include <catch2/catch_test_macros.hpp>
+#include <Progmasoft/Catch3/TestMacros.hpp>
diff --git a/benchmarks/readme.md b/benchmarks/readme.md
index 52d557c5..81152aaf 100644
--- a/benchmarks/readme.md
+++ b/benchmarks/readme.md
@@ -67,7 +67,7 @@ Catch2 is also important.
### Examples
-**Compare overhead of including `catch_test_macros.hpp`**
+**Compare overhead of including `Progmasoft/Catch3/TestMacros.hpp`**
```text
hyperfine --warmup 2 --shell none --parameter-list version old,new '/usr/bin/c++ -I/home/xarn/benches/Catch2-{version}/src/catch2/.. -I/home/xarn/benches/Catch2-{version}/build-debug/generated-includes -g -o /dev/null -c /home/xarn/benches/Catch2-{version}/benchmarks/only_include.cpp'
```
@@ -83,18 +83,18 @@ TODO:
## Misc. benchmarks
-### `catch_discover_tests`
+### `catch3_discover_tests`
-The first JSON-based implementation of `catch_discover_tests` turned out
+The first JSON-based implementation of `catch3_discover_tests` turned out
to have quadratic complexity in number of tests, which meant that registering
say 1k test cases took ~4s , and it became unusably slow with larger
test suites.
To prevent backsliding, and enable future optimizations, there is now
-a benchmarking script for `catch_discover_tests` in the `discover_tests`
+a benchmarking script for `catch3_discover_tests` in the `discover_tests`
directory.
-`discover_tests/benchmark_discovery.py` runs the real `catch_discover_tests`
+`discover_tests/benchmark_discovery.py` runs the real `catch3_discover_tests`
implementation (through CMake script-mode) on a synthesized JSON listing
(generated from `discover_tests/listing_template.json`) through an executor
shim (`discover_tests/copy_shim.cmake`). This means it can run even without
@@ -107,11 +107,11 @@ it down to keep only ~10 entries.
#### Examples
-**Benchmark the current `catch_discover_tests`, with and without tags-as-labels**
+**Benchmark the current `catch3_discover_tests`, with and without tags-as-labels**
```text
-./benchmarks/discover_tests/benchmark_discovery.py --script ./extras/CatchAddTests.cmake
+./benchmarks/discover_tests/benchmark_discovery.py --script ./extras/Catch3AddTests.cmake
```
Note that 8k test cases is unrealistically high, but still useful to see scaling.
Benchmark for single test case is useful to provide estimate of the flat
-overhead from using `catch_discover_tests` at all.
+overhead from using `catch3_discover_tests` at all.
diff --git a/benchmarks/runtime_assertion_benches.cpp b/benchmarks/runtime_assertion_benches.cpp
index 1202b0cd..3145707c 100644
--- a/benchmarks/runtime_assertion_benches.cpp
+++ b/benchmarks/runtime_assertion_benches.cpp
@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
-#include <catch2/catch_test_macros.hpp>
-#include <catch2/matchers/catch_matchers_templated.hpp>
+#include <Progmasoft/Catch3/TestMacros.hpp>
+#include <Progmasoft/Catch3/Matchers/Templated.hpp>
namespace {