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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFædon Jóhannes2024-02-16 15:58:09 +0000
committerGitHub2024-02-16 16:58:09 +0100
commit3157d6bbf163c8c10534ef6e0d8a834d20b3660a (patch)
treea3277966cc079f0369ab0b25e2a724710687c744
parent4570fca24b2fd04f82f2376b090abfa5dde965c3 (diff)
downloadcatch3-3157d6bbf163c8c10534ef6e0d8a834d20b3660a.tar.gz
Add Bazel instructions to integration docs (#2812)
Co-authored-by: Fædon Jóhannes Sinis <fs@treble.tech>
-rw-r--r--docs/cmake-integration.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/cmake-integration.md b/docs/cmake-integration.md
index 86666efe..bc492e17 100644
--- a/docs/cmake-integration.md
+++ b/docs/cmake-integration.md
@@ -408,6 +408,24 @@ cd vcpkg
The catch2 port in vcpkg is kept up to date by microsoft team members and community contributors.
If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
+## Installing Catch2 from Bazel
+
+Catch2 is now a supported module in the Bazel Central Registry. You only need to add one line to your MODULE.bazel file;
+please see https://registry.bazel.build/modules/catch2 for the latest supported version.
+
+You can then add `catch2_main` to each of your C++ test build rules as follows:
+
+```
+cc_test(
+ name = "example_test",
+ srcs = ["example_test.cpp"],
+ deps = [
+ ":example",
+ "@catch2//:catch2_main",
+ ],
+)
+```
+
---
[Home](Readme.md#top)